Skip to content

-Dotel.instrumentation.common.db-statement-sanitizer.enabled=false is not taking effect #12424

@bran1501

Description

@bran1501

Describe the bug

When instrumenting using the opentelemetry-java-instrumentation SDK version 1.39.0
I disable otel.instrumentation.common.db-statement-sanitizer.enabled and the content still shows up with the '?'.
I am getting these tags
db.connection_string
sqlserver://xxxxx1433

db.statement
{ call xxxxxx}

otel.library.name
io.opentelemetry.jdbc

otel.library.version
2.5.0-alpha

I confirmed this is working by enabling debug and saw in the logs:
[otel.javaagent 2024-10-04 22:00:00:739 +0000] [supportability_metrics_reporter] DEBUG io.opentelemetry.javaagent.shaded.instrumentation.api.internal.SupportabilityMetrics - Counter 'SqlStatementSanitizer cache miss' : 1

This is a trace example:
masked_trace.json

Steps to reproduce

Instrument a Java application making calls to a Microsoft sql server.
Instrument Java and include to the JAVA_OPTS =-Dotel.instrumentation.common.db-statement-sanitizer.enabled=false

Expected behavior

It should disable the sanitizer

Actual behavior

It's not disabling the sanitizer

Javaagent or library instrumentation version

1.39.0

Environment

JDK:telemetry.sdk.version: 1.39.0
OS: Windows Server 2019 10.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions