Skip to content

Crash bad char metric name #56

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

Merged
merged 3 commits into from
Jun 25, 2023
Merged

Crash bad char metric name #56

merged 3 commits into from
Jun 25, 2023

Conversation

kpetremann
Copy link
Owner

Fixes #55

Description:

Special characters in the topic is causing Prometheus exception.

Before the commit:

Crash when topic = cpu_usages_%Cpu

After the commit:

No crash anymore and cpu_usages_%Cpu is normalized to cpu_usages_Cpu.

Prometheus metric name must match the regex [a-zA-Z_:][a-zA-Z0-9_:]*
Before this commit, an invalid metric name was causing a crash.

https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels
Ensure the Prometheus metric name are respecting Prometheus convention.
prom_metric_name was only changed for _create_prometheus_metric and
not _add_prometheus_sample.
@kpetremann kpetremann merged commit 86a6dee into master Jun 25, 2023
@kpetremann kpetremann deleted the crash_bad_char_metric_name branch June 25, 2023 12:08
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.

crash loop with google coral metric
1 participant