Emit DB exceptions as logs under the opt-in preview#18889
Merged
Conversation
142d6c7 to
2470400
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a small incubating helper in the instrumentation API incubator to standardize configuration of database client exception log events, using the semantic convention event name db.client.operation.exception with WARN severity. This fits alongside existing incubator utilities that help instrumentations align with semantic conventions and emerging exception-as-log behavior introduced in follow-up work to #16259.
Changes:
- Introduces
DbExceptionEventExtractorsutility with a helper method to configure anInstrumenterBuilder’s exception event name and severity for DB client exception logs.
2470400 to
82852bc
Compare
82852bc to
fcbda86
Compare
eb44364 to
34607e8
Compare
3d7022d to
af3af48
Compare
trask
commented
Jun 5, 2026
d8fdfa6 to
b88d2e5
Compare
9b3e3ee to
b88d2e5
Compare
The JDBC exception signal log test used waitAndAssertLogRecords(), which expects the captured log list to contain only the asserted records. In these test runs, unrelated JDBC driver or pool logs can be captured first, and the logged exception class/message can be normalized differently from the thrown SQLException subtype. Restore filtering to the db.client.operation.exception log record and assert that the exception attributes are present instead of matching the exact thrown exception values. Validation: .\gradlew.bat :instrumentation:jdbc:library:testExceptionSignalLogs :instrumentation:jdbc:javaagent:testExceptionSignalLogs --no-build-cache
b88d2e5 to
9d22c5d
Compare
laurit
approved these changes
Jun 9, 2026
Contributor
|
aws dynamodb instrumentation also implements db semconv, but it doesn't use the |
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.
Under
otel.semconv.exception.signal.preview=logs(introduced in #16259), database client instrumentations now emit their exceptions as log records instead of span events.Part of follow-up work after #16259.