-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Bug: empty exemplar labels results in invalid metrics format #1333
Comments
Hi @pcarranza , I have a issue, need your help. when I use prometheus exemplar to expose traceid, I use many demo that include your demo. But I can't get any exemplar metrics when I use Curl http://locahost:8000/metrics. Do you Known How to fix this problem? I use Golang 1.20 and go.mod same to you ` require github.com/prometheus/client_golang v1.16.0 require ( |
I found my fault!!!
|
another question: Prometheus how to scrape The target that can expose Exemplars data。
|
Fixed,Prometheus Add default header when scrape target |
Will fix prometheus/client_golang#1333 Signed-off-by: Owen Smith <owen.rl.smith@gmail.com>
I ran into the same issue; I've got a PR to the |
#569) Will fix prometheus/client_golang#1333 Signed-off-by: Owen Smith <owen.rl.smith@gmail.com>
github.com/prometheus/client_golang v1.16.0
Hi 👋
I am using the latest golang client to expose metrics using exemplars, and I have encountered a case in which the client tolerates providing an empty labels map when observing with exemplars.
This results in prometheus failing to scrape because the metrics format is invalid.
A code sample that generates an invalid metric would look like this:
On scrape I get an error on the target:
expected timestamp or # symbol, got "INVALID"
which hasn't improved a lot upgrading prometheus to the latest (2.46.0) as it only adds the metric name where it's failing.Upon further testing scraping with curl (
curl -H 'Accept: application/openmetrics-text' localhost:8000
), I cornered the problem to it being that ObserveWithExemplar tolerates receiving an emptyprometheus.Labels{}
which in turn fails to render, examples:Failed scrape (mind the double space after
#
):or when there is a label, successful scrape:
I think that either ObserveWithExemplar should blow up when there's an empty label, or this should be ignored silently.
BTW, Go mod looks like this:
The text was updated successfully, but these errors were encountered: