Force flush traces from agent TracerProvider #7865
-
Is there a mechanism for force flushing traces from the java agent tracer provider? I have cucumber acceptance tests which are auto-instrumented using the java agent. The application under test is also instrumented and the spans for both are sent to the same jaeger instance. For each cucumber scenario, using some manual instrumentation, I start a trace and have a span for each step. After completion of a scenario I end the scenario trace. What I would like to be able to do after ending the scenario trace is to force flush all related spans, and then call the jaeger traces API to add the trace json as an attachment to the scenario for the cucumber test report. The problem I'm encountering is that the agent |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
See OpenTelemetrySdkAccess or use reflection to call it if you don't want to add dependency to opentelemetry-javaagent-bootstrap . If you wish to run the same test without agent use Class.forName to test whether OpenTelemetrySdkAccess or some other agent class is present before calling OpenTelemetrySdkAccess .
|
Beta Was this translation helpful? Give feedback.
-
Thank you. That's what I'm after. |
Beta Was this translation helpful? Give feedback.
See
opentelemetry-java-instrumentation/instrumentation/aws-lambda/aws-lambda-core-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awslambdacore/v1_0/AwsLambdaRequestHandlerInstrumentation.java
Line 85 in 4d202ba
OpenTelemetrySdkAccess
or use reflection to call it if you don't want to add dependency toopentelemetry-javaagent-bootstrap
. If you wish to run the same test without agent useClass.forName
to test whetherOpenTelemetrySdkAccess
or some o…