How can i get the label values in prometheus

117 views
Skip to first unread message

anton...@gmail.com

unread,
Mar 20, 2018, 5:08:20 AM3/20/18
to Prometheus Users
Hi

   i have an instance like:"probe_success{circuit_bw="10000000"instance="www.google.com",task="sw_snmp"}",now i want  to retrieve the circuit_bw to  calculate the bandwidth,is there anyway to achieve the function?
   I know that i can get the value in grafana through label_value, but what i want is get the value in prometheus instead of in grafana
Message has been deleted

Ben Kochie

unread,
Mar 23, 2018, 6:54:07 PM3/23/18
to rlbol...@gmail.com, Prometheus Users
You are correct, label values are not designed to be used for actual timeseries values.

On Thu, Mar 22, 2018 at 8:44 PM, <rlbol...@gmail.com> wrote:
Someone with more extensive knowledge might know differently, but in the absence of that, I would say that what you're proposing isn't how labels are meant to be used. 

A label is exactly was its name implies. It's a string. You can parse them with regex, manipulate them in simple ways, etc, but not "calculate" against them. 

Certainly you can (and should) order or filter by them though, but the value of the metric itself is what you should generally be after. 

If you can explain what you are trying to capture/track/monitor, maybe someone would be willing to suggest some alternatives, barring nobody proposing a way to calculate against a label's 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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/ae64dbd2-6adc-4870-9ca4-27754fccab7e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages