본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Database semantic convention stability migration guide

원문 보기 위키 갱신

Due to the significant number of modifications and the extensive user base

출처: 문서

본문

Due to the significant number of modifications and the extensive user base affected by them, existing database instrumentations published by OpenTelemetry are required to implement a migration plan that will assist users in transitioning to the stable database semantic conventions.

Specifically, when existing database instrumentations published by OpenTelemetry are updated to the stable database semantic conventions, they:

  • SHOULD NOT change the version of the database conventions that they emit by default in their existing major version. Conventions include (but are not limited to) attributes, metric and span names, and unit of measure.

  • SHOULD introduce an environment variable OTEL_SEMCONV_STABILITY_OPT_IN in their existing major version, which accepts:

  • database - emit the stable database conventions, and stop emitting the old database conventions that the instrumentation emitted previously.

  • database/dup - emit both the old and the stable database conventions, allowing for a phased rollout of the stable semantic conventions.

  • The default behavior (in the absence of one of these values) is to continue emitting whatever version of the old database conventions the instrumentation was emitting previously.

  • Need to maintain (security patching at a minimum) their existing major version for at least six months after it starts emitting both sets of conventions.

  • May drop the environment variable in their next major version and emit only the stable database conventions.

Note

OTEL_SEMCONV_STABILITY_OPT_IN is only intended to be used when migrating from an experimental semantic convention to its initial stable version.

Summary of changes

This section summarizes the changes made to the HTTP semantic conventions from v1.24.0. to v1.33.0.

Database client span attributes

| | Change | Comments

| db.connection_string | Removed

| db.user | Removed

| network.transport | Removed

| network.type | Removed

| db.name | Removed, integrated into the new db.namespace. Clarified, it is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization

| db.redis.database_index | Removed, integrated into the new db.namespace

| db.mssql.instance_name | Removed, integrated into the new db.namespace

| db.instance.id | Removed, replaced by server.address or integrated into db.namespace as appropriate

| db.system → db.system.name |

| db.statement → db.query.text | Clarified, SHOULD be collected by default only if there is sanitization that excludes sensitive information

| db.operation → db.operation.name | Clarified, it is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization

| db.sql.table → db.collection.name | Should not be captured if extracting the value from db.query.text since there could be multiple. Clarified, it is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization

| db.cassandra.table → db.collection.name | Clarified, it is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization

| db.mongodb.collection → db.collection.name | Clarified, it is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization

| db.cosmosdb.container → db.collection.name | Clarified, it is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization

| New: db.query.summary |

| New: db.operation.batch.size |

| New: db.response.status_code |

| New: db.stored_procedure.name |

| New: error.type |

| New: db.operation.parameter.<key> | Not marked stable yet

| New: db.query.parameter.<key> | Not marked stable yet

| New: db.response.returned_rows | Not marked stable yet

References:

  • Database client span attributes v1.24.0
  • Database client span attributes v1.33.0

Database client span names

The recommended span name has changed. See Database client span names v1.33.0 for details on the new span name recommendation.

References:

  • Database client span names v1.24.0
  • Database client span names v1.33.0

Database system name

The attribute db.system has been renamed to db.system.name. Along with the rename, many enum values were updated — most notably to follow a <vendor>.<product> naming pattern that makes vendor affiliation explicit.

The table below lists only the db.system values that were renamed or removed in db.system.name, along with the stability of the new value. Unchanged values are not listed.

Note

The db.system.name attribute itself is stable. Individual enum members have their own stability level as shown below (stable or development).

| | Description | Old db.system value | New db.system.name value

| Adabas (Adaptable Database System) | adabas | softwareag.adabas

| InterSystems Caché (old alias) | cache | Removed

| InterSystems Caché | intersystems_cache | intersystems.cache

| Cloudscape | cloudscape | Removed

| ColdFusion | coldfusion | Removed

| Azure Cosmos DB | cosmosdb | azure.cosmosdb

| IBM Db2 | db2 | ibm.db2

| Amazon DynamoDB | dynamodb | aws.dynamodb

| EnterpriseDB | edb | Removed

| FileMaker | filemaker | Removed

| Firebird | firebird | firebirdsql

| FirstSQL | firstsql | Removed

| H2 Database | h2 | h2database

| SAP HANA | hanadb | sap.hana

| IBM Informix | informix | ibm.informix

| Actian Ingres | ingres | actian.ingres

| InterBase | interbase | Removed

| SAP MaxDB | maxdb | sap.maxdb

| Microsoft SQL Server | mssql | microsoft.sql_server

| Microsoft SQL Server Compact | mssqlcompact | Removed

| IBM Netezza | netezza | ibm.netezza

| Oracle Database | oracle | oracle.db

| Pervasive PSQL | pervasive | Removed

| PointBase | pointbase | Removed

| Progress Database | progress | Removed

| Amazon Redshift | redshift | aws.redshift

| Google Cloud Spanner | spanner | gcp.spanner

| Sybase | sybase | Removed

| Vertica | vertica | Removed

References:

  • db.system enum values v1.24.0
  • db.system.name enum values v1.33.0

Database client operation duration metric

This is a required metric. There was no similar metric previously.

See Metric db.client.operation.duration v1.33.0.

Experimental connection metrics

Database connection metrics are not stable yet, but there have been several changes in the latest release.

Database client connection count

Metric changes:

  • Name: db.client.connections.usage → db.client.connection.count
  • Attributes: see table below | | Attribute change | Comments

| pool.name → db.client.connection.pool.name |

| state → db.client.connection.state |

References:

  • Metric db.client.connections.usage v1.24.0
  • Metric db.client.connection.count v1.33.0

Database client connection idle max

Metric changes:

  • Name: db.client.connections.idle.max → db.client.connection.idle.max
  • Attributes: see table below | | Attribute change | Comments

| pool.name → db.client.connection.pool.name |

References:

  • Metric db.client.connections.idle.max v1.24.0
  • Metric db.client.connection.idle.max v1.33.0

Database client connection idle min

Metric changes:

  • Name: db.client.connections.idle.min → db.client.connection.idle.min
  • Attributes: see table below | | Attribute change | Comments

| pool.name → db.client.connection.pool.name |

References:

  • Metric db.client.connections.idle.min v1.24.0
  • Metric db.client.connection.idle.min v1.33.0

Database client connection max

Metric changes:

  • Name: db.client.connections.max → db.client.connection.max
  • Attributes: see table below | | Attribute change | Comments

| pool.name → db.client.connection.pool.name |

References:

  • Metric db.client.connections.max v1.24.0
  • Metric db.client.connection.max v1.33.0

Database client connection pending requests

Metric changes:

  • Name: db.client.connections.pending_requests → db.client.connection.pending_requests
  • Attributes: see table below | | Attribute change | Comments

| pool.name → db.client.connection.pool.name |

References:

  • Metric db.client.connections.pending_requests v1.24.0
  • Metric db.client.connection.pending_requests v1.33.0

Database client connection timeouts

Metric changes:

  • Name: db.client.connections.timeouts → db.client.connection.timeouts
  • Attributes: see table below | | Attribute change | Comments

| pool.name → db.client.connection.pool.name |

References:

  • Metric db.client.connections.timeouts v1.24.0
  • Metric db.client.connection.timeouts v1.33.0

Database client connection create time

Metric changes:

  • Name: db.client.connections.create_time → db.client.connection.create_time
  • Unit: ms → s
  • Attributes: see table below | | Attribute change | Comments

| pool.name → db.client.connection.pool.name |

References:

  • Metric db.client.connections.create_time v1.24.0
  • Metric db.client.connection.create_time v1.33.0

Database client connection wait time

Metric changes:

  • Name: db.client.connections.wait_time → db.client.connection.wait_time
  • Unit: ms → s
  • Attributes: see table below | | Attribute change | Comments

| pool.name → db.client.connection.pool.name |

References:

  • Metric db.client.connections.wait_time v1.24.0
  • Metric db.client.connection.wait_time v1.33.0

Database client connection use time

Metric changes:

  • Name: db.client.connections.use_time → db.client.connection.use_time
  • Unit: ms → s
  • Attributes: see table below | | Attribute change | Comments

| pool.name → db.client.connection.pool.name |

References:

  • Metric db.client.connections.use_time v1.24.0
  • Metric db.client.connection.use_time v1.33.0