-
Notifications
You must be signed in to change notification settings - Fork 179
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
Database semantic conventions may violate namespacing guidelines #713
Comments
I think this is a problem that might stay theoretical. So I am in favor of solution 2. We could also suggest a common transformation for such cases. Appending |
@open-telemetry/specs-approvers any thoughts on this? |
I'd also be in favor of # 2, but I'd prefer any standard to the current undefined way to handle such a collision. I mostly agree with # 2 because it's less arduous to implement. I do like the explicitness of the "db.special" namespacing, but the pragmatist in me feels it would be too much disruption to solve an admittedly unlikely problem to occur. If we do # 2, I propose we explicitly reserve the "*db" suffix for the sake of formality. |
OK, I think we are all in agreement so far that |
Any clarifications should also apply to messaging and RPC semantic conventions, where the same logic is used. |
discussed in database semconv meeting:
|
@trask Ideally we should automate the enforcement of the general rule "names cant coincide with namespace" and be done with it. |
So you're suggesting just adding a build check to this repo to assert this? |
Yes. |
We discussed this in the messaging workgroup and we are in line with this conclusion. |
Related: #1068 |
Problem Description
We have database conventions like this:
db.name
,db.statement
, etc. Here thedb
is the namespace and we have attributes that are common for all database under this namespace. We have a large number of these.We also have conventions like this:
db.mssql.instance_name
wheredb.mssql
is the namespace. The implied idea is that database specific attributes are placed indb.<database-name>
namespace, although it is not explicitly called out anywhere.This is a problem. The enumeration is not bounded and can contain any value in the future. In the future we may need to add database-specific conventions support for a database that has a name that matches any of the numerous attributes under the
db
namespace.However, it will be impossible because it will be a violation of namespacing guidelines, which say:
We have a situation when future evolution of semantic conventions may be impossible because of the current design.
Possible Solutions
I list a couple solutions below. If you can think of another way please comment so that we can discuss that too.
Solution 1
Move all database specific conventions to a properly isolated namespace, e.g. instead of using
db.<database-name>
as the namespace usedb.special.<database-name>
as the namespace or some other namespace that is guaranteed not to clash with any other attributes in other namespaces.The downside is that we need to change existing conventions and also that database-specific conventions will use somewhat longer attribute names (
db.special.cassandra.page_size
is longer and less readable thandb.cassandra.page_size
that we use currently).Solution 2
Explicitly call out that certain database names are disallowed. This list will contain everything that is already an attribute under
db
namespace. We can probably also reserve some names for use either as attributes underdb
namespace (and thus disallow them as database names) or as database names (and thus disallow them as attribute names).Any future database that has a name that clashes with existing attribute under
db
namespace will need to have its name transformed such that it no longer conflicts with an attribute name.For example if a hypothetical future database called "system" needs to have some specific attributes in the conventions then we can place such attribute under
db.systemdb
namespace to make sure it does not conflict withdb.system
generic attribute.The benefit of this solution is that we don't need to change existing conventions.
The text was updated successfully, but these errors were encountered: