Class DbAttributes
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final io.opentelemetry.api.common.AttributeKey<String>The name of a collection (table, container) within the database.static final io.opentelemetry.api.common.AttributeKey<String>The name of the database, fully qualified within the server address and port.static final io.opentelemetry.api.common.AttributeKey<Long>The number of queries included in a batch operation.static final io.opentelemetry.api.common.AttributeKey<String>The name of the operation or command being executed.static final io.opentelemetry.api.common.AttributeKey<String>Low cardinality summary of a database query.static final io.opentelemetry.api.common.AttributeKey<String>The database query being executed.static final io.opentelemetry.api.common.AttributeKey<String>Database response status code.static final io.opentelemetry.api.common.AttributeKey<String>The name of a stored procedure within the database.static final io.opentelemetry.api.common.AttributeKey<String>The database management system (DBMS) product as identified by the client instrumentation. -
Method Summary
-
Field Details
-
DB_COLLECTION_NAME
The name of a collection (table, container) within the database.Notes:
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, when the database system supports query text with multiple collections in non-batch operations.For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used.
-
DB_NAMESPACE
The name of the database, fully qualified within the server address and port.Notes:
If a database system has multiple namespace components, they SHOULD be concatenated from the most general to the most specific namespace component, using
|as a separator between the components. Any missing components (and their associated separators) SHOULD be omitted. Semantic conventions for individual database systems SHOULD document whatdb.namespacemeans 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. -
DB_OPERATION_BATCH_SIZE
The number of queries included in a batch operation.Notes:
Operations are only considered batches when they contain two or more operations, and so
db.operation.batch.sizeSHOULD never be1. -
DB_OPERATION_NAME
The name of the operation or command being executed.Notes:
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, when the database system supports query text with multiple operations in non-batch operations.If spaces can occur in the operation name, multiple consecutive spaces SHOULD be normalized to a single space.
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, otherwisedb.operation.nameSHOULD beBATCHor some other database system specific term if more applicable. -
DB_QUERY_SUMMARY
Low cardinality summary of a database query.Notes:
The query summary 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 section.
-
DB_QUERY_TEXT
The database query being executed.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. Parameterized query text SHOULD NOT be sanitized. 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. -
DB_RESPONSE_STATUS_CODE
Database response status code.Notes:
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_codemeans in the context of that system. -
DB_STORED_PROCEDURE_NAME
The name of a stored procedure within the database.Notes:
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
For batch operations, if the individual operations are known to have the same stored procedure name then that stored procedure name SHOULD be used.
-
DB_SYSTEM_NAME
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.nameis set topostgresqlbased on the instrumentation's best knowledge.
-