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/>
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']
Why I configured web external url is because I setup ingress in our
environment, In order to access alertmanager, I have to specify web
external url.
On Saturday, May 14, 2022 at 3:14:53 AM UTC+8 Brian Candler wrote:
> In web.external-url, you configured the path prefix to "/alertmanager1/"
> not "/alertmanager/", this is why you get the 404.
>
> In my configs I omit the trailing slash from both of these.
>
> On Friday, 13 May 2022 at 09:33:37 UTC-4 [email protected] wrote:
>
>> alerting:
>> alertmanagers:
>> - scheme: http
>> path_prefix: "/alertmanager/"
>>
>> static_configs:
>> - targets: ['alertmanager1.monitoring.svc:9093']
>>
>> On Friday, May 13, 2022 at 9:33:02 PM UTC+8 nina guo wrote:
>>
>>> level=error ts=2022-05-13T13:27:59.353Z caller=notifier.go:527
>>> component=notifier alertmanager=
>>> http://alertmanager1:9093/alertmanager/api/v2/alerts count=19
>>> msg="Error sending alert" err="bad response status 404 Not Found"
>>>
>>> On Friday, May 13, 2022 at 6:58:37 PM UTC+8 nina guo wrote:
>>>
>>>> Hi,
>>>>
>>>> I used the following files to deploy alertmanager, but it cannot be
>>>> communicated.
>>>>
>>>> apiVersion: apps/v1
>>>> kind: Deployment
>>>> metadata:
>>>> name: alertmanager1
>>>> namespace: monitoring
>>>> spec:
>>>> replicas: 1
>>>> selector:
>>>> matchLabels:
>>>> app: alertmanager1
>>>> template:
>>>> metadata:
>>>> name: alertmanager1
>>>> labels:
>>>> app: alertmanager1
>>>> spec:
>>>> containers:
>>>> - name: alertmanager
>>>> image: prometheus/alertmanager:latest
>>>> args:
>>>> - "--config.file=/etc/alertmanager/config.yml"
>>>> - "--storage.path=/alertmanager"
>>>> - "--web.external-url=http://localhost:9093/alertmanager1/"
>>>> - "--log.level=debug"
>>>> ports:
>>>> - containerPort: 9093
>>>> volumeMounts:
>>>> - name: config-volume
>>>> mountPath: /etc/alertmanager
>>>> imagePullPolicy: Always
>>>> imagePullSecrets:
>>>> - name: regcred
>>>> volumes:
>>>> - name: config-volume
>>>> configMap:
>>>> name: alertmanager-config
>>>> ---
>>>> apiVersion: v1
>>>> kind: Service
>>>> metadata:
>>>> name: alertmanager1
>>>> namespace: monitoring
>>>> spec:
>>>> selector:
>>>> app: alertmanager1
>>>> ports:
>>>> - port: 9093
>>>> targetPort: 9093
>>>>
>>>> alerting:
>>>> alertmanagers:
>>>> - scheme: http
>>>> static_configs:
>>>> - targets: ['alertmanager1.monitoring.svc:9093']
>>>>
>>>
--
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/7640cf5a-c4c6-4f9d-9910-5344d02aebb4n%40googlegroups.com.