qlog: use version_mismatch trigger on transport:connection_closed event (#3724)

This commit is contained in:
Marten Seemann 2023-03-27 00:24:30 +11:00 committed by GitHub
parent 6d7280b7dc
commit 11f493381f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View file

@ -148,8 +148,7 @@ func (e eventConnectionClosed) MarshalJSONObject(enc *gojay.Encoder) {
enc.StringKey("connection_code", transportError(transportErr.ErrorCode).String())
enc.StringKey("reason", transportErr.ErrorMessage)
case errors.As(e.e, &versionNegotiationErr):
enc.StringKey("owner", ownerRemote.String())
enc.StringKey("trigger", "version_negotiation")
enc.StringKey("trigger", "version_mismatch")
}
}

View file

@ -245,9 +245,8 @@ var _ = Describe("Tracing", func() {
Expect(entry.Time).To(BeTemporally("~", time.Now(), scaleDuration(10*time.Millisecond)))
Expect(entry.Name).To(Equal("transport:connection_closed"))
ev := entry.Event
Expect(ev).To(HaveLen(2))
Expect(ev).To(HaveKeyWithValue("owner", "remote"))
Expect(ev).To(HaveKeyWithValue("trigger", "version_negotiation"))
Expect(ev).To(HaveLen(1))
Expect(ev).To(HaveKeyWithValue("trigger", "version_mismatch"))
})
It("records application errors", func() {