View Source OpenTelemetry.SemConv.Incubating.DBAttributes (OpenTelemetry.SemConv v1.27.0)

OpenTelemetry Semantic Conventions for DB attributes.

Summary

Types

The consistency level of the query. Based on consistency values from CQL.

The state of a connection in the pool

Deprecated, use db.client.connection.state instead.

Cosmos client connection mode.

CosmosDB Operation Type.

The database management system (DBMS) product as identified by the client instrumentation.

Deprecated, use db.client.connection.state instead.

Functions

The consistency level of the query. Based on consistency values from CQL.

The data center of the coordinating node for a query.

The ID of the coordinating node for a query.

Whether or not the query is idempotent.

The fetch size used for paging, i.e. how many rows will be returned at once.

The number of times a query was speculatively executed. Not set or 0 if the query was not executed speculatively.

The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes server.address, server.port, and db.namespace, formatted as server.address:server.port/db.namespace. Instrumentations that generate connection pool name following different patterns SHOULD document it.

The state of a connection in the pool

The name of a collection (table, container) within the database.

Unique Cosmos client instance id.

Cosmos client connection mode.

CosmosDB Operation Type.

RU consumed for that operation

Request payload size in bytes

Cosmos DB status code.

Cosmos DB sub status code.

Represents the human-readable identifier of the node/instance to which a request was routed.

A dynamic value in the url path.

db_instance_id() deprecated
db_name() deprecated

The name of the database, fully qualified within the server address and port.

db_operation() deprecated

The number of queries included in a batch operation.

The name of the operation or command being executed.

A query parameter used in db.query.text, with <key> being the parameter name, and the attribute value being a string representation of the parameter value.

The database query being executed.

db_sql_table() deprecated
db_statement() deprecated

The database management system (DBMS) product as identified by the client instrumentation.

db_user() deprecated
pool_name() deprecated
state() deprecated

Types

Link to this type

db_cassandra_consistency_level_values()

View Source
@type db_cassandra_consistency_level_values() :: %{
  all: :all,
  each_quorum: :each_quorum,
  quorum: :quorum,
  local_quorum: :local_quorum,
  one: :one,
  two: :two,
  three: :three,
  local_one: :local_one,
  any: :any,
  serial: :serial,
  local_serial: :local_serial
}

The consistency level of the query. Based on consistency values from CQL.

Enum Values

  • :all e
  • :each_quorum e
  • :quorum e
  • :local_quorum e
  • :one e
  • :two e
  • :three e
  • :local_one e
  • :any e
  • :serial e
  • :local_serial e
Link to this type

db_client_connection_state_values()

View Source
@type db_client_connection_state_values() :: %{idle: :idle, used: :used}

The state of a connection in the pool

Enum Values

  • :idle e
  • :used e
Link to this type

db_client_connections_state_values()

View Source
@type db_client_connections_state_values() :: %{idle: :idle, used: :used}

Deprecated, use db.client.connection.state instead.

Enum Values

  • :idle e
  • :used e
Link to this type

db_cosmosdb_connection_mode_values()

View Source
@type db_cosmosdb_connection_mode_values() :: %{gateway: :gateway, direct: :direct}

Cosmos client connection mode.

Enum Values

  • :gateway e - Gateway (HTTP) connections mode
  • :direct e - Direct connection.
Link to this type

db_cosmosdb_operation_type_values()

View Source
@type db_cosmosdb_operation_type_values() :: %{
  invalid: :Invalid,
  create: :Create,
  patch: :Patch,
  read: :Read,
  read_feed: :ReadFeed,
  delete: :Delete,
  replace: :Replace,
  execute: :Execute,
  query: :Query,
  head: :Head,
  head_feed: :HeadFeed,
  upsert: :Upsert,
  batch: :Batch,
  query_plan: :QueryPlan,
  execute_javascript: :ExecuteJavaScript
}

CosmosDB Operation Type.

Enum Values

  • :invalid e
  • :create e
  • :patch e
  • :read e
  • :read_feed e
  • :delete e
  • :replace e
  • :execute e
  • :query e
  • :head e
  • :head_feed e
  • :upsert e
  • :batch e
  • :query_plan e
  • :execute_javascript e
@type db_system_values() :: %{
  other_sql: :other_sql,
  adabas: :adabas,
  cache: :cache,
  intersystems_cache: :intersystems_cache,
  cassandra: :cassandra,
  clickhouse: :clickhouse,
  cloudscape: :cloudscape,
  cockroachdb: :cockroachdb,
  coldfusion: :coldfusion,
  cosmosdb: :cosmosdb,
  couchbase: :couchbase,
  couchdb: :couchdb,
  db2: :db2,
  derby: :derby,
  dynamodb: :dynamodb,
  edb: :edb,
  elasticsearch: :elasticsearch,
  filemaker: :filemaker,
  firebird: :firebird,
  firstsql: :firstsql,
  geode: :geode,
  h2: :h2,
  hanadb: :hanadb,
  hbase: :hbase,
  hive: :hive,
  hsqldb: :hsqldb,
  influxdb: :influxdb,
  informix: :informix,
  ingres: :ingres,
  instantdb: :instantdb,
  interbase: :interbase,
  mariadb: :mariadb,
  maxdb: :maxdb,
  memcached: :memcached,
  mongodb: :mongodb,
  mssql: :mssql,
  mssqlcompact: :mssqlcompact,
  mysql: :mysql,
  neo4j: :neo4j,
  netezza: :netezza,
  opensearch: :opensearch,
  oracle: :oracle,
  pervasive: :pervasive,
  pointbase: :pointbase,
  postgresql: :postgresql,
  progress: :progress,
  redis: :redis,
  redshift: :redshift,
  spanner: :spanner,
  sqlite: :sqlite,
  sybase: :sybase,
  teradata: :teradata,
  trino: :trino,
  vertica: :vertica
}

The database management system (DBMS) product as identified by the client instrumentation.

Enum Values

  • :other_sql e - Some other SQL database. Fallback only. See notes.
  • :adabas e - Adabas (Adaptable Database System)
  • :cache e - deprecated Deprecated, use intersystems_cache instead.
  • :intersystems_cache e - InterSystems Caché
  • :cassandra e - Apache Cassandra
  • :clickhouse e - ClickHouse
  • :cloudscape e - deprecated Deprecated, use other_sql instead.
  • :cockroachdb e - CockroachDB
  • :coldfusion e - deprecated Deprecated, no replacement at this time.
  • :cosmosdb e - Microsoft Azure Cosmos DB
  • :couchbase e - Couchbase
  • :couchdb e - CouchDB
  • :db2 e - IBM Db2
  • :derby e - Apache Derby
  • :dynamodb e - Amazon DynamoDB
  • :edb e - EnterpriseDB
  • :elasticsearch e - Elasticsearch
  • :filemaker e - FileMaker
  • :firebird e - Firebird
  • :firstsql e - deprecated Deprecated, use other_sql instead.
  • :geode e - Apache Geode
  • :h2 e - H2
  • :hanadb e - SAP HANA
  • :hbase e - Apache HBase
  • :hive e - Apache Hive
  • :hsqldb e - HyperSQL DataBase
  • :influxdb e - InfluxDB
  • :informix e - Informix
  • :ingres e - Ingres
  • :instantdb e - InstantDB
  • :interbase e - InterBase
  • :mariadb e - MariaDB
  • :maxdb e - SAP MaxDB
  • :memcached e - Memcached
  • :mongodb e - MongoDB
  • :mssql e - Microsoft SQL Server
  • :mssqlcompact e - deprecated Deprecated, Microsoft SQL Server Compact is discontinued.
  • :mysql e - MySQL
  • :neo4j e - Neo4j
  • :netezza e - Netezza
  • :opensearch e - OpenSearch
  • :oracle e - Oracle Database
  • :pervasive e - Pervasive PSQL
  • :pointbase e - PointBase
  • :postgresql e - PostgreSQL
  • :progress e - Progress Database
  • :redis e - Redis
  • :redshift e - Amazon Redshift
  • :spanner e - Cloud Spanner
  • :sqlite e - SQLite
  • :sybase e - Sybase
  • :teradata e - Teradata
  • :trino e - Trino
  • :vertica e - Vertica
@type state_values() :: %{idle: :idle, used: :used}

Deprecated, use db.client.connection.state instead.

Enum Values

  • :idle e
  • :used e

Functions

Link to this function

db_cassandra_consistency_level()

View Source
@spec db_cassandra_consistency_level() :: :"db.cassandra.consistency_level"

The consistency level of the query. Based on consistency values from CQL.

iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cassandra_consistency_level()
:"db.cassandra.consistency_level"

iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cassandra_consistency_level_values().all
:all

iex> %{OpenTelemetry.SemConv.Incubating.DBAttributes.db_cassandra_consistency_level() => OpenTelemetry.SemConv.Incubating.DBAttributes.db_cassandra_consistency_level_values().all}
%{:"db.cassandra.consistency_level" => :all}
Link to this function

db_cassandra_consistency_level_values()

View Source
@spec db_cassandra_consistency_level_values() ::
  db_cassandra_consistency_level_values()
Link to this function

db_cassandra_coordinator_dc()

View Source
@spec db_cassandra_coordinator_dc() :: :"db.cassandra.coordinator.dc"

The data center of the coordinating node for a query.

Value type

Value must be of type atom() | String.t().

Examples

us-west-2
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cassandra_coordinator_dc()
:"db.cassandra.coordinator.dc"
Link to this function

db_cassandra_coordinator_id()

View Source
@spec db_cassandra_coordinator_id() :: :"db.cassandra.coordinator.id"

The ID of the coordinating node for a query.

Value type

Value must be of type atom() | String.t().

Examples

be13faa2-8574-4d71-926d-27f16cf8a7af
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cassandra_coordinator_id()
:"db.cassandra.coordinator.id"
Link to this function

db_cassandra_idempotence()

View Source
@spec db_cassandra_idempotence() :: :"db.cassandra.idempotence"

Whether or not the query is idempotent.

Value type

Value must be of type boolean().

iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cassandra_idempotence()
:"db.cassandra.idempotence"
Link to this function

db_cassandra_page_size()

View Source
@spec db_cassandra_page_size() :: :"db.cassandra.page_size"

The fetch size used for paging, i.e. how many rows will be returned at once.

Value type

Value must be of type integer().

Examples

[5000]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cassandra_page_size()
:"db.cassandra.page_size"
Link to this function

db_cassandra_speculative_execution_count()

View Source
@spec db_cassandra_speculative_execution_count() ::
  :"db.cassandra.speculative_execution_count"

The number of times a query was speculatively executed. Not set or 0 if the query was not executed speculatively.

Value type

Value must be of type integer().

Examples

[0, 2]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cassandra_speculative_execution_count()
:"db.cassandra.speculative_execution_count"
This function is deprecated. Replaced by `db.collection.name`. .
@spec db_cassandra_table() :: :"db.cassandra.table"
Link to this function

db_client_connection_pool_name()

View Source
@spec db_client_connection_pool_name() :: :"db.client.connection.pool.name"

The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes server.address, server.port, and db.namespace, formatted as server.address:server.port/db.namespace. Instrumentations that generate connection pool name following different patterns SHOULD document it.

Value type

Value must be of type atom() | String.t().

Examples

["myDataSource"]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_client_connection_pool_name()
:"db.client.connection.pool.name"
Link to this function

db_client_connection_state()

View Source
@spec db_client_connection_state() :: :"db.client.connection.state"

The state of a connection in the pool

Examples

["idle"]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_client_connection_state()
:"db.client.connection.state"

iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_client_connection_state_values().idle
:idle

iex> %{OpenTelemetry.SemConv.Incubating.DBAttributes.db_client_connection_state() => OpenTelemetry.SemConv.Incubating.DBAttributes.db_client_connection_state_values().idle}
%{:"db.client.connection.state" => :idle}
Link to this function

db_client_connection_state_values()

View Source
@spec db_client_connection_state_values() :: db_client_connection_state_values()
Link to this function

db_client_connections_pool_name()

View Source
This function is deprecated. Replaced by `db.client.connection.pool.name`. .
@spec db_client_connections_pool_name() :: :"db.client.connections.pool.name"
Link to this function

db_client_connections_state()

View Source
This function is deprecated. Replaced by `db.client.connection.state`. .
@spec db_client_connections_state() :: :"db.client.connections.state"
Link to this function

db_client_connections_state_values()

View Source
@spec db_client_connections_state_values() :: db_client_connections_state_values()
@spec db_collection_name() :: :"db.collection.name"

The name of a collection (table, container) within the database.

Value type

Value must be of type atom() | String.t().

Notes

It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise db.collection.name SHOULD NOT be captured.

Examples

["public.users", "customers"]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_collection_name()
:"db.collection.name"
This function is deprecated. "Replaced by `server.address` and `server.port`." .
@spec db_connection_string() :: :"db.connection_string"
@spec db_cosmosdb_client_id() :: :"db.cosmosdb.client_id"

Unique Cosmos client instance id.

Value type

Value must be of type atom() | String.t().

Examples

3ba4827d-4422-483f-b59f-85b74211c11d
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_client_id()
:"db.cosmosdb.client_id"
Link to this function

db_cosmosdb_connection_mode()

View Source
@spec db_cosmosdb_connection_mode() :: :"db.cosmosdb.connection_mode"

Cosmos client connection mode.

iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_connection_mode()
:"db.cosmosdb.connection_mode"

iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_connection_mode_values().gateway
:gateway

iex> %{OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_connection_mode() => OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_connection_mode_values().gateway}
%{:"db.cosmosdb.connection_mode" => :gateway}
Link to this function

db_cosmosdb_connection_mode_values()

View Source
@spec db_cosmosdb_connection_mode_values() :: db_cosmosdb_connection_mode_values()
This function is deprecated. Replaced by `db.collection.name`. .
@spec db_cosmosdb_container() :: :"db.cosmosdb.container"
Link to this function

db_cosmosdb_operation_type()

View Source
@spec db_cosmosdb_operation_type() :: :"db.cosmosdb.operation_type"

CosmosDB Operation Type.

iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_operation_type()
:"db.cosmosdb.operation_type"

iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_operation_type_values().invalid
:Invalid

iex> %{OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_operation_type() => OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_operation_type_values().invalid}
%{:"db.cosmosdb.operation_type" => :Invalid}
Link to this function

db_cosmosdb_operation_type_values()

View Source
@spec db_cosmosdb_operation_type_values() :: db_cosmosdb_operation_type_values()
Link to this function

db_cosmosdb_request_charge()

View Source
@spec db_cosmosdb_request_charge() :: :"db.cosmosdb.request_charge"

RU consumed for that operation

Value type

Value must be of type float().

Examples

[46.18, 1.0]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_request_charge()
:"db.cosmosdb.request_charge"
Link to this function

db_cosmosdb_request_content_length()

View Source
@spec db_cosmosdb_request_content_length() :: :"db.cosmosdb.request_content_length"

Request payload size in bytes

Value type

Value must be of type integer().

iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_request_content_length()
:"db.cosmosdb.request_content_length"
Link to this function

db_cosmosdb_status_code()

View Source
@spec db_cosmosdb_status_code() :: :"db.cosmosdb.status_code"

Cosmos DB status code.

Value type

Value must be of type integer().

Examples

[200, 201]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_status_code()
:"db.cosmosdb.status_code"
Link to this function

db_cosmosdb_sub_status_code()

View Source
@spec db_cosmosdb_sub_status_code() :: :"db.cosmosdb.sub_status_code"

Cosmos DB sub status code.

Value type

Value must be of type integer().

Examples

[1000, 1002]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_cosmosdb_sub_status_code()
:"db.cosmosdb.sub_status_code"
Link to this function

db_elasticsearch_cluster_name()

View Source
This function is deprecated. Replaced by `db.namespace`. .
@spec db_elasticsearch_cluster_name() :: :"db.elasticsearch.cluster.name"
Link to this function

db_elasticsearch_node_name()

View Source
@spec db_elasticsearch_node_name() :: :"db.elasticsearch.node.name"

Represents the human-readable identifier of the node/instance to which a request was routed.

Value type

Value must be of type atom() | String.t().

Examples

["instance-0000000001"]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_elasticsearch_node_name()
:"db.elasticsearch.node.name"
Link to this function

db_elasticsearch_path_parts()

View Source
@spec db_elasticsearch_path_parts() :: :"db.elasticsearch.path_parts"

A dynamic value in the url path.

Value type

Value must be of type atom() | String.t().

Notes

Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format db.elasticsearch.path_parts.<key>, where <key> is the url path part name. The implementation SHOULD reference the elasticsearch schema in order to map the path part values to their names.

Examples

["db.elasticsearch.path_parts.index=test-index", "db.elasticsearch.path_parts.doc_id=123"]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_elasticsearch_path_parts()
:"db.elasticsearch.path_parts"
This function is deprecated. Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. .
@spec db_instance_id() :: :"db.instance.id"
Link to this function

db_jdbc_driver_classname()

View Source
This function is deprecated. Removed as not used. .
@spec db_jdbc_driver_classname() :: :"db.jdbc.driver_classname"
This function is deprecated. Replaced by `db.collection.name`. .
@spec db_mongodb_collection() :: :"db.mongodb.collection"
Link to this function

db_mssql_instance_name()

View Source
This function is deprecated. Deprecated, no replacement at this time. .
@spec db_mssql_instance_name() :: :"db.mssql.instance_name"
This function is deprecated. Replaced by `db.namespace`. .
@spec db_name() :: :"db.name"
@spec db_namespace() :: :"db.namespace"

The name of the database, fully qualified within the server address and port.

Value type

Value must be of type atom() | String.t().

Notes

If a database system has multiple namespace components, they SHOULD be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid.
Semantic conventions for individual database systems SHOULD document what db.namespace means in the context of that system.
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.

Examples

["customers", "test.users"]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_namespace()
:"db.namespace"
This function is deprecated. Replaced by `db.operation.name`. .
@spec db_operation() :: :"db.operation"
Link to this function

db_operation_batch_size()

View Source
@spec db_operation_batch_size() :: :"db.operation.batch.size"

The number of queries included in a batch operation.

Value type

Value must be of type integer().

Notes

Operations are only considered batches when they contain two or more operations, and so db.operation.batch.size SHOULD never be 1.

Examples

[2, 3, 4]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_operation_batch_size()
:"db.operation.batch.size"
@spec db_operation_name() :: :"db.operation.name"

The name of the operation or command being executed.

Value type

Value must be of type atom() | String.t().

Notes

It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
For batch operations, if the individual operations are known to have the same operation name then that operation name SHOULD be used prepended by BATCH, otherwise db.operation.name SHOULD be BATCH or some other database system specific term if more applicable.

Examples

["findAndModify", "HMSET", "SELECT"]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_operation_name()
:"db.operation.name"
@spec db_query_parameter() :: :"db.query.parameter"

A query parameter used in db.query.text, with <key> being the parameter name, and the attribute value being a string representation of the parameter value.

Value type

Value must be of type atom() | String.t().

Notes

Query parameters should only be captured when db.query.text is parameterized with placeholders.
If a parameter has no name and instead is referenced only by index, then <key> SHOULD be the 0-based index.

Examples

["someval", "55"]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_query_parameter()
:"db.query.parameter"
@spec db_query_text() :: :"db.query.text"

The database query being executed.

Value type

Value must be of type atom() | String.t().

Notes

For sanitization see Sanitization of db.query.text.
For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator ; or some other database system specific separator if more applicable.
Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk.

Examples

["SELECT * FROM wuser_table where username = ?", "SET mykey "WuValue""]
iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_query_text()
:"db.query.text"
Link to this function

db_redis_database_index()

View Source
This function is deprecated. Replaced by `db.namespace`. .
@spec db_redis_database_index() :: :"db.redis.database_index"
This function is deprecated. Replaced by `db.collection.name`. .
@spec db_sql_table() :: :"db.sql.table"
This function is deprecated. Replaced by `db.query.text`. .
@spec db_statement() :: :"db.statement"
@spec db_system() :: :"db.system"

The database management system (DBMS) product as identified by the client instrumentation.

Notes

The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the db.system is set to postgresql based on the instrumentation's best knowledge.

iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_system()
:"db.system"

iex> OpenTelemetry.SemConv.Incubating.DBAttributes.db_system_values().other_sql
:other_sql

iex> %{OpenTelemetry.SemConv.Incubating.DBAttributes.db_system() => OpenTelemetry.SemConv.Incubating.DBAttributes.db_system_values().other_sql}
%{:"db.system" => :other_sql}
@spec db_system_values() :: db_system_values()
This function is deprecated. No replacement at this time. .
@spec db_user() :: :"db.user"
This function is deprecated. Replaced by `db.client.connection.pool.name`. .
@spec pool_name() :: :"pool.name"
This function is deprecated. Replaced by `db.client.connection.state`. .
@spec state() :: :state
@spec state_values() :: state_values()