Skip to content

[cmd/mdatagen] telemetry::metrics::my_metric::enabled has no effect #13468

@jade-guiton-dd

Description

@jade-guiton-dd

Describe the bug

As far as I can tell, the enabled flag for the internal metrics of a component (example in samplereceiver) has no functional effect. The metric will still be emitted by the Collector.

Steps to reproduce

  • Change the enabled flag in the link above to false. (This flag is for the internal metric of the samplereceiver.)
  • Re-run mdatagen and compare the generated files.

What did you expect to see?
I would expect some change in /cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go with the effect of preventing the batch_size_trigger_send metric from being emitted.

What did you see instead?
The only change is that the metric is no longer listed in documentation.md.

Proposed solution
Removing the enabled flag entirely. This would avoid misleading component authors into thinking their metric is disabled.

This may be related to #11754.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions