Skip to content

promhttp handlers panic with "metric partitioned with non-supported labels" when providing a ConstLabel #299

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

Closed
bracki opened this issue May 9, 2017 · 2 comments
Assignees
Labels

Comments

@bracki
Copy link

bracki commented May 9, 2017

The example for the promhttp handlers mention adding a ConstLabel {"handler": "some_handler"}.
When you do this, checkLabels will panic. I think it would make sense to not look at the ConstLabel when checking for labels. Otherwise you have to encode the handler name into the metric names to get sensible metrics for your handlers.

@beorn7 beorn7 self-assigned this May 9, 2017
@beorn7
Copy link
Member

beorn7 commented May 9, 2017

Oops, yeah, our hacky check for labels doesn't handle the recommended ConstLabels properly.

Will have to improve...

@beorn7 beorn7 added the bug label May 9, 2017
beorn7 pushed a commit that referenced this issue May 10, 2017
- Use local registry to avoid conflicts between tests.
- Expose #299 by
  using ConstLabels in a test.
- Improve example: Buckets and help string must be consistent, even
  if the former is not enforced as of now, but see
  #222
@beorn7
Copy link
Member

beorn7 commented May 11, 2017

It should now work as expected.

Cori1109 added a commit to Cori1109/client_golang that referenced this issue Jan 9, 2023
- Use local registry to avoid conflicts between tests.
- Expose prometheus/client_golang#299 by
  using ConstLabels in a test.
- Improve example: Buckets and help string must be consistent, even
  if the former is not enforced as of now, but see
  prometheus/client_golang#222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants