Skip to content

[cmd/mdatagen] Declare platform exclusivity of instrumentation #15020

@braydonk

Description

@braydonk

Component(s)

No response

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

The metadata.yaml file is currently incapable of presenting whether metrics or resource attributes are supported only on a particular set of platforms. In hostmetrics receiver, we rely on an error generated per-scrape to notify users when they configure an unsupported metric. We want a way to declare this where:

  • A user can easily see within the metadata.yaml
  • The receiver can automatically benefit from the generated metadata package properly guarding against user attempts to enable metrics on unsupported platforms

Describe the solution you'd like

I would like to add a field to the metadata.yaml definitions for metrics and resource attributes called something like supported_platforms. It would be an array. If empty, it is assumed that all platforms are supported. Otherwise, if running on a platform that isn't in the list, the metric will not be enabled and a warning will be logged.

It is possible we could also include a unsupported_platforms array where the logic is inverted, and only allow one to be configured in a particular metric/resource attribute config at a time.

Describe alternatives you've considered

There is a real possibility that hostmetrics is the only component that would make any use of this feature. If that is the case, I am fine with implementing an API there. The downside is that it wouldn't be in metadata.yaml unfortunately, but it's not the end of the world if it's true that hostmetrics is the only component that would gain anything from this.

Additional context

No response

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