Skip to content

Conversation

@lmolkova
Copy link
Member

@lmolkova lmolkova commented Dec 28, 2024

Fixes #1536, #1516

  • Document HTTP + DB approach for span status + description as generic for spans
  • Document error.type as generic error attribute on spans and metrics
  • Specify how to classify db.response.status_codes as failures
  • Update recommendation to record exceptions as a span events or log records

Important

We can and should implement strategy of reporting exceptions on local root spans in OTel SDK - it should not be an instrumentation concern.

Here's an OTEP on how to record exceptions on logs - it discusses the details of configurable exception recording strategy.
Since public facing log API is in development, we'll keep using span events for the time being.

Merge requirement checklist

@lmolkova lmolkova requested review from a team as code owners December 28, 2024 18:27
@lmolkova lmolkova requested a review from Copilot December 28, 2024 18:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 20 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • docs/database/redis.md: Evaluated as low risk
  • docs/database/cassandra.md: Evaluated as low risk
  • docs/database/cosmosdb.md: Evaluated as low risk
  • docs/rpc/rpc-spans.md: Evaluated as low risk
  • docs/messaging/messaging-spans.md: Evaluated as low risk
  • docs/cli/cli-spans.md: Evaluated as low risk
  • docs/http/http-spans.md: Evaluated as low risk
  • docs/general/recording-errors.md: Evaluated as low risk
  • docs/gen-ai/gen-ai-spans.md: Evaluated as low risk
  • docs/faas/faas-spans.md: Evaluated as low risk
  • docs/exceptions/README.md: Evaluated as low risk
  • docs/database/elasticsearch.md: Evaluated as low risk
  • docs/database/database-spans.md: Evaluated as low risk
  • docs/database/mongodb.md: Evaluated as low risk
  • docs/database/couchdb.md: Evaluated as low risk

@lmolkova lmolkova force-pushed the generic-recording-errors branch 2 times, most recently from 4c1fdc3 to 456f377 Compare January 9, 2025 01:40
@lmolkova lmolkova force-pushed the generic-recording-errors branch from 4558c9c to 4ddc1d1 Compare January 10, 2025 16:31
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.

This looks good to me, but we may want to give some vendors extra time to adjust to the new span status guidance.

@lmolkova
Copy link
Member Author

lmolkova commented Jan 11, 2025

@jsuereth I'm fine keeping it open, I don't think it's necessary though:

The only change from what we recommend today is to stop recording handled exceptions and stop reporting exception.escaped attribute. AFAIK OTel instrumentations in general don't report handled exceptions anyway.

The exception.escaped attribute has even lower risk:

  • Java does not use it in core repo, does not set it in -instrumentation or -contrib
  • .NET does not use it, not used in the contrib either
  • JS does not use it, also not used in the js-contrib
  • Python sets this attribute, but incorrectly (always to string "False" and there is nothing that ever calls this method in contrib providing this flag)
  • Go does not set it for obvious reasons
  • I don't see any mention beyond definition in C++ (core or contrib) or in Rust.

So I think the guidance just catches up with existing practice and vendors don't need to change anything. I'll announce it at the Maintainers call on Mon 1/13 and Spec call on 1/14 to make sure everyone is aware.

Unless there is some pushback, I'm going to merge it on ~1/15.

@lmolkova lmolkova force-pushed the generic-recording-errors branch from 1c00b5a to 1f37350 Compare January 16, 2025 01:15
Liudmila Molkova added 2 commits January 15, 2025 17:25
@lmolkova lmolkova merged commit 539ce85 into open-telemetry:main Jan 16, 2025
14 checks passed
lmolkova pushed a commit to lmolkova/semantic-conventions that referenced this pull request Jan 21, 2025
… DB conventions (open-telemetry#1716)

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Document generic approach for span status (code + description) and exception event when instrumented code throws

5 participants