Skip to content

Access names from mdatagen generated metrics #12459

Closed
@braydonk

Description

@braydonk

Component(s)

cmd/mdatagen

Describe the issue you're reporting

I have a use case where I'm trying to produce a configuration validation error for a receiver that intends to reference a particular metric name. In particular the scenario is if a particular technology is disabled but a particular metric that requires that subsystem is enabled, I want to produce an error like:

Metric metric.name requires subsystem to be enabled

What would be great would be to reference the name directly from the mdatagen generated package, as putting the metric name directly in the error isn't future-proof against the metric name changing.

I have no particular preference for what this API looks like, provided it allows me to access any metric or resource attribute names. If there already is a way to do this and I've missed it, I will close this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmd/mdatagenhelp wantedGood issue for contributors to OpenTelemetry Service to pick up

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions