Thank for your reply.

on Prometheus Pod 1:
alerting:
      alertmanagers:
      - scheme: http
        path_prefix: "/alertmanager1/"

        static_configs:
        - targets: ['alertmanager1.monitoring.svc:9093']

On Prometheus Pod 2:
alerting:
      alertmanagers:
      - scheme: http
        path_prefix: "/alertmanager1/"

        static_configs:
        - targets: ['alertmanager1.monitoring.svc:9093']

I just want to implement when one alertmanager is failed, there is another 
redundancy one is working well. 

So may I ask what's the difference between totally 2 different deployments 
and 1 deployment with 2 replicas?
On Tuesday, May 17, 2022 at 4:19:56 AM UTC+8 Brian Candler wrote:

> On Monday, 16 May 2022 at 09:05:28 UTC+1 [email protected] wrote:
>
>> Thank you. I'm deploying 2 alertmanagers with 2 separate deployment 
>> files. So I have to specify 2 different 
>> --web.external-url=http://localhost:9093/alertmanager1/
>> --web.external-url=http://localhost:9093/alertmanager2/ 
>> <http://localhost:9093/alertmanager1/>
>>
>
> Only if you are running two alertmanagers on the same host.  Why do you 
> want to do that?
>  
>
>> And then configure as below, am I right?
>> alerting:
>>       alertmanagers:
>>       - scheme: http
>>         path_prefix: "/alertmanager1/"
>>
>>         static_configs:
>>         - targets: ['alertmanager1.monitoring.svc:9093']
>> alerting:
>>       alertmanagers:
>>       - scheme: http
>>         path_prefix: "/alertmanager1/"
>>
>>         static_configs:
>>         - targets: ['alertmanager1.monitoring.svc:9093']
>>
>>
> No, unless those two "alerting" sections are present in two different 
> prometheus servers.
>
> If you want a single prometheus to send all alerts to both alertmanagers, 
> then you'd have a single "alerting" section with two targets. Unfortunately 
> the "path_prefix" is common to all targets, so you would also have to 
> configure alert_relabel_configs 
> <https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs>
>  to 
> set the __alerts_path__ label separately for each target.
>
> It's possible, but I don't understand what you're actually trying to 
> achieve here, and therefore I suspect there's a much better and simpler way.
>

-- 
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/defc6bc1-ad16-460e-905a-befad091a187n%40googlegroups.com.

Reply via email to