open-telemetry / opentelemetry-java-instrumentation

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

Option to omit process.command_args from resource attributes because of large length #9893

Closed swar8080 closed 11 months ago

swar8080 commented 11 months ago

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

Hello, the process.command_args values can be long in length for the applications i'm working with. Including the value in every span seems wasteful and the information isn't really useful

Describe the solution you'd like

Ability to configure that process.command_args is excluded from resource attributes, or maybe more generally a list of resource attributes to omit

Describe alternatives you've considered

We could drop the attribute in the collector but it'd be nice to save on bandwidth and collector memory-usage

Additional context

No response

laurit commented 11 months ago

You can disable it with -Dotel.java.disabled.resource.providers=io.opentelemetry.instrumentation.resources.ProcessResourceProvider, see https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#disabling-automatic-resourceproviders This will also disable a few other resource attributes besides process.command_line, if you wish to remove only process.command_line you can do it with an agent extension.