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

Customize resource attributes reported by Prometheus. #35825

Open
h0cheung opened this issue Oct 16, 2024 · 2 comments
Open

Customize resource attributes reported by Prometheus. #35825

h0cheung opened this issue Oct 16, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request receiver/prometheus Prometheus receiver

Comments

@h0cheung
Copy link
Contributor

h0cheung commented Oct 16, 2024

Component(s)

receiver/prometheus

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

As for now, the Prometheus receiver will add as many resource attributes as possible.

It causes some problems:

Describe the solution you'd like

Add a configuration to set which resource attributes should be put.
Consider use a small set of attributes by default. And k8s.container.name should be disabled by default as the source of it is not reliable.

Describe alternatives you've considered

transform processor has ability to drop unwanted attributes. But it's not as convenient and sufficient as directly configuring the Prometheus receiver.

Additional context

No response

@h0cheung h0cheung added enhancement New feature or request needs triage New item requiring triage labels Oct 16, 2024
@github-actions github-actions bot added the receiver/prometheus Prometheus receiver label Oct 16, 2024
Copy link
Contributor

Pinging code owners:

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

@dashpole
Copy link
Contributor

Some resource attributes often get wrong value.

The issue you linked to sounds like a bug. I think fixing the bug is probably the appropriate way forward, rather than adding config to work around the issue.

I don't think we can change the default without breaking existing users, and we shouldn't do that without good reason.

11 resource attributes seems fairly average by OTel standards. Out of curiosity, which resource attributes that we currently collect would you drop? Just server.address and server.port, or others too?

As for now, the Prometheus receiver will add as many resource attributes as possible.

The main use-case I could see for the kind of config you are proposing is that we could allow users to add even more resource attributes if they were opt-in. For example, we could add pod labels or annotations.

@atoulme atoulme removed the needs triage New item requiring triage label Oct 16, 2024
@dashpole dashpole self-assigned this Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request receiver/prometheus Prometheus receiver
Projects
None yet
Development

No branches or pull requests

3 participants