[sdk-trace-base] add debug
-level log with stack trace when modifying neded span
#5113
Labels
good first issue
Good for newcomers
needs:code-contribution
This feature/bug is ready to implement
pkg:sdk-trace-base
type:feature
A feature with no sub-issues to address
up-for-grabs
Good for taking. Extra help will be provided by maintainers
Description
Since the requirement for the OTel API is to not throw when invalid operations are performed, we log a
warning
instead when an operation on an already ended span will have no effect. However, because usually there's no stack trace attached to it, it is difficult to chase down where these invalid operations are happening.The goal of this issue is to add a
debug
-level log right after thewarn
-level log that also provides a stack trace.This issue is considered done when:
debug
-level log has been added that provides a stack tracewarn
-level log message has been amended to mention that changing the level todebug
will provide the stack traceAdditional Requirements
sdk-trace-base
, the chosen approach MUST work for both Node.js and BrowserAdditional Info and Links
opentelemetry-js/packages/opentelemetry-sdk-trace-base/src/Span.ts
Line 367 in eb3ca4f
Span
test file https://github.com/open-telemetry/opentelemetry-js/blob/8900cfdbbab27f464df569a4c8309b96594c276b/packages/opentelemetry-sdk-trace-base/test/common/Span.test.tsThe text was updated successfully, but these errors were encountered: