-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add trace context fields to GcpLayout.json #2498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
vy
left a comment
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.
@aabmass, thanks so much for the contribution! Much appreciated! 🙇
A quick question just before merging it: If trace_id and/or span_id MDC values are missing, logging.googleapis.com/trace_sampled will still be set to true without logging.googleapis.com/trace and/or logging.googleapis.com/spanId fields. Will this still be okay?
I would also really appreciate it if you can create a src/changelog/.2.x.x/add_GcpLayout_tracing_support.xml changelog entry file.
Would appreciate a quick LGTM from @dashpole, @punya, or @jsuereth on this point before merging |
Added |
|
@aabmass, thanks so much! I will merge this once CI passes and |
Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>



This PR adds a few tracing related JSON fields to the included
GcpLayout.jsonevent template which are documented in the Cloud Logging docs.The intended source is well known OpenTelemetry MDC keys encoded as a hex strings following the W3C Trace Context standard.
trace_id->logging.googleapis.com/tracespan_id->logging.googleapis.com/spanIdtrue->logging.googleapis.com/trace_sampled. This is unconditionally set to true because there is currently no way to derive it from W3Ctrace_flagswith JTL (see Can JsonTemplateLayout output JSON boolean values? #2482). I'm OK to remove this if needed, as it will affect existing users even if the MDC keys are not set. However it's absence does break some GCP UI features.