You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is to add a apm.withSpan(options, fn) API (and similar for withTransaction) that critically takes a function to which the new RunContext is bound. This would avoid the #2611 footgun that startSpan and startTransaction apply. A possible result of that footgun is shown and discussed at #2929.
This apm.withSpan() would be the equivalent of OTel JS's tracer.startActiveSpan(). The OTel tracer.startSpan() is already roughly equivalent to our internalcreateSpan() -- which was added in the RunContext work to cope with the apm.startSpan() footgun.
Eventually I think these APIs should be preferred and startSpan() and startTransaction() APIs should be deprecated.
The text was updated successfully, but these errors were encountered:
This issue is to add a
apm.withSpan(options, fn)
API (and similar forwithTransaction
) that critically takes a function to which the new RunContext is bound. This would avoid the #2611 footgun thatstartSpan
andstartTransaction
apply. A possible result of that footgun is shown and discussed at #2929.Adding this API has been considered since the RunContext work.
A good test of this functionality would be whether it could fully or significantly replace the
withApmSpan
helper in Kibana (see https://github.com/elastic/kibana/blob/main/x-pack/plugins/apm/server/utils/with_apm_span.ts and https://github.com/elastic/kibana/blob/main/packages/kbn-apm-utils/index.ts).This
apm.withSpan()
would be the equivalent of OTel JS'stracer.startActiveSpan()
. The OTeltracer.startSpan()
is already roughly equivalent to our internalcreateSpan()
-- which was added in the RunContext work to cope with theapm.startSpan()
footgun.Eventually I think these APIs should be preferred and
startSpan()
andstartTransaction()
APIs should be deprecated.The text was updated successfully, but these errors were encountered: