semantic-conventions/model/database/registry.yaml

559 lines
22 KiB
YAML

groups:
- id: registry.db
type: attribute_group
display_name: General Database Attributes
brief: >
This group defines the attributes used to describe telemetry in the context of databases.
attributes:
- id: db.collection.name
type: string
stability: release_candidate
brief: The name of a collection (table, container) within the database.
note: |
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
The collection name SHOULD NOT be extracted from `db.query.text`,
unless the query format is known to only ever have a single collection name present.
For batch operations, if the individual operations are known to have the same collection name
then that collection name SHOULD be used.
examples: ["public.users", "customers"]
- id: db.namespace
type: string
stability: release_candidate
brief: >
The name of the database, fully qualified within the server address and port.
note: >
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"]
- id: db.operation.name
type: string
stability: release_candidate
brief: >
The name of the operation or command being executed.
note: |
It is RECOMMENDED to capture the value as provided by the application
without attempting to do any case normalization.
The operation name SHOULD NOT be extracted from `db.query.text`,
unless the query format is known to only ever have a single operation name present.
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"]
- id: db.query.text
type: string
stability: release_candidate
brief: >
The database query being executed.
note: >
For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext).
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 ?',
]
- id: db.operation.parameter
type: template[string]
stability: release_candidate
brief: >
A database operation parameter, with `<key>` being the parameter name,
and the attribute value being a string representation of the parameter value.
note: >
If a parameter has no name and instead is referenced only by index,
then `<key>` SHOULD be the 0-based index.
If `db.query.text` is also captured, then `db.operation.parameter.<key>` SHOULD match
up with the parameterized placeholders present in `db.query.text`.
examples: ["someval", "55"]
- id: db.query.summary
type: string
stability: release_candidate
brief: >
Low cardinality representation of a database query text.
note: >
`db.query.summary` provides static summary of the query text. It describes
a class of database queries and is useful as a grouping key,
especially when analyzing telemetry for database calls involving complex queries.
Summary may be available to the instrumentation through
instrumentation hooks or other means. If it is not available, instrumentations
that support query parsing SHOULD generate a summary following
[Generating query summary](../../docs/database/database-spans.md#generating-a-summary-of-the-query-text)
section.
examples:
[
'SELECT wuser_table',
'INSERT shipping_details SELECT orders',
'get user by id',
]
- id: db.operation.batch.size
type: int
stability: release_candidate
brief: The number of queries included in a batch operation.
note: >
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]
- id: db.response.status_code
type: string
stability: release_candidate
brief: Database response status code.
note: >
The status code returned by the database. Usually it represents an error code,
but may also represent partial success, warning, or differentiate
between various types of successful outcomes.
Semantic conventions for individual database systems SHOULD document what
`db.response.status_code` means in the context of that system.
examples: ["102", "ORA-17002", "08P01", "404"]
- id: db.response.returned_rows
type: int
stability: experimental
brief: Number of rows returned by the operation.
examples: [10, 30, 1000]
- id: db.system
brief: The database management system (DBMS) product as identified by the client instrumentation.
note: >
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.
type:
members:
- id: other_sql
value: "other_sql"
brief: "Some other SQL database. Fallback only. See notes."
stability: experimental
- id: adabas
value: "adabas"
brief: "Adabas (Adaptable Database System)"
stability: experimental
- id: cache
value: "cache"
deprecated: "Replaced by `intersystems_cache`."
brief: "Deprecated, use `intersystems_cache` instead."
stability: experimental
- id: intersystems_cache
value: "intersystems_cache"
brief: "InterSystems Caché"
stability: experimental
- id: cassandra
value: "cassandra"
brief: "Apache Cassandra"
stability: experimental
- id: clickhouse
value: "clickhouse"
brief: "ClickHouse"
stability: experimental
- id: cloudscape
value: "cloudscape"
deprecated: "Replaced by `other_sql`."
brief: "Deprecated, use `other_sql` instead."
stability: experimental
- id: cockroachdb
value: "cockroachdb"
brief: "CockroachDB"
stability: experimental
- id: coldfusion
value: "coldfusion"
deprecated: "Removed."
brief: "Deprecated, no replacement at this time."
stability: experimental
- id: cosmosdb
value: "cosmosdb"
brief: "Microsoft Azure Cosmos DB"
stability: experimental
- id: couchbase
value: "couchbase"
brief: "Couchbase"
stability: experimental
- id: couchdb
value: "couchdb"
brief: "CouchDB"
stability: experimental
- id: db2
value: "db2"
brief: "IBM Db2"
stability: experimental
- id: derby
value: "derby"
brief: "Apache Derby"
stability: experimental
- id: dynamodb
value: "dynamodb"
brief: "Amazon DynamoDB"
stability: experimental
- id: edb
value: "edb"
brief: "EnterpriseDB"
stability: experimental
- id: elasticsearch
value: "elasticsearch"
brief: "Elasticsearch"
stability: experimental
- id: filemaker
value: "filemaker"
brief: "FileMaker"
stability: experimental
- id: firebird
value: "firebird"
brief: "Firebird"
stability: experimental
- id: firstsql
value: "firstsql"
deprecated: "Replaced by `other_sql`."
brief: "Deprecated, use `other_sql` instead."
stability: experimental
- id: geode
value: "geode"
brief: "Apache Geode"
stability: experimental
- id: h2
value: "h2"
brief: "H2"
stability: experimental
- id: hanadb
value: "hanadb"
brief: "SAP HANA"
stability: experimental
- id: hbase
value: "hbase"
brief: "Apache HBase"
stability: experimental
- id: hive
value: "hive"
brief: "Apache Hive"
stability: experimental
- id: hsqldb
value: "hsqldb"
brief: "HyperSQL DataBase"
stability: experimental
- id: influxdb
value: "influxdb"
brief: "InfluxDB"
stability: experimental
- id: informix
value: "informix"
brief: "Informix"
stability: experimental
- id: ingres
value: "ingres"
brief: "Ingres"
stability: experimental
- id: instantdb
value: "instantdb"
brief: "InstantDB"
stability: experimental
- id: interbase
value: "interbase"
brief: "InterBase"
stability: experimental
- id: mariadb
value: "mariadb"
brief: "MariaDB (This value has stability level RELEASE CANDIDATE)"
stability: release_candidate
- id: maxdb
value: "maxdb"
brief: "SAP MaxDB"
stability: experimental
- id: memcached
value: "memcached"
brief: "Memcached"
stability: experimental
- id: mongodb
value: "mongodb"
brief: "MongoDB"
stability: experimental
- id: mssql
value: "mssql"
brief: "Microsoft SQL Server (This value has stability level RELEASE CANDIDATE)"
stability: release_candidate
- id: mssqlcompact
value: "mssqlcompact"
deprecated: "Removed, use `other_sql` instead."
brief: "Deprecated, Microsoft SQL Server Compact is discontinued."
stability: experimental
- id: mysql
value: "mysql"
brief: "MySQL (This value has stability level RELEASE CANDIDATE)"
stability: release_candidate
- id: neo4j
value: "neo4j"
brief: "Neo4j"
stability: experimental
- id: netezza
value: "netezza"
brief: "Netezza"
stability: experimental
- id: opensearch
value: "opensearch"
brief: "OpenSearch"
stability: experimental
- id: oracle
value: "oracle"
brief: "Oracle Database"
stability: experimental
- id: pervasive
value: "pervasive"
brief: "Pervasive PSQL"
stability: experimental
- id: pointbase
value: "pointbase"
brief: "PointBase"
stability: experimental
- id: postgresql
value: "postgresql"
brief: "PostgreSQL (This value has stability level RELEASE CANDIDATE)"
stability: release_candidate
- id: progress
value: "progress"
brief: "Progress Database"
stability: experimental
- id: redis
value: "redis"
brief: "Redis"
stability: experimental
- id: redshift
value: "redshift"
brief: "Amazon Redshift"
stability: experimental
- id: spanner
value: "spanner"
brief: "Cloud Spanner"
stability: experimental
- id: sqlite
value: "sqlite"
brief: "SQLite"
stability: experimental
- id: sybase
value: "sybase"
brief: "Sybase"
stability: experimental
- id: teradata
value: "teradata"
brief: "Teradata"
stability: experimental
- id: trino
value: "trino"
brief: "Trino"
stability: experimental
- id: vertica
value: "vertica"
brief: "Vertica"
stability: experimental
stability: release_candidate
- id: db.client.connection.state
stability: experimental
type:
members:
- id: idle
value: "idle"
stability: experimental
- id: used
value: "used"
stability: experimental
brief: "The state of a connection in the pool"
examples: ["idle"]
- id: db.client.connection.pool.name
type: string
stability: experimental
brief: >
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.
examples: ["myDataSource"]
- id: registry.db.cassandra
type: attribute_group
display_name: Cassandra Attributes
brief: >
This group defines attributes for Cassandra.
attributes:
- id: db.cassandra.coordinator.dc
type: string
stability: experimental
brief: >
The data center of the coordinating node for a query.
examples: "us-west-2"
- id: db.cassandra.coordinator.id
type: string
stability: experimental
brief: >
The ID of the coordinating node for a query.
examples: "be13faa2-8574-4d71-926d-27f16cf8a7af"
- id: db.cassandra.consistency_level
brief: >
The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).
type:
members:
- id: all
value: "all"
stability: experimental
- id: each_quorum
value: "each_quorum"
stability: experimental
- id: quorum
value: "quorum"
stability: experimental
- id: local_quorum
value: "local_quorum"
stability: experimental
- id: one
value: "one"
stability: experimental
- id: two
value: "two"
stability: experimental
- id: three
value: "three"
stability: experimental
- id: local_one
value: "local_one"
stability: experimental
- id: any
value: "any"
stability: experimental
- id: serial
value: "serial"
stability: experimental
- id: local_serial
value: "local_serial"
stability: experimental
stability: experimental
- id: db.cassandra.idempotence
type: boolean
stability: experimental
brief: >
Whether or not the query is idempotent.
- id: db.cassandra.page_size
type: int
stability: experimental
brief: >
The fetch size used for paging, i.e. how many rows will be returned at once.
examples: [5000]
- id: db.cassandra.speculative_execution_count
type: int
stability: experimental
brief: >
The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively.
examples: [0, 2]
- id: registry.db.cosmosdb
type: attribute_group
display_name: Azure Cosmos DB Attributes
stability: experimental
brief: >
This group defines attributes for Azure Cosmos DB.
attributes:
- id: db.cosmosdb.client_id
type: string
stability: experimental
brief: Unique Cosmos client instance id.
examples: "3ba4827d-4422-483f-b59f-85b74211c11d"
- id: db.cosmosdb.connection_mode
type:
members:
- id: gateway
value: "gateway"
brief: Gateway (HTTP) connection.
stability: experimental
- id: direct
value: "direct"
brief: Direct connection.
stability: experimental
stability: experimental
brief: Cosmos client connection mode.
- id: db.cosmosdb.request_charge
type: double
stability: experimental
brief: Request units consumed for the operation.
examples: [46.18, 1.0]
- id: db.cosmosdb.request_content_length
type: int
stability: experimental
brief: Request payload size in bytes.
- id: db.cosmosdb.sub_status_code
type: int
stability: experimental
brief: Cosmos DB sub status code.
examples: [1000, 1002]
- id: db.cosmosdb.consistency_level
type:
members:
- id: strong
value: "Strong"
stability: experimental
- id: bounded_staleness
value: "BoundedStaleness"
stability: experimental
- id: session
value: "Session"
stability: experimental
- id: eventual
value: "Eventual"
stability: experimental
- id: consistent_prefix
value: "ConsistentPrefix"
stability: experimental
stability: experimental
brief: Account or request [consistency level](https://learn.microsoft.com/azure/cosmos-db/consistency-levels).
examples: ["Eventual", "ConsistentPrefix", "BoundedStaleness", "Strong", "Session"]
- id: db.cosmosdb.regions_contacted
type: string[]
stability: experimental
brief: >
List of regions contacted during operation in the order that they were contacted. If there is more than one region listed,
it indicates that the operation was performed on multiple regions i.e. cross-regional call.
note: >
Region name matches the format of `displayName`
in [Azure Location API](https://learn.microsoft.com/rest/api/subscription/subscriptions/list-locations?view=rest-subscription-2021-10-01&tabs=HTTP#location)
examples:
- ["North Central US", "Australia East", "Australia Southeast"]
- id: registry.db.elasticsearch
type: attribute_group
display_name: Elasticsearch Attributes
brief: >
This group defines attributes for Elasticsearch.
attributes:
- id: db.elasticsearch.node.name
type: string
stability: experimental
brief: >
Represents the human-readable identifier of the node/instance to which a request was routed.
examples: ["instance-0000000001"]
- id: db.elasticsearch.path_parts
type: template[string]
stability: experimental
brief: >
A dynamic value in the url path.
note: >
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](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json)
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",
]