semconv.com

db.query.parameter

Developmenttemplate[string]as of v1.44.0

A database query parameter, with <key> being the parameter name, and the attribute value being a string representation of the parameter value.

If a query parameter has no name and instead is referenced only by index, then <key> SHOULD be the 0-based index.

db.query.parameter.<key> SHOULD match up with the parameterized placeholders present in db.query.text.

It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization or sanitization.

Instrumentations SHOULD NOT capture db.query.parameter.<key> by default since values may contain PII or sensitive details. Application operators are expected to enable specific keys depending on their privacy and security considerations.

db.query.parameter.<key> SHOULD NOT be captured on batch operations.

Examples:

- For a query SELECT * FROM users where username = %s with the parameter "jdoe", the attribute db.query.parameter.0 SHOULD be set to "jdoe".

- For a query "SELECT * FROM users WHERE username = %(userName)s; with parameter userName = "jdoe", the attribute db.query.parameter.userName SHOULD be set to "jdoe".

Examples

Used by

spans (9)

  • span.azure.cosmosdb.client (opt-in)
  • span.db.cassandra.client (opt-in)
  • span.db.client (opt-in)
  • span.db.mariadb.client (opt-in)
  • span.db.mysql.client (opt-in)
  • span.db.oracledb.client (opt-in)
  • span.db.postgresql.client (opt-in)
  • span.db.sql_server.client (opt-in)
  • span.db.sql.client (opt-in)

* required on that signal.

History

  1. v1.33.0un-deprecated

    No longer marked deprecated.

  2. v1.31.0

    Stability label respelled from experimental to development.

  3. v1.30.0

    Already present at v1.30.0, the oldest release tracked here (experimental).

Definition sourceRegistry docsJSON