DRIVERS-3617 Specify error.type on OpenTelemetry command spans - #1974
Draft
blink1073 wants to merge 7 commits into
Draft
DRIVERS-3617 Specify error.type on OpenTelemetry command spans#1974blink1073 wants to merge 7 commits into
blink1073 wants to merge 7 commits into
Conversation
…error.type absent on operation span
… name on non-server errors
…n failures aren't retried away
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please complete the following before merging:
Summary
The OpenTelemetry command span spec already defines
db.response.status_codebut was missingerror.type, which the technical design lists alongside it.error.typeis a span-level attribute (distinct fromexception.type, carried on the exception event), and tracing backends query and alert on span attributes rather than event attributes — without it, drivers have no shared definition for the dimension backends actually group failures by.Changes
error.typeto the Command Span Attributes table as a required-if-an-error-happens string attribute.error.typeSHOULD matchdb.response.status_codefor server errors, and otherwise SHOULD be the exception class name; MUST NOT be set on success; SHOULD have low cardinality.error.typedeliberately duplicatesexception.typeand why (span- vs event-level querying).error.type, since an operation can succeed overall (e.g. via retry) even when an underlying command failed.error_type.yml/.json) with two cases: a server error, whereerror.typematchesdb.response.status_code; and a non-server error (connection closed before a response), wheredb.response.status_codeis absent anderror.typefalls back to the exception class name. Both cases also assert the operation span has noerror.type.open-telemetry.md.Testing
make -C source(YAML → JSON generation, confirmed no diff after regeneration)pre-commit run --all-files(mdformat, markdown-link-check, codespell, etc.) — cleanmkdocs build --strict— cleanschema-1.27.jsonwithajv-cli— valid