-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to configure multi alertmanagers? #2891
Comments
Can you check under the |
Can you share the output of |
hmm ... can you share the yaml representation? So far it looks like you're doing everything right. Which version of Prometheus are you running? |
apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
creationTimestamp: "2019-11-29T02:04:58Z"
generation: 1
labels:
app: prometheus-operator-alertmanager
chart: prometheus-operator-8.2.4
heritage: Tiller
release: prometheus-operator
name: prometheus-operator-alertmanager-test
namespace: monitoring
resourceVersion: "6496244"
selfLink: /apis/monitoring.coreos.com/v1/namespaces/monitoring/alertmanagers/prometheus-operator-alertmanager-test
uid: 2de06863-462d-4980-9e7f-063ed80c403a
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
alertmanager: prometheus-operator-alertmanager-test
app: alertmanager
topologyKey: kubernetes.io/hostname
weight: 100
baseImage: quay.io/prometheus/alertmanager
portName: web
replicas: 1
retention: 120h
routePrefix: /
serviceAccountName: prometheus-operator-alertmanager
storage:
volumeClaimTemplate:
selector: {}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: nfs-client
version: v0.19.0 apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
creationTimestamp: "2019-11-28T02:42:48Z"
generation: 1
labels:
app: prometheus-operator-alertmanager
chart: prometheus-operator-8.2.4
heritage: Tiller
release: prometheus-operator
name: prometheus-operator-alertmanager
namespace: monitoring
resourceVersion: "6316431"
selfLink: /apis/monitoring.coreos.com/v1/namespaces/monitoring/alertmanagers/prometheus-operator-alertmanager
uid: 65b64268-259e-4f33-8d32-26f2ea78ac21
spec:
baseImage: quay.io/prometheus/alertmanager
externalUrl: http://alert.deri.com/
listenLocal: false
logFormat: logfmt
logLevel: info
paused: false
portName: web
replicas: 1
retention: 120h
routePrefix: /
securityContext:
fsGroup: 2000
runAsNonRoot: true
runAsUser: 1000
serviceAccountName: prometheus-operator-alertmanager
storage:
volumeClaimTemplate:
selector: {}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: nfs-client
version: v0.19.0 Prometheus Version :v2.13.1 |
Sorry I meant the endpoints, not alertmanagers. |
apiVersion: v1
kind: Endpoints
metadata:
annotations:
endpoints.kubernetes.io/last-change-trigger-time: "2019-11-28T02:43:02Z"
creationTimestamp: "2019-11-28T02:42:48Z"
labels:
app: prometheus-operator-alertmanager
chart: prometheus-operator-8.2.4
heritage: Tiller
release: prometheus-operator
name: prometheus-operator-alertmanager
namespace: monitoring
resourceVersion: "6316596"
selfLink: /api/v1/namespaces/monitoring/endpoints/prometheus-operator-alertmanager
uid: 07b76b88-9d2e-4763-991c-b3b25fa8eb4e
subsets:
- addresses:
- ip: 10.244.3.227
nodeName: k8s-02
targetRef:
kind: Pod
name: alertmanager-prometheus-operator-alertmanager-0
namespace: monitoring
resourceVersion: "6316593"
uid: 9de9bdb9-095c-4d10-aa91-267314c812f5
ports:
- name: web
port: 9093
protocol: TCP apiVersion: v1
kind: Endpoints
metadata:
annotations:
endpoints.kubernetes.io/last-change-trigger-time: "2019-11-29T02:05:11Z"
creationTimestamp: "2019-11-29T02:05:11Z"
labels:
app: prometheus-operator-alertmanager
chart: prometheus-operator-8.2.4
heritage: Tiller
release: prometheus-operator
name: prometheus-operator-alertmanager-test
namespace: monitoring
resourceVersion: "6496300"
selfLink: /api/v1/namespaces/monitoring/endpoints/prometheus-operator-alertmanager-test
uid: ae0edab1-0f84-45cc-bec3-93924691f169
subsets:
- addresses:
- ip: 10.244.3.232
nodeName: k8s-02
targetRef:
kind: Pod
name: alertmanager-prometheus-operator-alertmanager-test-0
namespace: monitoring
resourceVersion: "6496271"
uid: 3ae292be-24be-4146-8596-cca226223ed1
ports:
- name: web
port: 9093
protocol: TCP |
Still all looks correct. Could you share the whole config in the prometheus-k8s secret? |
I'm looking into this. There might be an issue indeed. |
It's a problem with Prometheus upstream. I've submitted prometheus/prometheus#6455 to fix it. |
ok,thank you. |
is there any temporary solution for this problem ? Is the fix prometheus/prometheus#6455 in any production version so that we update our images ? |
If I am not mistaken the fix should be available in Prometheus 2.15. |
@brancz I figure that out. Thanks for replying. |
Sorry to revive this closed ticket, but i was wondering if you guys have any documentation on using multiple alertmanagers with the prometheus operator. do all alertmanager instances need to exist in the monitoring namespace? Are they automatically discovered by prometheus, regardless of where they run? Are there other steps to wire up discovery of additional alertmanagers besides just applying an Alertmanager resource to the cluster? Currently, i'm not able to discover any alertmanager instances outside of the one installed by p8s itself. I am using prometheus version 2.15 |
Hey. I just wanted to ask if you did afterall find any documentation or resources for configuring alertmanager using name and namespaces. Because i was trying to edit prometheus config using static_configs which does not work for prometheus operator helm chart. So now I am trying to specify the name and namespace of the alertmanagers in the prometheus configuration but prometheus does not recognize them and does not find endpoints. |
Can you please tell me what steps you followed to create the 2nd alertmanager ?? |
Prometheus Operator version: v0.34.0
Kubernetes cluster kind: kubeadm
hello, l have deploy a prometheus-operator in k8s with "helm install stable/prometheus-operator", now i have some question about prometheus config.
in default, install prometheus-operator with helm will start a prometheus named prometheus-operator-prometheus, a alertmanager named prometheus-operator-alertmanager , and so on..(I have configuration the ingress to access alert manager UI)
when the prometheus has a new alert , it will send to the prometheus-operator-alertmanager and i can see it in the alertmanager dashboard.
and i have cat the config of prometheus,
now I want test create a new alertmanager named prometheus-operator-alertmanager-test with the CRD Alertmanager , and the new alertmanager configuration is the same as prometheus-operator-alertmanager , I have just change the name.
and i have create a service type of NodePort, to prove the new Alertmanager is ok!
At last , I have modify the configuration of prometheus-operator-prometheus ,as following:
and it worked, I have checked in the dashboard of prometheus-Configuration.
now, Something strange happened.
when the prometheus has produce new alert, prometheus-operator-prometheus can't receive,only prometheus-operator-alertmanager-test can receive! why ??please help me.Looking forward to your reply. Thank you!
The text was updated successfully, but these errors were encountered: