-
Notifications
You must be signed in to change notification settings - Fork 72
Closed
Labels
Description
In order to export arangodb metrics to Prometheus, the operator should be extended to run an arangodb-exporter sidecar container for every arangod(agent|dbserver|coordinator|single) Pod.
This involves:
- Adding an option to the
DeploymentSpecto turn on/off exporting metrics - If enabled, add a container running
arangodb-exporterfor everyarangodpod.
Follow the template spec in theDeploymentexample below. - Add a
Servicethat selects all exporters of the deployment. - Add a
ServiceMonitorthat adds the arangodb-exporters as target in Prometheus.
See arangodb-helper/arangodb-exporter#4 for using the exporter with the Prometheus Operator.
Below is an example of (manually) running the exporter for 1 agent (that was deployed by the operator).
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: arangodb-export-agent1
spec:
replicas: 1
template:
metadata:
labels:
app: arangodb-exporter
spec:
containers:
- name: exporter
image: arangodb/arangodb-exporter:0.1.3
ports:
- name: metrics
containerPort: 9101
args:
- --arangodb.endpoint=ssl://example-simple-cluster-agent-0mmwt80z.example-simple-cluster-int.default.svc:8529
- --arangodb.jwtsecret=$(ARANGOD_JWT_SECRET)
- --ssl.keyfile=/secrets/tls/tls.keyfile
env:
- name: ARANGOD_JWT_SECRET
valueFrom:
secretKeyRef:
key: token
name: example-simple-cluster-jwt
volumeMounts:
- mountPath: /secrets/tls
name: tls-keyfile
volumes:
- name: tls-keyfile
secret:
defaultMode: 420
secretName: example-simple-cluster-agent-0mmwt80z-tls-keyfile
---
kind: Service
apiVersion: v1
metadata:
name: arangodb-exporters-service
labels:
app: arangodb-exporter
spec:
selector:
app: arangodb-exporter
ports:
- name: metrics
port: 9101
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: arangodb-exporter
namespace: monitoring
labels:
team: frontend
prometheus: kube-prometheus
spec:
namespaceSelector:
matchNames:
- default
selector:
matchLabels:
app: arangodb-exporter
endpoints:
- port: metrics
scheme: https
tlsConfig:
insecureSkipVerify: true