CtrlK
BlogDocsLog inGet started
Tessl Logo

dash0/agent-skills

Expert guidance for configuring and deploying the OpenTelemetry Collector. Use when setting up a Collector pipeline, configuring receivers, exporters, or processors, deploying a Collector to Kubernetes or Docker, or forwarding telemetry to Dash0. Triggers on requests involving collector, pipeline, OTLP receiver, exporter, or Dash0 collector setup.

79

Quality

99%

Does it follow best practices?

Impact

No eval scenarios have been run

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

capture-database-query-parameters.mdskills/otel-instrumentation/rules/

title:
Capturing database query parameters
impact:
HIGH
tags:
database, prepared-statements, db-query-parameter, sensitive-data

Capturing database query parameters

Prepared-statement parameter values are not captured by default in any OpenTelemetry SDK because they frequently carry sensitive data. When the values are useful for debugging (e.g., reproducing a failing query, correlating slow queries with specific inputs), enable capture explicitly and, in most cases, only outside production.

The OpenTelemetry semantic convention is db.query.parameter.<key> — one attribute per parameter, keyed by 0-based index or the parameter's declared name. Python is the exception: it emits a single non-standard db.statement.parameters attribute. See the Python SDK rule for the normalisation pattern.

Before enabling

Apply this checklist before turning capture on, regardless of language:

  1. Confirm none of the parameter values are in the never-instrument list. Credentials, full PAN/CVV, government IDs, health records, and biometric data must not be captured under any circumstance.
  2. Decide the scope. Prefer enabling capture only in non-production environments, or restrict it to a subset of services that handle non-sensitive data.
  3. Plan defence-in-depth redaction in the Collector. Even with type whitelists, parameter values may carry PII. Configure a transform processor to redact or drop db.query.parameter.* for sensitive datasets — see otel-ottl skill.
  4. Be aware of side-effects on query sanitization. In Java, enabling capture disables the SQL statement sanitizer — literal values that were previously masked in db.query.text will be emitted verbatim.

Per-language activation

The activation mechanism, attribute key shape, and the set of instrumentation libraries that support capture differ by language. Follow the SDK-specific rule for the language in use:

LanguageActivationStandard db.query.parameter.<key>?SDK rule
Java (JDBC)env varyes (0-based index)java
Scala (JDBC)Java agent env varyes (0-based index)scala
.NET SqlClientenv varyes (name or index)dotnet
.NET EFCoreenv varyes (EFCore-generated name)dotnet
.NET Npgsql directhand-coded enrichment callbackup to the developerdotnet
Python (psycopg/asyncpg/tortoise)instrumentor kwargno — emits db.statement.parameterspython
Node.js (pg, mysql2, …)hand-coded requestHookup to the developernodejs
Go (otelsql)hand-coded WithAttributesGetterup to the developergo
Go (pgx direct)otelpgx.WithIncludeQueryParameters()no — library-specific shapego
Ruby (pg, mysql2, ActiveRecord)not supportedn/aruby
PHP (PDO)not supportedn/aphp

At-a-glance comparison

Java/Scala (JDBC).NET SqlClient.NET EFCore.NET Npgsql directPythonNode.jsGo (otelsql)Go (pgx + otelpgx)RubyPHP
Toggleenv varenv varenv varhand-coded callbackkwarghand-coded hookhand-coded hooklibrary optionnot supportednot supported
Defaultoffoffoffn/aoffn/an/aoffn/an/a
Standard key (db.query.parameter.<key>)yesyesyesup to the developerno (db.statement.parameters)up to the developerup to the developerno (library shape)n/an/a
Key form0-based indexname or indexEFCore-generated nameup to the developersingle tuple-stringup to the developername or indexlibrary-definedn/an/a
Type whitelistyesnonoup to the developernoup to the developerup to the developerlibrary-definedn/an/a
Excluded scenariosbatchesn/an/a
Sanitizer side-effectforces sanitizer offindependentindependentindependent

References

  • Semantic Conventions: Database Spans
  • Attribute Registry: db.query.parameter
  • Sensitive data rule — what must never be captured, and Collector-side redaction patterns

skills

README.md

tile.json