On Mon, 2 Nov 2020 at 22:39, William Entriken <[email protected]>
wrote:
> Hello everyone, I have an interesting question regarding labels. So I am
> trying to pull values with metrics specifically PVC data and pretty much
> would like to produce a label with the yielded results.
> For instance, here is my simple query argument for the PVCs within one of
> my environments looking for statefulsets that have PVCs with storage
> utilization that is 40% or higher. Specifically, is there a way to create a
> label for the value output? This is so when our alerts fire, we could
> declare a variable which produces accurate info in the alert message
> itself. Does anyone have any good ideas on this?
> Specifically I am trying to produce a {{ $labels.storage }} label, based
> on the value produced by the expression below:
>
A label would be unwise, however you can create a annotation with $value as
shown in https://www.robustperception.io/dont-put-the-value-in-alert-labels
Brian
>
> ```kubelet_volume_stats_available_bytes/kubelet_volume_stats_capacity_bytes
> < .60
>
> Element:
> {endpoint="http-metrics",instance="10.xxx.58.210:10255",job="kubelet",metrics_path="/metrics",namespace="{infra}",node="gke-xxx-xxx-xxx-001-stateful-394fxxxx-xxxx",persistentvolumeclaim="prometheus-prometheus-operator-prometheus-db-prometheus-prometheus-operator-prometheus-0",service="prometheus-operator-kubelet"}
>
>
> Value:
> 0.505853632940522```
>
> We are also utilizing good ole' Alertmanager:
> https://prometheus.io/docs/alerting/latest/alertmanager/
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/ee5d3b3e-71d3-4ef4-8220-d0d018bfe38en%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/ee5d3b3e-71d3-4ef4-8220-d0d018bfe38en%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
Brian Brazil
www.robustperception.io
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/CAHJKeLoA4myETMR5nW5j3SDbzetHQQ0BfrcT4aZQzwXVxxPy-g%40mail.gmail.com.