open-telemetry / open-telemetry/opentelemetry-python-contrib
SQLAlchemy instrumentation, always init the db name from the cursor (instead of the connection)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 16
Description
Before opening a feature request against this repo, consider whether the feature should/could be implemented in the other OpenTelemetry client libraries. If so, please open an issue on opentelemetry-specification first.
Is your feature request related to a problem?
In our use case we are changing the db.name dynamically per statement (using mysql schema mapper) and when the schema is defined per connection, its just empty :)
Describe the solution you'd like
in the sqlalchemy instrument package, we would like changing the db.name to be taken directly from the cursor on query basis :)
Describe alternatives you've considered
Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the SQLAlchemy instrumentation package and trace where db.name is initialized for each query. Confirm how the cursor and connection expose the database name, then update the behavior so it uses the cursor on a per-statement basis. Done means dynamically mapped schemas produce the correct db.name; no file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlalchemy
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100