DB and HTTP semantic convention stability migration for SQLAlchemy#4110
Merged
xrmx merged 38 commits intoopen-telemetry:mainfrom Apr 1, 2026
Merged
DB and HTTP semantic convention stability migration for SQLAlchemy#4110xrmx merged 38 commits intoopen-telemetry:mainfrom
xrmx merged 38 commits intoopen-telemetry:mainfrom
Conversation
6 tasks
herin049
reviewed
Jan 24, 2026
herin049
reviewed
Feb 9, 2026
herin049
approved these changes
Feb 9, 2026
MikeGoldsmith
approved these changes
Feb 25, 2026
Contributor
Author
|
@open-telemetry/python-maintainers May I get a review please? |
11 tasks
xrmx
approved these changes
Apr 1, 2026
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.
Description
Add SQLAlchemy instrumentor support for when
OTEL_SEMCONV_STABILITY_OPT_INincludesThis changes the
SQLComment in span attributefeature if opted in. Inclusion of sqlcomment on query span would be ondb.statementand/ordb.query.textattribute if default, "database", or "database/dup".To make the changes cleaner: adds sqlalchemy helper
_get_db_name_from_cursorto pull directly instead of having a condition to check attributes taken originally from cursor (see this conversation).For reusability by other instrumentors later: this PR adds schema url helpers to
_semconv.pyfor choosing the latest appropriate version when an instrumentor uses multiple signal types (http, db, genai).Adds
_set_db_operationto_semconv.py. This adds SQLAlchemy instrumentor setting ofdb.operationand/ordb.operation.nameattributes -- this was only done for span name before.Fixes #2679
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.