Metrics handler not falling back to gauge on text/plain negotiations #2587
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
What happened:
When a prometheus request is sent with the protobuf format, the KSM metrics handler should negotiate the content type to be text as protobuf is not supported. However, the metrics handler also responds with type
info
which is not accepted by prometheus for this content type:invalid metric type "info"
.What you expected to happen: Similar to issue #2270, one solution is to fallback to
gauge
type when negotiatingtext/plain
as well as protobuf.How to reproduce it (as minimally and precisely as possible):
Running prometheus with
--enable-feature=native-histograms
with a scrape job that defines a fallbackPrometheusText0,0,4
formatm and run KSM with anyinfo
metrics.Anything else we need to know?:
this issue seems to have been referenced here and here.
Manually tested if the
invalid metric type: info
error popped up for various prometheus request + fallback formats:There is another issue here (#2248) where v2.12 was supposed to have the fix for the issue I am seeing, but the
invalid type
error persists.Environment:
kubectl version
):client v1.28.0 + server v1.31.1-gke.2105000The text was updated successfully, but these errors were encountered: