open-telemetry / opentelemetry-java

OpenTelemetry Java SDK
https://opentelemetry.io
Apache License 2.0
1.89k stars 775 forks source link

Stabilize ExtendedSpanBuilder APIs #6504

Open jack-berg opened 2 weeks ago

jack-berg commented 2 weeks ago

The ExtendedSpanBuilder APIs have been around (in some form) for a while now. They were introduced on 12/7/23 in #6017 and existed in contrib previously. The APIs don't allow you to do anything new, but improve the ergonomics of certain common operations.

In #6497 I left a comment suggesting a change to the APIs I think we should consider prior to stabilization:

The only thing that gives me pause is the SpanCallable, SpanRunnable interfaces. Would be preferable if we didn't introduce our own functional interfaces and could use Callable, Runnable instead. I understand that we loose type safety over the exception type, but could be worthwhile to have an API with types from standard java users are familiar with.

zeitlinger commented 2 weeks ago

SpanCallable

I get the impression people are not particularly happy about the standard interfaces: https://stackoverflow.com/questions/2248131/handling-exceptions-from-java-executorservice-tasks

trask commented 2 weeks ago

I'm probably in favor of keeping SpanCallable and SpanRunnable

I think the convenience API because noticeably less convenient if we switch to Callable and Runnable