Got it, thanks man. Already thought on this also, will try that. Best Regards!
On Wednesday, October 21, 2020 at 10:38:09 AM UTC-3 Brian Brazil wrote: > On Wed, 21 Oct 2020 at 14:32, Jhanssen Fávaro <[email protected]> > wrote: > >> >> Hi folks, >> I am brand new in prometheus world, and I have an understanding/basic >> question: >> >> Why from a rule file I can not retrieve the {{ $labels.instance }} >> variable ? >> > > There is no instance label, as you aggregated it away with the sum(). If > you want to have that label available you would mention it in the by > clause, or use without and mention only the labels you wanted to remove. > > Brian > > >> >> Sample Kafka Alert: >> - alert: Under_Replicated_Partition_Count >> expr: sum(kafka_server_replicamanager_underreplicatedpartitions) >> by(env) > 0 >> for: 1m >> labels: >> severity: critical >> oid: "1.3.6.1.4.1.XXXX.15.1.2.3.1" >> * instance: "{{ $labels.service_name }}"* >> annotations: >> summary: 'Kafka {{ $labels.service_name }}: {{ $value }} under >> replicated partitons' >> description: 'Under-replicated partitions means that one or more >> replicas are not available. This is usually because a broker is down. >> Restart the broker, and check for errors in the logs.' >> >> This bold line is same as anything... I've tried already in the >> annotation/description section, also but no look.. >> >> Any ideas or how wold I managed to get this done ? >> >> >> Best regards! >> Jhanssen >> >> -- >> 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/f4f864b8-671f-4568-8251-cef279e894ebn%40googlegroups.com >> >> <https://groups.google.com/d/msgid/prometheus-users/f4f864b8-671f-4568-8251-cef279e894ebn%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/81bb84e4-b425-4615-a8e4-4607d8fae756n%40googlegroups.com.

