Thanks Ittay.

Hmmm, I can only imagine two reasons:

   1. Prometheus hasn't scraped yet, so you are seeing some older values
   than if you look directly at /metrics.
   2. Prometheus scrapes another target than you are looking at. Maybe
   something with service discovery is going wrong.

Could you use the Prometheus UI on port 9090 to check that the target is as
expected, and when the last scrape to your target happened?

Fabian

On Mon, Feb 26, 2024 at 4:08 PM Ittay Dror <ittay.d...@gmail.com> wrote:

> It is literaly just 'my_total'
>
> On Monday, February 26, 2024 at 4:13:21 PM UTC+2 Fabian Stäber wrote:
>
>> Hi Ittay,
>>
>> Please post the PromQL query you are using.
>>
>> Fabian
>>
>> On Mon, Feb 26, 2024 at 3:03 PM Ittay Dror <ittay...@gmail.com> wrote:
>>
>>> I have a counter with a type label. The type can be one of 4 values.
>>> Using prom-client (15.0.0) in a node (express) app with Typescript. The
>>> code only does 'inc' in the counter. The counter is initialized only with
>>> name, help and labelNames configuration.
>>>
>>> If I fetch /metrics directly from the pod I see correct values. Say type
>>> "A" has 1, type "B" has 2, "C" 2 and "D" 1. The sum is 6
>>>
>>> But if I issue a promQL, the results are off by one. That is, the values
>>> are 0,1,1,0 respectively. The sum is 2.
>>>
>>> This happens across several counters.
>>>
>>> Using GCE for the (managed) prometheus server.
>>>
>>> There are no restarts of the pod and using 'increase' doesn't help.
>>>
>>> What is the reason and what is the approach to solve this?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Prometheus Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to prometheus-use...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/prometheus-users/0383adcd-5878-4887-9273-552874fe9f11n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/prometheus-users/0383adcd-5878-4887-9273-552874fe9f11n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to prometheus-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/8e09d780-d94a-4a8c-b7c1-8cbdd14c8af3n%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/8e09d780-d94a-4a8c-b7c1-8cbdd14c8af3n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAPX310inZgO-j8AfZLeNVNsbjSFxyHyJCX%3Dqg1kjAtdgLrLBow%40mail.gmail.com.

Reply via email to