diff --git a/qlog/qlog_test.go b/qlog/qlog_test.go index a0d570777..2a5080ee9 100644 --- a/qlog/qlog_test.go +++ b/qlog/qlog_test.go @@ -102,6 +102,7 @@ var _ = Describe("Tracing", func() { Expect(commonFields).To(HaveKey("reference_time")) referenceTime := time.Unix(0, int64(commonFields["reference_time"].(float64)*1e6)) Expect(referenceTime).To(BeTemporally("~", time.Now(), scaleDuration(10*time.Millisecond))) + Expect(commonFields).To(HaveKeyWithValue("time_format", "relative")) Expect(trace).To(HaveKey("vantage_point")) vantagePoint := trace["vantage_point"].(map[string]interface{}) Expect(vantagePoint).To(HaveKeyWithValue("type", "server")) diff --git a/qlog/trace.go b/qlog/trace.go index 253ca270f..4f0b5e64e 100644 --- a/qlog/trace.go +++ b/qlog/trace.go @@ -49,6 +49,7 @@ func (f commonFields) MarshalJSONObject(enc *gojay.Encoder) { enc.StringKey("group_id", f.ODCID.String()) enc.StringKeyOmitEmpty("protocol_type", f.ProtocolType) enc.Float64Key("reference_time", float64(f.ReferenceTime.UnixNano())/1e6) + enc.StringKey("time_format", "relative") } func (f commonFields) IsNil() bool { return false }