Force export telemetry before shutting down with Spring Boot autostarter #14108
Replies: 1 comment
-
This does work with the java bytebuddy agent. I will create an issue for this instead. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Is there a way to force export / flush OTLP HTTP telemetry (for example:
io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogRecordExporter
)?I am running a Java Kubernetes job with the
opentelemetry-spring-boot-starter
that starts up and shutdown a couple second later. The metrics and logs of the application are not exported by the OTLP HTTP exporters because the period has not yet elapsedThis could be fixed by adding a sleep at the end of the job that is longer then the export interval + timeout, but that feels like a nasty solution.
I have already looked at the
io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogRecordExporter#flush
function but the exporter is async and the flush doesn't actually force the exporter to flush the in memory telemetry. The shutdown only seems to cancel all running http calls.After some more digging I found that the AWS Lambda sdk does drain the propagators on shutdown: https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/OpenTelemetryInstaller.java
Is there a reason that this is not just implemented for all agents?
Beta Was this translation helpful? Give feedback.
All reactions