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

Mark database semconv as release candidate #1101

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

trask
Copy link
Member

@trask trask commented May 31, 2024

Fixes #964
Fixes #965

Changes

Mark database semconv as release candidate

Using the notes/briefs to mark attributes/enum values as "release candidate" pending #1096

model/registry/db.yaml Outdated Show resolved Hide resolved
Comment on lines 227 to 241
brief: 'MariaDB (This value has stability level RELEASE CANDIDATE)'
stability: experimental # RELEASE CANDIDATE
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to define db.namespace

Comment on lines 251 to 266
brief: 'MySQL (This value has stability level RELEASE CANDIDATE)'
stability: experimental # RELEASE CANDIDATE
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to define db.namespace

model/registry/db.yaml Outdated Show resolved Hide resolved
Comment on lines 279 to 294
brief: 'PostgreSQL (This value has stability level RELEASE CANDIDATE)'
stability: experimental # RELEASE CANDIDATE
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to define db.namespace

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from https://www.postgresql.org/docs/current/manage-ag-overview.html:

the full hierarchy is: cluster, database, schema, table (or some other kind of object, such as a function).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cluster name

From https://www.postgresql.org/docs/16/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-PROC-TITLE

name that identifies this database cluster (instance) for various purposes. The cluster name appears in the process title for all server processes in this cluster.

I don't believe the cluster name is used when connecting to a database, and so unlikely to be available to instrumentation.

I'd suggest we leave this out for now, can always add it as optional prefix in the future if we find use case and better understanding of it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In postgres, client has searchpath which is one or more "current" schemas

https://www.postgresql.org/docs/current/ddl-schemas.html/l

The first schema named in the search path is called the current schema

db.namespace could be defined as database.currentschema

Example 1

  • db.namespace = mydatabase.myschema
  • db.query.text = select * from mytable
  • db.collection.name = mytable

Example 2

  • db.namespace = mydatabase.myschema
  • db.query.text = select * from myschema.mytable
  • db.collection.name = myschema.mytable

Example 3

  • db.namespace = mydatabase.myschema
  • db.query.text = select * from myschema2.mytable
  • db.collection.name = myschema2.mytable

Example 1 (db namespace doesn't know schema):

  • db.namespace = mydatabase
  • db.query.text = select * from mytable
  • db.collection.name = mytable

Example 2 (db namespace doesn't know schema):

  • db.namespace = mydatabase
  • db.query.text = select * from myschema.mytable
  • db.collection.name = myschema.mytable

Example 3 (db namespace doesn't know schema):

  • db.namespace = mydatabase
  • db.query.text = select * from myschema2.mytable
  • db.collection.name = myschema2.mytable

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/sql.md:

If instrumentation cannot reliably determine the current database name, it SHOULD NOT set db.namespace.

Consider relaxing this to "best effort".

If a database system has multiple namespace components

Consider mentioning schema as an example component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
1 participant