stankiewicz commented on code in PR #39625:
URL: https://github.com/apache/beam/pull/39625#discussion_r3749857530
##########
runners/google-cloud-dataflow-java/worker/src/test/java/org/apache/beam/runners/dataflow/worker/logging/DataflowWorkerLoggingHandlerTest.java:
##########
@@ -369,7 +391,42 @@ public void testWithCustomDataEnabledWithMdc() throws
IOException {
+
"\"message\":\"test.message\",\"thread\":\"2\",\"logger\":\"LoggerName\","
+ "\"custom_data\":{\"key1\":\"cool
value\",\"key2\":\"another\"}}"
+ System.lineSeparator(),
- createJson(createLogRecord(), null, true));
+ createJson(createLogRecord(), null, true, null));
+ }
+ }
+
+ @Test
+ public void testWithOpenTelemetryTrace() throws IOException {
+ SdkTracerProvider tracerProvider =
+ SdkTracerProvider.builder()
+
.addSpanProcessor(BatchSpanProcessor.builder(InMemorySpanExporter.create()).build())
+ .build();
+
+ // 2. Build the OpenTelemetry instance
+ OpenTelemetry openTelemetry =
+ OpenTelemetrySdk.builder()
+ .setTracerProvider(tracerProvider)
+ .build(); // Automatically calls GlobalOpenTelemetry.set()
+ Tracer tracer = openTelemetry.getTracer("foo");
+ Span span = tracer.spanBuilder("test").startSpan();
+ try (Scope scope = span.makeCurrent()) {
+ SpanContext spanContext = Span.current().getSpanContext();
Review Comment:
100% sample is default but I've added it explicitly.
--
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]