Db Attributes

15 attributes in this category. 10 stable · 5 deprecated

Stable Attributes

db.collection.name

string PII: Maybe OTel: True

The name of a collection (table, container) within the database.

Example users
Raw JSON
{
  "key": "db.collection.name",
  "brief": "The name of a collection (table, container) within the database.",
  "type": "string",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": true,
  "example": "users"
}

db.namespace

string PII: Maybe OTel: True

The name of the database being accessed.

Example customers
Aliases db.name
Raw JSON
{
  "key": "db.namespace",
  "brief": "The name of the database being accessed.",
  "type": "string",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": true,
  "example": "customers",
  "alias": [
    "db.name"
  ]
}

db.operation.name

string PII: Maybe OTel: True

The name of the operation being executed.

Example SELECT
Aliases db.operation
Raw JSON
{
  "key": "db.operation.name",
  "brief": "The name of the operation being executed.",
  "type": "string",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": true,
  "example": "SELECT",
  "alias": [
    "db.operation"
  ]
}

db.query.parameter.<key>

string PII: Maybe OTel: True Dynamic

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.

Example db.query.parameter.foo='123'
Dynamic Suffix Yes - the key contains dynamic parts
Raw JSON
{
  "key": "db.query.parameter.<key>",
  "brief": "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.",
  "has_dynamic_suffix": true,
  "type": "string",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": true,
  "example": "db.query.parameter.foo='123'"
}

db.query.summary

string PII: Maybe OTel: True

A shortened representation of operation(s) in the full query. This attribute must be low-cardinality and should only contain the operation table names.

Example SELECT users;
Raw JSON
{
  "key": "db.query.summary",
  "brief": "A shortened representation of operation(s) in the full query. This attribute must be low-cardinality and should only contain the operation table names.",
  "type": "string",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": true,
  "example": "SELECT users;"
}

db.query.text

string PII: Maybe OTel: True

The database parameterized query being executed. Any parameter values (filters, insertion values, etc) should be replaced with parameter placeholders. If applicable, use `db.query.parameter.<key>` to add the parameter value.

Example SELECT * FROM users WHERE id = $1
Aliases db.statement
Raw JSON
{
  "key": "db.query.text",
  "brief": "The database parameterized query being executed. Any parameter values (filters, insertion values, etc) should be replaced with parameter placeholders. If applicable, use `db.query.parameter.<key>` to add the parameter value.",
  "type": "string",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": true,
  "example": "SELECT * FROM users WHERE id = $1",
  "alias": [
    "db.statement"
  ]
}

db.redis.connection

string PII: Maybe OTel: False

The redis connection name.

Example my-redis-instance
SDKs php-laravel
Raw JSON
{
  "key": "db.redis.connection",
  "brief": "The redis connection name.",
  "type": "string",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": false,
  "example": "my-redis-instance",
  "sdks": [
    "php-laravel"
  ]
}

db.redis.parameters

string[] PII: Maybe OTel: False

The array of command parameters given to a redis command.

Example ["test","*"]
SDKs php-laravel
Raw JSON
{
  "key": "db.redis.parameters",
  "brief": "The array of command parameters given to a redis command.",
  "type": "string[]",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": false,
  "example": [
    "test",
    "*"
  ],
  "sdks": [
    "php-laravel"
  ]
}

db.system.name

string PII: Maybe OTel: True

An identifier for the database management system (DBMS) product being used. See [OpenTelemetry docs](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-spans.md#notes-and-well-known-identifiers-for-dbsystem) for a list of well-known identifiers.

Example postgresql
Aliases db.system
Raw JSON
{
  "key": "db.system.name",
  "brief": "An identifier for the database management system (DBMS) product being used. See [OpenTelemetry docs](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-spans.md#notes-and-well-known-identifiers-for-dbsystem) for a list of well-known identifiers.",
  "type": "string",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": true,
  "example": "postgresql",
  "alias": [
    "db.system"
  ]
}

db.user

string PII: True OTel: True

The database user.

Example fancy_user
Raw JSON
{
  "key": "db.user",
  "brief": "The database user.",
  "type": "string",
  "pii": {
    "key": "true"
  },
  "is_in_otel": true,
  "example": "fancy_user"
}

Deprecated Attributes

These attributes are deprecated and should not be used in new code. See each attribute for migration guidance.

db.name Deprecated

string PII: Maybe OTel: True

The name of the database being accessed.

Example customers
Aliases db.namespace

Use db.namespace instead.

Raw JSON
{
  "key": "db.name",
  "brief": "The name of the database being accessed.",
  "type": "string",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": true,
  "example": "customers",
  "deprecation": {
    "replacement": "db.namespace",
    "_status": null
  },
  "alias": [
    "db.namespace"
  ]
}

db.operation Deprecated

string PII: Maybe OTel: True

The name of the operation being executed.

Example SELECT
Aliases db.operation.name

Use db.operation.name instead.

Status: normalize

Raw JSON
{
  "key": "db.operation",
  "brief": "The name of the operation being executed.",
  "type": "string",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": true,
  "example": "SELECT",
  "deprecation": {
    "replacement": "db.operation.name",
    "_status": "normalize"
  },
  "alias": [
    "db.operation.name"
  ]
}

db.sql.bindings Deprecated

string[] PII: Maybe OTel: False

The array of query bindings.

Example ["1","foo"]
SDKs php-laravel

Use db.query.parameter.<key> instead.

Instead of adding every binding in the db.sql.bindings attribute, add them as individual entires with db.query.parameter.<key>.

Raw JSON
{
  "key": "db.sql.bindings",
  "brief": "The array of query bindings.",
  "type": "string[]",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": false,
  "example": [
    "1",
    "foo"
  ],
  "deprecation": {
    "replacement": "db.query.parameter.<key>",
    "reason": "Instead of adding every binding in the db.sql.bindings attribute, add them as individual entires with db.query.parameter.<key>.",
    "_status": null
  },
  "sdks": [
    "php-laravel"
  ]
}

db.statement Deprecated

string PII: Maybe OTel: True

The database statement being executed.

Example SELECT * FROM users
Aliases db.query.text

Use db.query.text instead.

Status: normalize

Raw JSON
{
  "key": "db.statement",
  "brief": "The database statement being executed.",
  "type": "string",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": true,
  "example": "SELECT * FROM users",
  "deprecation": {
    "replacement": "db.query.text",
    "_status": "normalize"
  },
  "alias": [
    "db.query.text"
  ]
}

db.system Deprecated

string PII: Maybe OTel: True

An identifier for the database management system (DBMS) product being used. See [OpenTelemetry docs](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-spans.md#notes-and-well-known-identifiers-for-dbsystem) for a list of well-known identifiers.

Example postgresql
Aliases db.system.name

Use db.system.name instead.

Status: backfill

Raw JSON
{
  "key": "db.system",
  "brief": "An identifier for the database management system (DBMS) product being used. See [OpenTelemetry docs](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-spans.md#notes-and-well-known-identifiers-for-dbsystem) for a list of well-known identifiers.",
  "type": "string",
  "pii": {
    "key": "maybe"
  },
  "is_in_otel": true,
  "example": "postgresql",
  "deprecation": {
    "replacement": "db.system.name",
    "_status": "backfill"
  },
  "alias": [
    "db.system.name"
  ]
}