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

[metrics builder] Add ability to enable/disable resource attributes #16373

Closed
Tracked by #7301
dmitryax opened this issue Nov 19, 2022 · 4 comments
Closed
Tracked by #7301

[metrics builder] Add ability to enable/disable resource attributes #16373

dmitryax opened this issue Nov 19, 2022 · 4 comments
Labels
cmd/mdatagen mdatagen command

Comments

@dmitryax
Copy link
Member

dmitryax commented Nov 19, 2022

User should be able to enable and disable resource attributes the same way as it's currently done for metrics:

metadata.yaml interface changes for receiver authors

All resource attributes should get an additional field enabled. For now, let's keep all the existing attributes enabled by default, but receiver authors will be able to add (or turn existing) resource attributes into optional attributes. hostmetrics/processscraper example:

resource_attributes:
  process.pid:
    enabled: true
    description: Process identifier (PID).
    type: int

User config interface changes

This capability should generate additional struct for user configs that receiver authors have to include in their config the same way as done for MetricsSettings. Using the same example for process.pid resource attribute, the generated structs should look like this:

type ResourceAttributeSettings struct {
	Enabled bool `mapstructure:"enabled"`
}

type ResourceAttributesSettings struct {
	ProcessPid     ResourceAttributeSettings `mapstructure:"process.pid"`
}
@dmitryax dmitryax changed the title Add ability to enable/disable resource attributes [metrics builder] Add ability to enable/disable resource attributes Nov 19, 2022
@dmitryax dmitryax added the cmd/mdatagen mdatagen command label Nov 19, 2022
@hughesjj
Copy link
Contributor

for visibility: I hashed out most of the impl yesterday, currently debugging tests, and will probably reach out to Dmitrii for a second look @ the logic to exclude resource attrs in draft before publicizing.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Jan 30, 2023
@fatsheep9146
Copy link
Contributor

This issue is resolved, right ? @dmitryax

@dmitryax
Copy link
Member Author

Right, this PR will resolve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/mdatagen mdatagen command
Projects
None yet
Development

No branches or pull requests

3 participants