semantic-conventions/model/trace/database.yaml

237 lines
8.5 KiB
YAML

groups:
- id: db
type: span
brief: >
This document defines the attributes used to perform database client calls.
span_kind: client
attributes:
- ref: db.system
requirement_level: required
- ref: db.user
- ref: db.name
requirement_level:
conditionally_required: If applicable.
- ref: db.statement
requirement_level:
recommended: >
Should be collected by default only if there is sanitization that excludes sensitive information.
- ref: db.operation
requirement_level:
conditionally_required: If `db.statement` is not applicable.
- ref: server.address
brief: >
Name of the database host.
- ref: server.port
requirement_level:
conditionally_required: If using a port other than the default port for this DBMS and if `server.address` is set.
- ref: network.peer.address
- ref: network.peer.port
requirement_level:
recommended: If `network.peer.address` is set.
- ref: network.transport
- ref: network.type
- ref: db.instance.id
requirement_level:
recommended: If different from the `server.address`
- id: db.mssql
type: span
extends: db.sql
brief: >
Attributes for Microsoft SQL Server
attributes:
- ref: db.mssql.instance_name
tag: tech-specific
- id: db.cassandra
type: span
extends: db
brief: >
Attributes for Cassandra
attributes:
- ref: db.name
tag: tech-specific
brief: >
The keyspace name in Cassandra.
examples: ["mykeyspace"]
note: For Cassandra the `db.name` should be set to the Cassandra keyspace name.
- ref: db.cassandra.page_size
tag: tech-specific
- ref: db.cassandra.consistency_level
tag: tech-specific
- ref: db.cassandra.table
tag: tech-specific
- ref: db.cassandra.idempotence
tag: tech-specific
- ref: db.cassandra.speculative_execution_count
tag: tech-specific
- ref: db.cassandra.coordinator.id
tag: tech-specific
- ref: db.cassandra.coordinator.dc
tag: tech-specific
- id: db.hbase
type: span
extends: db
brief: >
Attributes for HBase
attributes:
- ref: db.name
tag: tech-specific
brief: >
The HBase namespace.
examples: ['mynamespace']
note: For HBase the `db.name` should be set to the HBase namespace.
- id: db.couchdb
type: span
extends: db
brief: >
Attributes for CouchDB
attributes:
- ref: db.operation
tag: tech-specific
brief: >
The HTTP method + the target REST route.
examples: ['GET /{db}/{docid}']
note: >
In **CouchDB**, `db.operation` should be set to the HTTP method +
the target REST route according to the API reference documentation.
For example, when retrieving a document, `db.operation` would be set to
(literally, i.e., without replacing the placeholders with concrete values):
[`GET /{db}/{docid}`](https://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid).
- id: db.redis
type: span
extends: db
brief: >
Attributes for Redis
attributes:
- ref: db.redis.database_index
requirement_level:
conditionally_required: If other than the default database (`0`).
tag: tech-specific
- ref: db.statement
tag: tech-specific
brief: >
The full syntax of the Redis CLI command.
examples: ["HMSET myhash field1 'Hello' field2 'World'"]
note: >
For **Redis**, the value provided for `db.statement` SHOULD correspond to the syntax of the Redis CLI.
If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.statement`.
- id: db.mongodb
type: span
extends: db
brief: >
Attributes for MongoDB
attributes:
- ref: db.mongodb.collection
requirement_level: required
tag: tech-specific
- id: db.elasticsearch
type: span
extends: db
brief: >
Attributes for Elasticsearch
attributes:
- ref: http.request.method
requirement_level: required
tag: tech-specific
- ref: db.operation
requirement_level: required
brief: The endpoint identifier for the request.
examples: [ 'search', 'ml.close_job', 'cat.aliases' ]
tag: tech-specific
- ref: url.full
requirement_level: required
examples: [ 'https://localhost:9200/index/_search?q=user.id:kimchy' ]
tag: tech-specific
- ref: db.statement
requirement_level:
recommended: >
Should be collected by default for search-type queries and only if there is sanitization that excludes
sensitive information.
brief: The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string.
examples: [ '"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"' ]
tag: tech-specific
- ref: server.address
tag: tech-specific
- ref: server.port
tag: tech-specific
- ref: db.elasticsearch.cluster.name
requirement_level:
recommended: >
When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Cluster" HTTP response header.
tag: tech-specific
- ref: db.elasticsearch.node.name
requirement_level:
recommended: >
When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Instance" HTTP response header.
tag: tech-specific
- ref: db.elasticsearch.path_parts
requirement_level:
conditionally_required: when the url has dynamic values
tag: tech-specific
- id: db.sql
type: span
extends: 'db'
brief: >
Attributes for SQL databases
attributes:
- ref: db.sql.table
tag: tech-specific
- id: db.cosmosdb
type: span
extends: db
prefix: db.cosmosdb
brief: >
Attributes for Cosmos DB.
attributes:
- ref: db.cosmosdb.client_id
tag: tech-specific
- ref: db.cosmosdb.operation_type
requirement_level:
conditionally_required: when performing one of the operations in this list
tag: tech-specific
- ref: user_agent.original
brief: 'Full user-agent string is generated by Cosmos DB SDK'
note: >
The user-agent value is generated by SDK which is a combination of<br>
`sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'<br>
`direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'<br>
`number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'<br>
`type_of_machine_architecture` : Machine architecture. e.g. 'X64'<br>
`operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'<br>
`runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'<br>
`failover_information` : Generated key to determine if region failover enabled.
Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it).
Default value is "NS".
examples: ['cosmos-netstandard-sdk/3.23.0\|3.23.1\|1\|X64\|Linux 5.4.0-1098-azure 104 18\|.NET Core 3.1.32\|S\|']
tag: tech-specific
- ref: db.cosmosdb.connection_mode
requirement_level:
conditionally_required: if not `direct` (or pick gw as default)
tag: tech-specific
- ref: db.cosmosdb.container
requirement_level:
conditionally_required: if available
tag: tech-specific
- ref: db.cosmosdb.request_content_length
tag: tech-specific
- ref: db.cosmosdb.status_code
requirement_level:
conditionally_required: if response was received
tag: tech-specific
- ref: db.cosmosdb.sub_status_code
requirement_level:
conditionally_required: when response was received and contained sub-code.
tag: tech-specific
- ref: db.cosmosdb.request_charge
requirement_level:
conditionally_required: when available
tag: tech-specific