-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Unable to scrape Kube-State-Metrics 2.8.0 when using Native Histograms Feature #12121
Comments
I'm unsure whether this is a Kube-state-metrics issue or a Prometheus issue, but as it works when the experimental prometheus feature was disabled it made me think the issue lay within Prometheus. If that's not the case I can open an issue on the kube-state-metrics github instead. There was a change to the openmetrics format in this release kubernetes/kube-state-metrics#1974 which could be related? Seems others have seen this behaviour too prometheus-community/helm-charts#3050. |
It seems enabling the Native Histograms turns on the Protobuf negotiation for each scrape. c.scrape.EnableProtobufNegotiation = true Which changes the accept header to the header with protobuf https://github.com/prometheus/prometheus/blob/v2.42.0/scrape/scrape.go#L440 if sp.enableProtobufNegotiation {
acceptHeader = scrapeAcceptHeaderWithProtobuf
} so that would explain why it only seems to be effected when native histograms are enabled. |
FYI I've been looking into this on the KSM side and have opened an issue kubernetes/kube-state-metrics#2022 |
fixed in kube-state-metrics kubernetes/kube-state-metrics#2024 |
What did you do?
Upgraded Kube-State Metrics to 2.8.0, enabled native-histogram feature flag on Prometheus
--enable-feature=native-histograms
.What did you expect to see?
Successful scraping of the kube-state-metrics endpoint
What did you see instead? Under which circumstances?
An error of
proto: wrong wireType = 0 for field Metric
when attempting to scrape the kube-state-metrics pod.If native-histograms are disabled this error does not appear and it scrapes correctly as expected.
System information
No response
Prometheus version
Prometheus configuration file
No response
Alertmanager version
No response
Alertmanager configuration file
No response
Logs
No response
The text was updated successfully, but these errors were encountered: