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

Normalize counter names #42

Closed
wants to merge 1 commit into from
Closed

Conversation

gquintard
Copy link

New varnish versions allows vmods to create custom counters and it's
mandatory to normalize their names to avoid scaring the scraper.

This commit doesn't prevent collisions but there's only so much we can
do.

New varnish versions allows vmods to create custom counters and it's
mandatory to normalize their names to avoid scaring the scraper.

This commit doesn't prevent collisions but there's only so much we can
do.
@jonnenauha
Copy link
Owner

Could you give some details why you needed this change. It looks fine and I get it from the test cases, but I would just like to see real world scrape that outputs something we trip on, thanks.

@gquintard
Copy link
Author

we got hit by this in the enterprise version because one of the vmods create counters containing a #. We have since then changed the vmod to avoid the issue, but since counter can be created by any vmod (e.g. https://github.com/xcir/libvmod-xcounter), it seems smarter to protect the exporter rather than to ask the vmod writer to watch their steps

@mykhailoky1
Copy link

mykhailoky1 commented Jun 29, 2023

The example is Jun 28 08:17:32 name.84.example.net prometheus_varnish_exporter[29701]: panic: "varnish_main_accg_detailed_http_host_docker-repo_example_com_backend_304_count" is not a valid metric name

@gquintard
Copy link
Author

timing this one out

@gquintard gquintard closed this Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants