What should be the configuration in alertmanager.yml to match to the rule?

Brian Candler schrieb am Donnerstag, 2. September 2021 um 15:22:55 UTC+2:

> Correct, that expression will only give "job" and "instance" labels.
>
> I don't think your alertmanager rule will ever match on this alert.
>
> On Thursday, 2 September 2021 at 14:05:22 UTC+1 [email protected] wrote:
>
>> Hello,
>>
>> I have defined several rule files, e.g. this general.rules.yml:
>> groups:
>> - name: general.rules
>>   rules:
>>   - alert: TargetDown
>>     annotations:
>>       message: '{{ printf "%.4g" $value }}% of the {{ $labels.job }}/{{ 
>> $labels.instance
>>         }} instances are down.'
>>     expr: 100 * (count(up == 0) BY (job, instance) / count(up) BY (job,
>>       instance)) > 10
>>     for: 10m
>>     labels:
>>       severity: warning
>>
>> However, I don't see the correlation to service.
>>
>> Brian Candler schrieb am Donnerstag, 2. September 2021 um 13:58:11 UTC+2:
>>
>>> It looks like "service" is a label that you have set in the prometheus 
>>> alerting rule.
>>>
>>> On Thursday, 2 September 2021 at 11:52:20 UTC+1 [email protected] wrote:
>>>
>>>> Hello,
>>>>
>>>> can you please advise what is represented by a service in alertmanager 
>>>> configuration, e.g.
>>>> routes: 
>>>> # All alerts with service=mysql or service=cassandra 
>>>> # are dispatched to the database pager. - receiver: 'database-pager' 
>>>> group_wait: 10s matchers: 
>>>>  - service=~"mysql|cassandra"
>>>>
>>>> Where do I find the service in the rules or in Prometheus -> Alerts?
>>>>
>>>> THX
>>>>
>>>

-- 
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/81dddb9e-6a8c-406c-b9d6-0deb168bd408n%40googlegroups.com.

Reply via email to