Those mangled screenshots are no use. What I would need to see are the actual results of the two queries, from the Prometheus web interface (not Grafana), in plain text: e.g.
foo{bar="baz",qux="abc"} 42.0 ...with the *complete* set of labels, not expurgated. That's what's needed to formulate the join query. On Tuesday 28 May 2024 at 13:23:21 UTC+1 Sameer Modak wrote: > Hello Brian, > > Actually tried as you suggested earlier but when i execute it says no data > . So below are the individual query ss , so if i ran individually they give > the output > > On Sunday, May 26, 2024 at 1:24:10 PM UTC+5:30 Brian Candler wrote: > >> The labels for the two sides of the division need to match exactly. >> >> If they match 1:1 except for additional labels, then you can use >> xxx / on (foo,bar) yyy # foo,bar are the matching labels >> or >> xxx / ignoring (baz,qux) zzz # baz,qux are the labels to ignore >> >> If they match N:1 then you need to use group_left or group_right. >> >> If you show the results of the two halves of the query separately then we >> can be more specific. That is: >> >> sum(kafka_consumergroup_lag{cluster=~"$cluster",consumergroup=~"$consumergroup",topic=~"$topic"}) >> >> by (consumergroup, topic) >> >> count(up{job="prometheus.scrape.kafka_exporter"}) >> >> On Sunday 26 May 2024 at 08:28:10 UTC+1 Sameer Modak wrote: >> >>> 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/9633348b-5d27-409e-b28f-e1e32e8af6b0n%40googlegroups.com.