-
Notifications
You must be signed in to change notification settings - Fork 911
OTEP: Recording exceptions as log records #4333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I think this is a related issue: |
b06a09f
to
76c7d85
Compare
1a1ea49
to
5ddfd05
Compare
db27087
to
e9f38aa
Compare
A small doubt:
Although (I think) it's not called out, I'm understanding exceptions should now be explicitly reported as both 1) Span.Event and 2) Log/Event? i.e. coding wise you should do this: currentSpan.recordException(e);
logger.logRecordBuilder
.addException(e); Is this the case? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I'm very supportive. Just some nits and one mitigation I'd like to see called out/addressed.
My comment essentially contains this: # Get tracer via SDK only
with tracer.start_as_current_span("foo"):
@lmolkova quoted the last line above and said "yes". Now, try:
raise something
except Exception as e:
span.record_exception(e) |
This comment was marked as outdated.
This comment was marked as outdated.
This surprises me a bit, in particular because logs were stabilized years after tracing and span events were, so I am confused as to how these backends would have existed (or in particular supported reporting of errors, which seems like table stakes for observability) before logs were stable. I must be missing something, but if indeed backends that support OTEL logs but not OTEL traces not for legacy reasons are widely in use you can certainly come at it from the point of view that there was no standard and this proposes one. My experience is that exceptions as span events was more of a de facto standard than exceptions as logs was but that may be biased. I think it would be helpful to have some information on what the backends / SDKs currently do. In particular if SDKs for the most popular languages all behave a certain way out of the box that to me is a de facto standard, even if it is not officially the only way to do it per spec and there may be other SDKs out there that do it differently. I understand that some pain and breakage may be necessary to move the project forward but it's important to understand the cost / benefit weighted in terms of user impact.
This is what I'm getting at with "mitigations are not simple": I imagine this might require configuring the logging SDK where it was previously unused, setting the
As an example of this as far as I know there would be no way currently to do tail sampling in the OTEL Collector on the basis of "keep the entire trace information for any trace that has a log that recorded an exception" whereas it is quite easy and documented to do "keep the entire trace information for any trace that has an exception span event" (as per Tail Sampling Processor |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
not stale, just currently blocked on #4430 |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Related to #4333, #4393, #4429, #4414 --------- Co-authored-by: Liudmila Molkova <[email protected]> Co-authored-by: Robert Pająk <[email protected]> Co-authored-by: jack-berg <[email protected]>
Related to open-telemetry/semantic-conventions#1536
Changes
Recording exceptions as span events is problematic since it
This OTEP provides guidance on how to record exceptions using OpenTelemetry logs focusing on minimizing duplication and providing context to reduce the noise.
If accepted, the follow-up spec changes are expected to replace existing (stable) documents:
Related OTEP(s) #CHANGELOG.md
file updated for non-trivial changesspec-compliance-matrix.md
updated if necessary