Skip to content
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

Add section on span status for databases #1560

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lmolkova
Copy link
Contributor

@lmolkova lmolkova commented Nov 8, 2024

Addresses the DB part of #1536.

Let's polish it for databases and then expand to other conventions (and potentially have a generic guidance).

The intention is to keep exception event part experimental since

  • there doesn't seem to be a consensus or a common approach for it
  • span events is going away

Merge requirement checklist

@lmolkova lmolkova requested review from a team as code owners November 8, 2024 02:58
docs/database/database-spans.md Outdated Show resolved Hide resolved
docs/database/database-spans.md Outdated Show resolved Hide resolved
docs/database/database-spans.md Outdated Show resolved Hide resolved
docs/database/database-spans.md Outdated Show resolved Hide resolved
docs/database/database-spans.md Outdated Show resolved Hide resolved
docs/database/database-spans.md Outdated Show resolved Hide resolved
docs/database/database-spans.md Outdated Show resolved Hide resolved
docs/database/database-spans.md Outdated Show resolved Hide resolved
docs/database/database-spans.md Outdated Show resolved Hide resolved
docs/database/database-spans.md Outdated Show resolved Hide resolved
docs/database/database-spans.md Outdated Show resolved Hide resolved
docs/database/database-spans.md Outdated Show resolved Hide resolved
docs/database/database-spans.md Outdated Show resolved Hide resolved
Comment on lines +129 to +138
When the operation fails with an exception, instrumentation SHOULD record
an [exception event](../exceptions/exceptions-spans.md) by default if and only if the
span being recorded is a local root span (does not have a local parent).

> [!NOTE]
> Exception stack traces could be very long and are expensive to capture and store.
> Exceptions which are not handled by instrumented libraries are likely to be handled
> and logged by the caller.
> Exceptions that are not handled will be recorded by the outermost (local root)
> instrumentation such as HTTP or gRPC server.
Copy link
Member

Choose a reason for hiding this comment

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

let's ask for feedback on this point from the Specification SIG before we merge

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a directional shift in logging exceptions.

I see two things here:

  1. We still can't determine "layers" of instrumentation, i.e. we can't know if someone else will log the exception or not.
  2. This violates the previously recorded wisdom of how to handle exceptions and stack traces.

My opinion:

This is the right direction to go. We should assume that there is "outer" instrumentation that logs/catches exceptions, particularly for database "client" spans. I.e. we may be able to blanketly state that "client" spans should never log unhandled exceptions and that we encourage "outer" instrumentation that will (e.g. server spans).

Copy link
Member

Choose a reason for hiding this comment

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

I added to next week's spec SIG agenda


- SHOULD set the span status code to `Error`
- SHOULD set the `error.type` attribute
- SHOULD set the span status description when it has additional information
Copy link
Contributor

Choose a reason for hiding this comment

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

should this have any requirements about not having any confidential data? Similar to how we have on metrics errors where we don't add if it shows actual values of queries, etc

span being recorded is a local root span (does not have a local parent).

> [!NOTE]
> Exception stack traces could be very long and are expensive to capture and store.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> Exception stack traces could be very long and are expensive to capture and store.
>
> Exception stack traces could be very long and are expensive to capture and store.

I think you need an empty line here so the icon shows up.

**Status**: [Experimental][DocumentStatus]

When the operation fails with an exception, instrumentation SHOULD record
an [exception event](../exceptions/exceptions-spans.md) by default if and only if the
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
an [exception event](../exceptions/exceptions-spans.md) by default if and only if the
an [exception event](../exceptions/exceptions-spans.md) by default if, and only if, the

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Needs More Approval
Development

Successfully merging this pull request may close these issues.

6 participants