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

Metrics handler not falling back to gauge on text/plain negotiations #2587

Open
zellaa opened this issue Jan 7, 2025 · 1 comment
Open
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.

Comments

@zellaa
Copy link

zellaa commented Jan 7, 2025

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 negotiating text/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 fallback PrometheusText0,0,4 formatm and run KSM with any info 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:

Prometheus requested format(s) Fallback format Result
OpenMetrics0.0.1, OpenMetrics1.0.0 PrometheusText0.0.4 OK
OpenMetrics0.0.1, OpenMetrics1.0.0 N/A OK
PrometheusProto PrometheusText0.0.4 Fail
PrometheusProto OpenMetrics1.0.0 Fail
PrometheusProto OpenMetrics0.0.1 Fail
PrometheusText1.0.0 PrometheusText0.0.4 Fail

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:

  • kube-state-metrics version: 2.14
  • Kubernetes version (use kubectl version):client v1.28.0 + server v1.31.1-gke.2105000
  • Cloud provider or hardware configuration:
  • Other info: Prometheus version 3.0
@zellaa zellaa added the kind/bug Categorizes issue or PR as related to a bug. label Jan 7, 2025
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 7, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

2 participants