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.
The name of the database, fully qualified within the server address and port.
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.
The database management system (DBMS) product as identified by the client instrumentation.
Types
@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
@type db_client_connection_state_values() :: %{idle: :idle, used: :used}
The state of a connection in the pool
Enum Values
@type db_client_connections_state_values() :: %{idle: :idle, used: :used}
Deprecated, use db.client.connection.state
instead.
Enum Values
@type db_cosmosdb_connection_mode_values() :: %{gateway: :gateway, direct: :direct}
Cosmos client connection mode.
Enum Values
@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
@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 - deprecatedDeprecated, useintersystems_cache
instead.:intersystems_cache
e - InterSystems Caché:cassandra
e - Apache Cassandra:clickhouse
e - ClickHouse:cloudscape
e - deprecatedDeprecated, useother_sql
instead.:cockroachdb
e - CockroachDB:coldfusion
e - deprecatedDeprecated, 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 - deprecatedDeprecated, useother_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 - deprecatedDeprecated, 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
Functions
@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}
?DB_CASSANDRA_CONSISTENCY_LEVEL.
'db.cassandra.consistency_level'
?DB_CASSANDRA_CONSISTENCY_LEVEL_VALUES_ALL.
'all'
#{?DB_CASSANDRA_CONSISTENCY_LEVEL => ?DB_CASSANDRA_CONSISTENCY_LEVEL_VALUES_ALL}.
#{'db.cassandra.consistency_level' => 'all'}
@spec db_cassandra_consistency_level_values() :: db_cassandra_consistency_level_values()
@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"
?DB_CASSANDRA_COORDINATOR_DC.
'db.cassandra.coordinator.dc'
@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"
?DB_CASSANDRA_COORDINATOR_ID.
'db.cassandra.coordinator.id'
@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"
?DB_CASSANDRA_IDEMPOTENCE.
'db.cassandra.idempotence'
@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"
?DB_CASSANDRA_PAGE_SIZE.
'db.cassandra.page_size'
@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"
?DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT.
'db.cassandra.speculative_execution_count'
@spec db_cassandra_table() :: :"db.cassandra.table"
@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"
?DB_CLIENT_CONNECTION_POOL_NAME.
'db.client.connection.pool.name'
@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}
?DB_CLIENT_CONNECTION_STATE.
'db.client.connection.state'
?DB_CLIENT_CONNECTION_STATE_VALUES_IDLE.
'idle'
#{?DB_CLIENT_CONNECTION_STATE => ?DB_CLIENT_CONNECTION_STATE_VALUES_IDLE}.
#{'db.client.connection.state' => 'idle'}
@spec db_client_connection_state_values() :: db_client_connection_state_values()
@spec db_client_connections_pool_name() :: :"db.client.connections.pool.name"
@spec db_client_connections_state() :: :"db.client.connections.state"
@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"
?DB_COLLECTION_NAME.
'db.collection.name'
@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"
?DB_COSMOSDB_CLIENT_ID.
'db.cosmosdb.client_id'
@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}
?DB_COSMOSDB_CONNECTION_MODE.
'db.cosmosdb.connection_mode'
?DB_COSMOSDB_CONNECTION_MODE_VALUES_GATEWAY.
'gateway'
#{?DB_COSMOSDB_CONNECTION_MODE => ?DB_COSMOSDB_CONNECTION_MODE_VALUES_GATEWAY}.
#{'db.cosmosdb.connection_mode' => 'gateway'}
@spec db_cosmosdb_connection_mode_values() :: db_cosmosdb_connection_mode_values()
@spec db_cosmosdb_container() :: :"db.cosmosdb.container"
@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}
?DB_COSMOSDB_OPERATION_TYPE.
'db.cosmosdb.operation_type'
?DB_COSMOSDB_OPERATION_TYPE_VALUES_INVALID.
'Invalid'
#{?DB_COSMOSDB_OPERATION_TYPE => ?DB_COSMOSDB_OPERATION_TYPE_VALUES_INVALID}.
#{'db.cosmosdb.operation_type' => 'Invalid'}
@spec db_cosmosdb_operation_type_values() :: db_cosmosdb_operation_type_values()
@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"
?DB_COSMOSDB_REQUEST_CHARGE.
'db.cosmosdb.request_charge'
@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"
?DB_COSMOSDB_REQUEST_CONTENT_LENGTH.
'db.cosmosdb.request_content_length'
@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"
?DB_COSMOSDB_STATUS_CODE.
'db.cosmosdb.status_code'
@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"
?DB_COSMOSDB_SUB_STATUS_CODE.
'db.cosmosdb.sub_status_code'
@spec db_elasticsearch_cluster_name() :: :"db.elasticsearch.cluster.name"
@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"
?DB_ELASTICSEARCH_NODE_NAME.
'db.elasticsearch.node.name'
@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"
?DB_ELASTICSEARCH_PATH_PARTS.
'db.elasticsearch.path_parts'
@spec db_instance_id() :: :"db.instance.id"
@spec db_jdbc_driver_classname() :: :"db.jdbc.driver_classname"
@spec db_mongodb_collection() :: :"db.mongodb.collection"
@spec db_mssql_instance_name() :: :"db.mssql.instance_name"
@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"
?DB_NAMESPACE.
'db.namespace'
@spec db_operation() :: :"db.operation"
@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"
?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"
?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"
?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"
?DB_QUERY_TEXT.
'db.query.text'
@spec db_redis_database_index() :: :"db.redis.database_index"
@spec db_sql_table() :: :"db.sql.table"
@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}
?DB_SYSTEM.
'db.system'
?DB_SYSTEM_VALUES_OTHER_SQL.
'other_sql'
#{?DB_SYSTEM => ?DB_SYSTEM_VALUES_OTHER_SQL}.
#{'db.system' => 'other_sql'}
@spec db_system_values() :: db_system_values()
@spec db_user() :: :"db.user"
@spec pool_name() :: :"pool.name"
@spec state() :: :state
@spec state_values() :: state_values()