Skip to content

Commit

Permalink
Add monitoring example
Browse files Browse the repository at this point in the history
  • Loading branch information
ansd committed Dec 3, 2020
1 parent 8f066d1 commit 8e7038f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/examples/prometheus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Prometheus Example

See [Monitoring RabbitMQ in Kubernetes](https://www.rabbitmq.com/kubernetes/operator/operator-monitoring.html) for detailed instructions.

If you deployed the [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator), make Prometheus scrape RabbitMQ nodes by:
```shell
kubectl apply -f rabbitmq-podmonitor.yaml
```

Alternatively, if you deployed the Prometheus Operator via the [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack) Helm chart,
set the values in [kube-prometheus-stack-values.yaml](kube-prometheus-stack-values.yaml) when installing / upgrading the Helm chart.
11 changes: 11 additions & 0 deletions docs/examples/prometheus/kube-prometheus-stack-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
prometheus:
additionalPodMonitors:
- name: rabbitmq
podMetricsEndpoints:
- port: prometheus
selector:
matchLabels:
app.kubernetes.io/component: rabbitmq
namespaceSelector:
any: true
14 changes: 14 additions & 0 deletions docs/examples/prometheus/rabbitmq-podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: rabbitmq
spec:
podMetricsEndpoints:
- interval: 15s
port: prometheus
selector:
matchLabels:
app.kubernetes.io/component: rabbitmq
namespaceSelector:
any: true

0 comments on commit 8e7038f

Please sign in to comment.