Code Monkey home page Code Monkey logo

Comments (3)

DirectXMan12 avatar DirectXMan12 commented on August 10, 2024

You'll have to provide more information. What object are you fetching the metric on? I'd guess, however, that the value is being aggregated over other labels. Can you post the full set of labels on the series? If you query prometheus for sum(your_metric_name{the_type="some-name"}) by (the_type), what gets returned?

from prometheus-adapter.

hongshibao avatar hongshibao commented on August 10, 2024

I have found the root cause. In my application, I created serval pods and services. Each pod had a metric called worker_queue_length_percentage. And there could be serval services that selected a same pod. For each service I also created a corresponding service monitor. So in prometheus there were serval records for a pod, with each service having one record. And it seemed that k8s-prometheus-adapter would sum them up for the metric of one pod.

After finding the root cause, I have fixed this issue.

from prometheus-adapter.

DirectXMan12 avatar DirectXMan12 commented on August 10, 2024

yep, that would do it. As discussed in the documentation, the adapter sums over all labels besides the requested resource's label: https://github.com/DirectXMan12/k8s-prometheus-adapter/blob/master/docs/format.md#L38-L40

from prometheus-adapter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.