opentelemetry-js-api icon indicating copy to clipboard operation
opentelemetry-js-api copied to clipboard

Add a `withSpan` (or similar) convenience API

Open dyladan opened this issue 3 years ago • 9 comments

We can close this issue since the question is addressed and we can create new issues for proposed convenience APIs

Originally posted by @dyladan in https://github.com/open-telemetry/opentelemetry-js-api/issues/164#issuecomment-1176500245

I propose we add an API which takes a callback, automatically creating and ending a span. This has been proposed in the past and blocked for administrative reasons explained in the previously linked ticket, but I think now is the time to address it.

dyladan avatar Jul 06 '22 17:07 dyladan