Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db.name should be broken down into individual layers #714

Closed
damiangarbacz opened this issue Oct 14, 2022 · 3 comments
Closed

db.name should be broken down into individual layers #714

damiangarbacz opened this issue Oct 14, 2022 · 3 comments
Assignees

Comments

@damiangarbacz
Copy link

What are you trying to achieve?
Semantic convention for db client calls (database.md) states that for db.name "the database name to be used is the more specific layer". This may cause problems because as a user I don't know beforehand what the tag actually describes. For one db engine the tag may describe the "schema name" and for another a "database name".

This approach also makes it difficult to distinguish e.g. between two schemas with the same schema name running under two different instances.

I believe that db.name should behave consistently regardless of the database engine used (always store "database name"). Moreover it might be helpful to add more tags to describe database-specific layers (like db.schema_name or something similar).

Additional context.
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/database.md

@carlosalberto
Copy link
Contributor

We need experts here, as well as examples to document actual, specific cases (e.g. different databases). Please consider raising in the semantic convention group with @jsuereth (albeit this is a trace semantic convention).

@trask
Copy link
Member

trask commented Feb 8, 2024

The reasoning behind db.name being the "more specific layer" is so that you can use it to contextualize db.sql.table in a backend UI. This is similar in spirit to #521 which is about shoe-horning different database-specific names into a single attribute which represents the same thing conceptually.

The alternative is to go with more db-specific attributes which use database-specific terminology, e.g. db.oracle.schema_name and db.oracle.instance_name. This can add more clarity for people already familiar with these databases, but it can add more complexity to backends trying to visualize the data across all databases.

@trask
Copy link
Member

trask commented Apr 24, 2024

I believe we can close this after merging #911, as it clarifies the naming and purpose around this attribute (db.namespace instead of db.name).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

5 participants