-
Notifications
You must be signed in to change notification settings - Fork 231
Support span log fields in zipkin sender #226
Conversation
} | ||
} | ||
|
||
return annotations; | ||
} | ||
|
||
private static String logFieldsAsMessage(Map<String, ?> logFields) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other languages we used JSON encoding for structured data when converting to Zipkin. The Zipkin UI understands those and displays then better too. The openracing library for Zipkin (at least in Go) also does JSON encoding of KV logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better. Will switch to a JSON encoding for this. Looks like Gson is on the classpath already.
Codecov Report
@@ Coverage Diff @@
## master #226 +/- ##
============================================
+ Coverage 81.2% 81.42% +0.21%
- Complexity 490 494 +4
============================================
Files 79 79
Lines 1889 1895 +6
Branches 227 229 +2
============================================
+ Hits 1534 1543 +9
+ Misses 259 258 -1
+ Partials 96 94 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@vprithvi please merge if looks ok
lgtm |
@pvlugter thanks for the fix! |
We're using the Jaeger client to support reporting to both Jaeger and Zipkin. The Zipkin sender currently fails on spans with logs using fields, when the Annotation value (from the LogData message) is null. Recent versions of the Jaeger client also log structured data when baggage is attached, so the Zipkin sender fails on spans with baggage too.
Changes here check whether there is a message or fields, and create a single string message from the structured data fields. An alternative would be to just have the null check and only add annotations for simple message logs.