semantic-conventions icon indicating copy to clipboard operation
semantic-conventions copied to clipboard

Introduce common configuration option for sanitisation of `db.statement`.

Open Mpdreamz opened this issue 2 years ago • 1 comments

What are you trying to achieve?

Standardise the configuration for the sanitisation of db.statement.

With https://github.com/open-telemetry/opentelemetry-specification/issues/3104 the default for the collection of db.statement is conditional on whether sanitisation is configured/available or not.

While I fully agree with the initiative it has a knock on effect that each LANG and INSTRUMENTATION will start using their own configuration mechanisms to enable the collection of db.statement.

This leads to a fragmented feature set and quite a large configuration burden to our users.

What did you expect to see?

A single OTEL_* environment variable that users can set and that instrumentation can pick up.

OTEL_INSTRUMENTATION_DB_STATEMENT

  • omit default value, discards or prevents the collection of db.statement
  • sanitise
    • instruct instrumentation to sanitise any captured db.statement
    • if no sanitisation mechanism exist for the specific language instrumentation will fall back to omit
  • raw collect any captured db.statement raw without any sanitisation.

Agents in specific languages could further more listen to a more restricted:

OTEL_{LANGUAGE}_INSTRUMENTATION_DB_STATEMENT environment variable that takes precedence over OTEL_INSTRUMENTATION_DB_STATEMENT

To isolate the choice further if so required.

Additional context.

  • https://github.com/open-telemetry/opentelemetry-specification/issues/3104

Mpdreamz avatar Jul 13 '23 14:07 Mpdreamz

related to #1483

trask avatar Apr 25 '25 16:04 trask