open-telemetry / open-telemetry/opentelemetry-python-contrib

SQLAlchemy instrumentation, always init the db name from the cursor (instead of the connection)

Open
#2,017 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.