aabmass opened a new pull request, #2498:
URL: https://github.com/apache/logging-log4j2/pull/2498

   This PR adds a few tracing related JSON fields to the included 
`GcpLayout.json` event template which are documented in the [Cloud Logging 
docs](https://cloud.google.com/logging/docs/structured-logging#structured_logging_special_fields).
   
   The intended source is [well known OpenTelemetry MDC 
keys](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/v2.3.0/docs/logger-mdc-instrumentation.md)
 encoded as a hex strings following the [W3C Trace Context 
standard](https://www.w3.org/TR/trace-context/#trace-id).
   
   - MDC `trace_id` -> `logging.googleapis.com/trace`
   - MDC `span_id` -> `logging.googleapis.com/spanId`
   - `true` -> `logging.googleapis.com/trace_sampled`. This is unconditionally 
set to true because there is currently no way to derive it from W3C 
`trace_flags` with JTL (see 
https://github.com/apache/logging-log4j2/discussions/2482). I'm OK to remove 
this if needed, as it will affect existing users even if the MDC keys are not 
set.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to