open-telemetry / opentelemetry-java-instrumentation

OpenTelemetry auto-instrumentation and instrumentation libraries for Java
https://opentelemetry.io
Apache License 2.0
1.99k stars 869 forks source link

how to disable the truncated of the db.statement #10616

Closed lichenglin closed 8 months ago

lichenglin commented 9 months ago

Is your feature request related to a problem? Please describe.

we found when there is a long sql. otel will truncate the sql. is there any way to disable it?

Describe the solution you'd like

no truncate. keep the orginal sql.

Describe alternatives you've considered

No response

Additional context

No response

laurit commented 9 months ago

Although it is possible to limit the max length of an attribute https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure#attribute-limits by default this is not done. What is the size where the db statement is truncated? Are you sure that it is the agent that truncates not your backend or something else?

laurit commented 9 months ago

Could be https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/ddd780ad413932545861bab617e11329b148e424/instrumentation-api-incubator/src/main/jflex/SqlSanitizer.jflex#L53 You can verify whether it this by disabling the sanitizer https://opentelemetry.io/docs/languages/java/automatic/configuration/#db-statement-sanitization

github-actions[bot] commented 9 months ago

This has been automatically marked as stale because it has been marked as needing author feedback and has not had any activity for 7 days. It will be closed automatically if there is no response from the author within 7 additional days from this comment.