Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling by data type (metrics, logs, traces) #11057

Closed
jefchien opened this issue Apr 8, 2024 · 6 comments
Closed

Allow disabling by data type (metrics, logs, traces) #11057

jefchien opened this issue Apr 8, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@jefchien
Copy link

jefchien commented Apr 8, 2024

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

Similar to #9481

The Java Agent allows suppressing specific library instrumentation using environment variables or system properties as is very well documented here:
https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/#suppressing-specific-agent-instrumentation

Currently, you can either disable each individual exporter or disable the auto-instrumentation as a whole (otel.instrumentation.common.default.enabled=false). This means it doesn't support the use case of wanting auto-instrumentation for one data type, but more granular control for another.

In my use case, I'm trying to retain auto-instrumentation for traces, but only enable one instrumentation (jmx) for metrics. With the current setup, if I enable the metrics exporter, I get a ton of extra metrics that will need to be filtered out by the collector.

Describe the solution you'd like

Add a feature flag that allows users to disable by data type.

Describe alternatives you've considered

Only alternative would be something similar to a Sampler for the metrics. Does that exist? Could metrics be filtered by instrumentation scope?

Additional context

No response

@jefchien jefchien added enhancement New feature or request needs triage New issue that requires triage labels Apr 8, 2024
@trask
Copy link
Member

trask commented Apr 10, 2024

Only alternative would be something similar to a Sampler for the metrics. Does that exist? Could metrics be filtered by instrumentation scope?

Yes! Check out metric views: https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/incubator#view-file-configuration

@steverao steverao added needs author feedback Waiting for additional feedback from the author and removed needs triage New issue that requires triage labels Apr 17, 2024
@bcarter97
Copy link
Contributor

I am trying to disable tracing from one framework but keep the metrics enabled. would this be possible through the metric view? Or would I need a custom Sampler as suggested here? I was hoping there'd be some configuration-based option, e.g. OTEL_INSTRUMENTATION_<FRAMEWORK>_TRACING_ENABLED: 'false'

Copy link
Contributor

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.

@github-actions github-actions bot added the stale label Apr 27, 2024
@trask
Copy link
Member

trask commented May 1, 2024

Hi @bcarter97! Can you open a separate issue for your question / use case since it's different from the one on this issue?

Copy link
Contributor

github-actions bot commented May 8, 2024

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.

@github-actions github-actions bot added the stale label May 8, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2024
@jefchien
Copy link
Author

jefchien commented Jun 17, 2024

In case anyone else is trying to do this, the metric view worked. Followed the discussion from #10284 and ended up with

- selector:
    meter_name: io.opentelemetry.jmx
  view:
    aggregation: default
- selector:
    instrument_name: "*"
  view:
    aggregation: drop

which drops all metrics except for those produced by the JMX Metric Insight instrumentation. Thanks @trask!

@github-actions github-actions bot removed needs author feedback Waiting for additional feedback from the author stale labels Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants