I tried the same i m not getting any data post adding below 

sum(kafka_consumergroup_lag{cluster=~"$cluster",consumergroup=~
"$consumergroup",topic=~"$topic"}) by (consumergroup, topic) / count(up{job=
"prometheus.scrape.kafka_exporter"})

On Saturday, May 25, 2024 at 11:53:44 AM UTC+5:30 Ben Kochie wrote:

> You can use the `up` metric
>
> sum(...)
> /
> count(up{job="kafka"})
>
> On Fri, May 24, 2024 at 5:53 PM Sameer Modak <sameer.m...@gmail.com> 
> wrote:
>
>> Hello Team,
>>
>> I want to know the no of instance data sending to prometheus. How do i 
>> formulate the query .
>>
>>
>> Basically i have below working query but issues is we have 6  instances 
>> hence its summing value of all instances. Instead we just need value from 
>> one instance.
>> sum(kafka_consumergroup_lag{cluster=~"$cluster",consumergroup=~
>> "$consumergroup",topic=~"$topic"})by (consumergroup, topic)
>> I was thinking to divide it / 6 but it has to be variabalise on runtime
>> if 3 exporters are running then it value/3 to get exact value.
>>
>> -- 
>> 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/fa5f309f-779f-45f9-b5a0-430b75ff0884n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/prometheus-users/fa5f309f-779f-45f9-b5a0-430b75ff0884n%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/5314cef9-9eb9-4663-9363-4152b80d9be2n%40googlegroups.com.

Reply via email to