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/9dd69c68-9170-49c8-af77-6c60e60e87b1n%40googlegroups.com.

Reply via email to