scwhittle commented on code in PR #39625:
URL: https://github.com/apache/beam/pull/39625#discussion_r3720648178


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/logging/DataflowWorkerLoggingHandler.java:
##########
@@ -606,6 +622,13 @@ public synchronized void publishToDisk(
       writeIfNotEmpty(generator, "work", DataflowWorkerLoggingMDC.getWorkId());
       writeIfNotEmpty(generator, "logger", record.getLoggerName());
       writeIfNotEmpty(generator, "exception", 
formatException(record.getThrown()));
+      SpanContext spanContext = Span.current().getSpanContext();
+      if (logOpenTelemetryTraceSpanIdAndSampled.get() && 
spanContext.isValid()) {
+        generator.writeStringField("trace", spanContext.getTraceId());
+        generator.writeStringField("spanId", spanContext.getSpanId());
+        generator.writeBooleanField("traceSampled", spanContext.isSampled());

Review Comment:
   hmm the documented agent format is also inconsistent 
https://docs.cloud.google.com/logging/docs/structured-logging#structured_logging_special_fields
   
   uses trace_sampled and spanId



-- 
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