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
Changelog
v0.1.0 #106#127
v0.0.0
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",
  "changelog": [
    {
      "version": "0.1.0",
      "prs": [
        106,
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

db.namespace

string PII: Maybe OTel: True

The name of the database being accessed.

Example customers
Aliases db.name
Changelog
v0.1.0 #127
v0.0.0
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"
  ],
  "changelog": [
    {
      "version": "0.1.0",
      "prs": [
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

db.operation.name

string PII: Maybe OTel: True

The name of the operation being executed.

Example SELECT
Aliases db.operation
Changelog
v0.1.0 #127
v0.0.0
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"
  ],
  "changelog": [
    {
      "version": "0.1.0",
      "prs": [
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

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
Changelog
v0.1.0 #103#127
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'",
  "changelog": [
    {
      "version": "0.1.0",
      "prs": [
        103,
        127
      ]
    }
  ]
}

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;
Changelog
v0.4.0 #208
v0.1.0 #127
v0.0.0
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;",
  "changelog": [
    {
      "version": "0.4.0",
      "prs": [
        208
      ]
    },
    {
      "version": "0.1.0",
      "prs": [
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

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
Changelog
v0.4.0 #208
v0.1.0 #127
v0.0.0
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"
  ],
  "changelog": [
    {
      "version": "0.4.0",
      "prs": [
        208
      ]
    },
    {
      "version": "0.1.0",
      "prs": [
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

db.redis.connection

string PII: Maybe OTel: False

The redis connection name.

Example my-redis-instance
SDKs php-laravel
Changelog
v0.1.0 #127
v0.0.0
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"
  ],
  "changelog": [
    {
      "version": "0.1.0",
      "prs": [
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

db.redis.parameters

string[] PII: Maybe OTel: False

The array of command parameters given to a redis command.

Example ["test","*"]
SDKs php-laravel
Changelog
v0.0.0
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"
  ],
  "changelog": [
    {
      "version": "0.0.0"
    }
  ]
}

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
Changelog
v0.1.0 #127
v0.0.0
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"
  ],
  "changelog": [
    {
      "version": "0.1.0",
      "prs": [
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

db.user

string PII: True OTel: True

The database user.

Example fancy_user
Changelog
v0.0.0
Raw JSON
{
  "key": "db.user",
  "brief": "The database user.",
  "type": "string",
  "pii": {
    "key": "true"
  },
  "is_in_otel": true,
  "example": "fancy_user",
  "changelog": [
    {
      "version": "0.0.0"
    }
  ]
}

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.

Changelog
v0.1.0 #61#127
v0.0.0
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"
  ],
  "changelog": [
    {
      "version": "0.1.0",
      "prs": [
        61,
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

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

Changelog
v0.4.0 #199
v0.1.0 #61#127
v0.0.0
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"
  ],
  "changelog": [
    {
      "version": "0.4.0",
      "prs": [
        199
      ]
    },
    {
      "version": "0.1.0",
      "prs": [
        61,
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

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>.

Changelog
v0.1.0 #61
v0.0.0
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"
  ],
  "changelog": [
    {
      "version": "0.1.0",
      "prs": [
        61
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

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

Changelog
v0.4.0 #199
v0.1.0 #61#127
v0.0.0
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"
  ],
  "changelog": [
    {
      "version": "0.4.0",
      "prs": [
        199
      ]
    },
    {
      "version": "0.1.0",
      "prs": [
        61,
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}

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

Changelog
v0.4.0 #199#224
v0.1.0 #61#127
v0.0.0
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"
  ],
  "changelog": [
    {
      "version": "0.4.0",
      "prs": [
        199,
        224
      ]
    },
    {
      "version": "0.1.0",
      "prs": [
        61,
        127
      ]
    },
    {
      "version": "0.0.0"
    }
  ]
}