Skip to content

opentelemetry-instrumentation-system-metrics: Configuration by EnvVar #3954

@sfozz

Description

@sfozz

What problem do you want to solve?

Currently when using the system-metrics instrumentation via auto-instrumentation it is not possible to specify the configuration via an alternative mechanism (e.g. an EnvVar).

When running workloads in a orchestrated environment generally there are classes of metrics that are collected at the orchestration level. An example of this would be cpu and memory metrics in a kubernetes environment, where there are opentelemetry-collectors running each of the nodes.

Describe the solution you'd like

A EnvVar that permits excluding metrics using a glob based pattern.

For example:

OTEL_PYTHON_SYSTEM_METRICS_EXCLUDED_METRICS=system.*

This would exclude the collection of all of the metrics that start in the system namespace.

Describe alternatives you've considered

In a slack thread there was a suggestion that custom distribution could be created that check for the loading of the systems-metrics instrumentation and then injecting a custom config dict.

https://cloud-native.slack.com/archives/C01PD4HUVBL/p1763433132238179

Additional Context

No response

Would you like to implement a fix?

None

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions