Skip to content

Commit

Permalink
Merge pull request #113 from arangodb/metrics-example
Browse files Browse the repository at this point in the history
Added examples for exposing metrics to Prometheus
  • Loading branch information
ewoutp authored Apr 5, 2018
2 parents b6d80cc + a759b9c commit 2e5b21f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/Manual/Deployment/Kubernetes/Metrics.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Metrics

TBD
The ArangoDB Kubernetes Operator (`kube-arangodb`) exposes metrics of
its operations in a format that is compatible with [Prometheus](https://prometheus.io).

The metrics are exposed through HTTPS on port `8528` under path `/metrics`.

Look at [examples/metrics](https://github.com/arangodb/kube-arangodb/tree/master/examples/metrics)
for examples of `Services` and `ServiceMonitors` you can use to integrate
with Prometheus through the [Prometheus-Operator by CoreOS](https://github.com/coreos/prometheus-operator).
34 changes: 34 additions & 0 deletions examples/metrics/deployment-operator-servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This example shows how to integrate with the Prometheus Operator
# to bring metrics from kube-arangodb to Prometheus.

apiVersion: v1
kind: Service
metadata:
name: arango-deployment-operator
labels:
app: arango-deployment-operator
spec:
selector:
app: arango-deployment-operator
ports:
- name: metrics
port: 8528

---

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: arango-deployment-operator
labels:
team: frontend
spec:
selector:
matchLabels:
app: arango-deployment-operator
endpoints:
- port: metrics
scheme: https
tlsConfig:
insecureSkipVerify: true

1 change: 1 addition & 0 deletions manifests/templates/deployment/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ spec:
metadata:
labels:
name: {{ .Deployment.OperatorDeploymentName }}
app: arango-deployment-operator
spec:
containers:
- name: operator
Expand Down
1 change: 1 addition & 0 deletions manifests/templates/storage/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
metadata:
labels:
name: {{ .Storage.OperatorDeploymentName }}
app: arango-storage-operator
spec:
serviceAccountName: {{ .Storage.Operator.ServiceAccountName }}
containers:
Expand Down

0 comments on commit 2e5b21f

Please sign in to comment.