semantic-conventions/model/registry/db.yaml

448 lines
16 KiB
YAML

groups:
- id: registry.db
prefix: db
type: attribute_group
brief: >
This document defines the attributes used to describe telemetry in the context of databases.
attributes:
- id: cassandra.coordinator.dc
type: string
stability: experimental
brief: >
The data center of the coordinating node for a query.
examples: 'us-west-2'
tag: tech-specific-cassandra
- id: cassandra.coordinator.id
type: string
stability: experimental
brief: >
The ID of the coordinating node for a query.
examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af'
tag: tech-specific-cassandra
- id: 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'
- id: each_quorum
value: 'each_quorum'
- id: quorum
value: 'quorum'
- id: local_quorum
value: 'local_quorum'
- id: one
value: 'one'
- id: two
value: 'two'
- id: three
value: 'three'
- id: local_one
value: 'local_one'
- id: any
value: 'any'
- id: serial
value: 'serial'
- id: local_serial
value: 'local_serial'
stability: experimental
tag: tech-specific-cassandra
- id: cassandra.idempotence
type: boolean
stability: experimental
brief: >
Whether or not the query is idempotent.
tag: tech-specific-cassandra
- id: 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]
tag: tech-specific-cassandra
- id: 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]
tag: tech-specific-cassandra
- id: cassandra.table
type: string
stability: experimental
brief: The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable).
note: >
This mirrors the db.sql.table attribute but references cassandra rather than sql.
It is not recommended to attempt any client-side parsing of
`db.statement` just to get this property, but it should be set if
it is provided by the library being instrumented.
If the operation is acting upon an anonymous table, or more than one table, this
value MUST NOT be set.
examples: 'mytable'
tag: tech-specific-cassandra
- id: cosmosdb.client_id
type: string
stability: experimental
brief: Unique Cosmos client instance id.
examples: '3ba4827d-4422-483f-b59f-85b74211c11d'
tag: tech-specific-cosmosdb
- id: cosmosdb.connection_mode
type:
allow_custom_values: false
members:
- id: gateway
value: 'gateway'
brief: Gateway (HTTP) connections mode
- id: direct
value: 'direct'
brief: Direct connection.
stability: experimental
brief: Cosmos client connection mode.
tag: tech-specific-cosmosdb
- id: cosmosdb.container
type: string
stability: experimental
brief: Cosmos DB container name.
examples: 'anystring'
tag: tech-specific-cosmosdb
- id: cosmosdb.operation_type
type:
allow_custom_values: true
members:
- id: invalid
value: 'Invalid'
- id: create
value: 'Create'
- id: patch
value: 'Patch'
- id: read
value: 'Read'
- id: read_feed
value: 'ReadFeed'
- id: delete
value: 'Delete'
- id: replace
value: 'Replace'
- id: execute
value: 'Execute'
- id: query
value: 'Query'
- id: head
value: 'Head'
- id: head_feed
value: 'HeadFeed'
- id: upsert
value: 'Upsert'
- id: batch
value: 'Batch'
- id: query_plan
value: 'QueryPlan'
- id: execute_javascript
value: 'ExecuteJavaScript'
stability: experimental
brief: CosmosDB Operation Type.
tag: tech-specific-cosmosdb
- id: cosmosdb.request_charge
type: double
stability: experimental
brief: RU consumed for that operation
examples: [46.18, 1.0]
tag: tech-specific-cosmosdb
- id: cosmosdb.request_content_length
type: int
stability: experimental
brief: Request payload size in bytes
tag: tech-specific-cosmosdb
- id: cosmosdb.status_code
type: int
stability: experimental
brief: Cosmos DB status code.
examples: [200, 201]
tag: tech-specific-cosmosdb
- id: cosmosdb.sub_status_code
type: int
stability: experimental
brief: Cosmos DB sub status code.
examples: [1000, 1002]
tag: tech-specific-cosmosdb
- id: elasticsearch.cluster.name
type: string
stability: experimental
brief: >
Represents the identifier of an Elasticsearch cluster.
examples: ["e9106fc68e3044f0b1475b04bf4ffd5f"]
tag: tech-specific-elasticsearch
- id: 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"]
tag: tech-specific-elasticsearch
- id: 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']
tag: tech-specific-elasticsearch
- id: mongodb.collection
type: string
stability: experimental
brief: >
The MongoDB collection being accessed within the database stated in `db.name`.
examples: [ 'customers', 'products' ]
tag: tech-specific-mongodb
- id: mssql.instance_name
type: string
stability: experimental
note: >
If setting a `db.mssql.instance_name`, `server.port` is no longer
required (but still recommended if non-standard).
brief: >
The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15)
connecting to. This name is used to determine the port of a named instance.
examples: 'MSSQLSERVER'
tag: tech-specific-mssql
- id: name
type: string
stability: experimental
brief: >
This attribute is used to report the name of the database being accessed.
For commands that switch the database, this should be set to the target database
(even if the command fails).
note: >
In some SQL databases, the database name to be used is called "schema name".
In case there are multiple layers that could be considered for database name
(e.g. Oracle instance name and schema name),
the database name to be used is the more specific layer (e.g. Oracle schema name).
examples: [ 'customers', 'main' ]
tag: db-generic
- id: operation
type: string
stability: experimental
brief: >
The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations)
such as `findAndModify`, or the SQL keyword.
note: >
When setting this to an SQL keyword, it is not recommended to
attempt any client-side parsing of `db.statement` just to get this
property, but it should be set if the operation name is provided by
the library being instrumented.
If the SQL statement has an ambiguous operation, or performs more
than one operation, this value may be omitted.
examples: ['findAndModify', 'HMSET', 'SELECT']
tag: db-generic
- id: redis.database_index
type: int
stability: experimental
brief: >
The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer.
To be used instead of the generic `db.name` attribute.
examples: [0, 1, 15]
tag: tech-specific-redis
- id: sql.table
type: string
stability: experimental
brief: The name of the primary table that the operation is acting upon, including the database name (if applicable).
note: >
It is not recommended to attempt any client-side parsing of
`db.statement` just to get this property, but it should be set if
it is provided by the library being instrumented.
If the operation is acting upon an anonymous table, or more than one table, this
value MUST NOT be set.
examples: ['public.users', 'customers']
tag: tech-specific-sql
- id: statement
type: string
stability: experimental
brief: >
The database statement being executed.
examples: ['SELECT * FROM wuser_table', 'SET mykey "WuValue"']
tag: db-generic
- id: system
brief: An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.
type:
allow_custom_values: true
members:
- id: other_sql
value: 'other_sql'
brief: 'Some other SQL database. Fallback only. See notes.'
- id: mssql
value: 'mssql'
brief: 'Microsoft SQL Server'
- id: mssqlcompact
value: 'mssqlcompact'
brief: 'Microsoft SQL Server Compact'
- id: mysql
value: 'mysql'
brief: 'MySQL'
- id: oracle
value: 'oracle'
brief: 'Oracle Database'
- id: db2
value: 'db2'
brief: 'IBM Db2'
- id: postgresql
value: 'postgresql'
brief: 'PostgreSQL'
- id: redshift
value: 'redshift'
brief: 'Amazon Redshift'
- id: hive
value: 'hive'
brief: 'Apache Hive'
- id: cloudscape
value: 'cloudscape'
brief: 'Cloudscape'
- id: hsqldb
value: 'hsqldb'
brief: 'HyperSQL DataBase'
- id: progress
value: 'progress'
brief: 'Progress Database'
- id: maxdb
value: 'maxdb'
brief: 'SAP MaxDB'
- id: hanadb
value: 'hanadb'
brief: 'SAP HANA'
- id: ingres
value: 'ingres'
brief: 'Ingres'
- id: firstsql
value: 'firstsql'
brief: 'FirstSQL'
- id: edb
value: 'edb'
brief: 'EnterpriseDB'
- id: cache
value: 'cache'
brief: 'InterSystems Caché'
- id: adabas
value: 'adabas'
brief: 'Adabas (Adaptable Database System)'
- id: firebird
value: 'firebird'
brief: 'Firebird'
- id: derby
value: 'derby'
brief: 'Apache Derby'
- id: filemaker
value: 'filemaker'
brief: 'FileMaker'
- id: informix
value: 'informix'
brief: 'Informix'
- id: instantdb
value: 'instantdb'
brief: 'InstantDB'
- id: interbase
value: 'interbase'
brief: 'InterBase'
- id: mariadb
value: 'mariadb'
brief: 'MariaDB'
- id: netezza
value: 'netezza'
brief: 'Netezza'
- id: pervasive
value: 'pervasive'
brief: 'Pervasive PSQL'
- id: pointbase
value: 'pointbase'
brief: 'PointBase'
- id: sqlite
value: 'sqlite'
brief: 'SQLite'
- id: sybase
value: 'sybase'
brief: 'Sybase'
- id: teradata
value: 'teradata'
brief: 'Teradata'
- id: vertica
value: 'vertica'
brief: 'Vertica'
- id: h2
value: 'h2'
brief: 'H2'
- id: coldfusion
value: 'coldfusion'
brief: 'ColdFusion IMQ'
- id: cassandra
value: 'cassandra'
brief: 'Apache Cassandra'
- id: hbase
value: 'hbase'
brief: 'Apache HBase'
- id: mongodb
value: 'mongodb'
brief: 'MongoDB'
- id: redis
value: 'redis'
brief: 'Redis'
- id: couchbase
value: 'couchbase'
brief: 'Couchbase'
- id: couchdb
value: 'couchdb'
brief: 'CouchDB'
- id: cosmosdb
value: 'cosmosdb'
brief: 'Microsoft Azure Cosmos DB'
- id: dynamodb
value: 'dynamodb'
brief: 'Amazon DynamoDB'
- id: neo4j
value: 'neo4j'
brief: 'Neo4j'
- id: geode
value: 'geode'
brief: 'Apache Geode'
- id: elasticsearch
value: 'elasticsearch'
brief: 'Elasticsearch'
- id: memcached
value: 'memcached'
brief: 'Memcached'
- id: cockroachdb
value: 'cockroachdb'
brief: 'CockroachDB'
- id: opensearch
value: 'opensearch'
brief: 'OpenSearch'
- id: clickhouse
value: 'clickhouse'
brief: 'ClickHouse'
- id: spanner
value: 'spanner'
brief: 'Cloud Spanner'
- id: trino
value: 'trino'
brief: 'Trino'
stability: experimental
tag: db-generic
- id: user
type: string
stability: experimental
brief: >
Username for accessing the database.
examples: ['readonly_user', 'reporting_user']
tag: db-generic
- id: instance.id
tag: db-generic
type: string
stability: experimental
brief: >
An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection.
This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query.
The client may obtain this value in databases like MySQL using queries like `select @@hostname`.
examples: 'mysql-e26b99z.example.com'