Skip to content

Commit 423e828

Browse files
authored
Merge pull request #4 from arangodb-helper/docs/prometheus-operator
Document usage in combination with Prometheus operator
2 parents e9bb9c8 + 5bad464 commit 423e828

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ This results in an ArangoDB Exporter exposing all statistics of
1818
the ArangoDB server (running at `http://<your-database-host>:8529`)
1919
at `http://<your-host-ip>:9101/metrics`.
2020

21+
## Running in Docker
22+
23+
To run the ArangoDB Exporter in docker, use an image such as
24+
[`arangodb/arangodb-exporter:0.1.3`](https://hub.docker.com/r/arangodb/arangodb-exporter/).
25+
2126
## Configuring Prometheus
2227

2328
There are several ways to configure Prometheus to fetch metrics from the ArangoDB Exporter.
@@ -36,6 +41,56 @@ scrape_configs:
3641
3742
For more info on configuring Prometheus go to [its configuration documentation](https://prometheus.io/docs/prometheus/latest/configuration/configuration).
3843
44+
If you're using the [Prometheus Operator](https://github.com/coreos/prometheus-operator)
45+
in Kubernetes, you need to create an additional `Service` and a `ServiceMonitor` resource
46+
like this:
47+
48+
```yaml
49+
kind: Service
50+
apiVersion: v1
51+
metadata:
52+
name: arangodb-exporters-service
53+
labels:
54+
app: arangodb-exporter
55+
spec:
56+
selector:
57+
app: arangodb-exporter
58+
ports:
59+
- name: metrics
60+
port: 9101
61+
62+
---
63+
64+
apiVersion: monitoring.coreos.com/v1
65+
kind: ServiceMonitor
66+
metadata:
67+
name: arangodb-exporter
68+
namespace: monitoring
69+
labels:
70+
team: frontend
71+
prometheus: kube-prometheus
72+
spec:
73+
namespaceSelector:
74+
matchNames:
75+
- default
76+
selector:
77+
matchLabels:
78+
app: arangodb-exporter
79+
endpoints:
80+
- port: metrics
81+
scheme: https
82+
tlsConfig:
83+
insecureSkipVerify: true
84+
```
85+
86+
Note 1: that the typical deployment on the Prometheus operator is done in
87+
a namespace called `monitoring`. Make sure to match the `namespace`
88+
of the `ServiceMonitor` to match that.
89+
90+
Note 2: that the `Prometheus` custom resource has a field called `serviceMonitorSelector`.
91+
Make sure that the `matchLabels` selector in there matches the labels of
92+
your `ServiceMonitor`.
93+
3994
## Building
4095

4196
To build this project, you need Go 1.8 or higher and Docker installed.

0 commit comments

Comments
 (0)