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

[Prometheus] Label name with StringAsLabel flag can contain : and result in error while sending the metrics because prometheus won't accept this. #6757

Closed
lahsivjar opened this issue Dec 5, 2019 · 0 comments · Fixed by #6781
Assignees
Labels
area/prometheus bug unexpected problem or unintended behavior
Milestone

Comments

@lahsivjar
Copy link

lahsivjar commented Dec 5, 2019

Relevant telegraf.conf:

System info:

Telegraf version: 1.10.5

Steps to reproduce:

  1. Enable StringAsLabel flag and configure Prometheus client
  2. Send metrics which has no numeric field and contains a colon (example: a:b)

Expected behavior:

Metrics are sent without any errors

Actual behavior:

Error happens and metrics are not sent

Additional info:

The issue is that the regex check, as per the data model of Prometheus a label must contain only alphanumeric and underscore but the regex used is ^[a-zA-Z_][a-zA-Z0-9_]*

The above regex returns true for a_b:c because it matches it till b however, this label name is not acceptable by Prometheus.

@danielnelson danielnelson added area/prometheus bug unexpected problem or unintended behavior labels Dec 10, 2019
@danielnelson danielnelson self-assigned this Dec 10, 2019
@danielnelson danielnelson added this to the 1.13.0 milestone Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/prometheus bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants