Skip to content

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

Closed
wants to merge 35 commits into from

Conversation

lmolkova
Copy link
Contributor

@lmolkova lmolkova commented Dec 10, 2024

Related to open-telemetry/semantic-conventions#1536

Changes

Recording exceptions as span events is problematic since it

  • ties recording exceptions to tracing/sampling
  • duplicates exceptions recorded by instrumented libraries on logs
  • does not leverage log features such as typical log filtering based on severity

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:


@lmolkova lmolkova changed the title OTEP: Recording exceptions and errors with OpenTelemetry OTEP: Recording exceptions as log based events Dec 10, 2024
@pellared
Copy link
Member

pellared commented Dec 10, 2024

I think this is a related issue:

@tedsuo tedsuo added the OTEP OpenTelemetry Enhancement Proposal (OTEP) label Dec 12, 2024
@lmolkova lmolkova force-pushed the exceptions-on-logs-otep branch 2 times, most recently from b06a09f to 76c7d85 Compare December 17, 2024 17:30
@lmolkova lmolkova force-pushed the exceptions-on-logs-otep branch from db27087 to e9f38aa Compare January 3, 2025 01:42
@carlosalberto
Copy link
Contributor

A small doubt:

If this instrumentation supports tracing, it should capture the error in the scope of the processing span.

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?

Copy link
Contributor

@jsuereth jsuereth left a 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.

@lmolkova lmolkova removed the Stale label Apr 24, 2025
lmolkova added a commit that referenced this pull request Apr 25, 2025
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]>
Copy link

github-actions bot commented May 2, 2025

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 2, 2025
@carlosalberto
Copy link
Contributor

Is this ready to be re-discussed?

@trask
Copy link
Member

trask commented May 6, 2025

Is this ready to be re-discussed?

@lmolkova and I are focused on #4485 for now, we are planning to come back to this afterwards

@lmolkova lmolkova removed the Stale label May 6, 2025
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 13, 2025
Copy link

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this May 20, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in Logs SIG May 20, 2025
@lmolkova lmolkova reopened this May 20, 2025
@lmolkova lmolkova moved this from Done to In progress in Logs SIG May 20, 2025
@lmolkova lmolkova removed the Stale label May 20, 2025
@lmolkova lmolkova marked this pull request as draft May 20, 2025 15:24
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 28, 2025
@lmolkova lmolkova removed the Stale label May 30, 2025
Copy link

github-actions bot commented Jun 7, 2025

This PR was marked stale due to lack of activity. It will be closed in 7 days.

Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jun 20, 2025
Copy link

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Jun 27, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in Logs SIG Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog.opentelemetry.io OTEP OpenTelemetry Enhancement Proposal (OTEP) Stale
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.