honeycombio / honeycomb-opentelemetry-java

Honeycomb's OpenTelemetry Java SDK distribution
20 stars 10 forks source link

feat: return an OpenTelemetrySdk from the builder #451

Closed NLincoln closed 5 months ago

NLincoln commented 6 months ago

A nice-to-have that I've wanted from working with this SDK on personal projects.

Otel, for very very good reason, periodically batches telemetry before sending it upstream. When I'm writing short-lived command line apps, I need to .shutdown() the otel sdk before exiting the process.

But shutdown is only a method on the OpenTelemetrySdk, not OpenTelemetry, so I have to (gasp) cast it to the right type because I looked at the source code and could see that we return one of those.

I don't know enough Java to know if this is a big no-no, but as a user this would be appreciated ❤️