-
Notifications
You must be signed in to change notification settings - Fork 296
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
Telegraf unable to scrape localhost:8080/metrics/ endpoint with error 406 Not Acceptable #4512
Comments
Surprised you're getting a 406 error with v1.7.0 - I'm seeing a 500 error with the same error in the engine's logs as shown in #4455 |
Hi there @danlsgiga, this is to be expected. The oncall backend is a REST API ( From the logs you shared, it seems like Telegraf is asking for protobuf, which our backend does not support. I'm not familiar with Telegraf, but maybe there is a way to configure it to work with JSON? |
Hey @joeyorlando, thanks for taking a look at this. The header defined by Telegraf, also includes $ curl -I -H "Accept: text/plain" http://localhost:8080/metrics/
HTTP/1.1 406 Not Acceptable
Content-Type: application/json
Allow: GET, HEAD, OPTIONS
X-Frame-Options: DENY
Content-Length: 57
Vary: Origin
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Cross-Origin-Opener-Policy: same-origin $ curl -I -H "Accept: text/plain,application/json" http://localhost:8080/metrics/
HTTP/1.1 200 OK
Content-Type: text/plain; version=0.0.4; charset=utf-8
Allow: GET, HEAD, OPTIONS
X-Frame-Options: DENY
Content-Length: 24027
Vary: Origin
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Cross-Origin-Opener-Policy: same-origin
If |
you are right, my apologies. I'll go ahead and re-open this 👍 |
I found a workaround for now. By setting |
What went wrong?
What happened:
In Telegraf, this line defines a constant value for the
Accept
header value used by Telegraf's HTTP client. If I do acurl -H "Accept: application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=delimited;q=0.7,text/plain;version=0.0.4;q=0.3" http://localhost:8080/metrics/
I get a406 Not Acceptable
error as well from the Oncall HTTP Server, which is the same error I'm seeing in Telegraf's logs as below:telegraf[10438]: 2024-06-11T20:14:00Z E! [inputs.prometheus] Error in plugin: "http://localhost:8080/metrics/" returned HTTP status "406 Not Acceptable"
And this is the corresponding log from the Oncall HTTP server:
If I do a
curl http://localhost:8080/metrics/
the request succeeds and I can see the oncall related metrics in the response.What did you expect to happen:
Telegraf to be able to scrape the
http://localhost:8080/metrics/
endpoint successfully.How do we reproduce it?
docker-compose.yml
stack with theFEATURE_PROMETHEUS_EXPORTER_ENABLED
set totrue
406 Not Acceptable
Grafana OnCall Version
Tested with v1.4.4 and v1.7.0
Product Area
Other
Grafana OnCall Platform?
Docker
User's Browser?
No response
Anything else to add?
No response
The text was updated successfully, but these errors were encountered: