Skip to content

Commit 2cfda4c

Browse files
committed
Add documentation for metrics.
1 parent e697ad0 commit 2cfda4c

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

docs/Manual/Deployment/Kubernetes/DeploymentResource.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,50 @@ There are two magic values for the secret name:
354354
- `None` specifies no action. This disables root password randomization. This is the default value. (Thus the root password is empty - not recommended)
355355
- `Auto` specifies automatic name generation, which is `<deploymentname>-root-password`.
356356

357+
### `spec.metrics.enabled: bool`
358+
359+
If this is set to `true`, the operator runs a sidecar container for
360+
every DBserver pod and every coordinator pod. The sidecar container runs
361+
the ArangoDB-exporter and exposes metrics of the corresponding `arangod`
362+
instance in Prometheus format on port 9101 under path `/metrics`. You
363+
also have to specify a string for `spec.metrics.image`, which is the
364+
Docker image name of the `arangodb-exporter`. At the time of this
365+
writing you should use `arangodb/arangodb-exporter:0.1.6`. See [this
366+
repository](https://github.com/arangodb-helper/arangodb-exporter) for
367+
the latest version.
368+
369+
In addition to the sidecar containers the operator will deploy a service
370+
to access the exporter ports (from within the k8s cluster), and a
371+
resource of type `ServiceMonitor`, provided the corresponding custom
372+
resource definition is deployed in the k8s cluster. If you are running
373+
Prometheus in the same k8s cluster with the Prometheus operator, this
374+
will be the case. The `ServiceMonitor` will have the following labels
375+
set:
376+
377+
- `app: arangodb`
378+
- `arango_deployment: YOUR_DEPLOYMENT_NAME`
379+
- `context: metrics`
380+
- `metrics: prometheus`
381+
382+
This makes it possible that you configure your Prometheus deployment to
383+
automatically start monitoring on the available Prometheus feeds. To
384+
this end, you must configure the `serviceMonitorSelector` in the specs
385+
of your Prometheus deployment to match these labels. For example:
386+
387+
```yaml
388+
serviceMonitorSelector:
389+
matchLabels:
390+
metrics: prometheus
391+
```
392+
393+
would automatically select all pods of all ArangoDB cluster deployments
394+
which have metrics enabled.
395+
396+
### `spec.metrics.image: string`
397+
398+
See above, this is the name of the Docker image for the ArangoDB
399+
exporter to expose metrics.
400+
357401
### `spec.<group>.count: number`
358402

359403
This setting specifies the number of servers to start for the given group.
@@ -457,4 +501,4 @@ because servers in these groups do not need persistent storage.
457501

458502
Please use VolumeClaimTemplate from now on. This field is not considered if
459503
VolumeClaimTemplate is set. Note however, that the information in requests
460-
is completely handed over to the pod in this case.
504+
is completely handed over to the pod in this case.

docs/Manual/Deployment/Kubernetes/Metrics.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ The metrics are exposed through HTTPS on port `8528` under path `/metrics`.
88
Look at [examples/metrics](https://github.com/arangodb/kube-arangodb/tree/master/examples/metrics)
99
for examples of `Services` and `ServiceMonitors` you can use to integrate
1010
with Prometheus through the [Prometheus-Operator by CoreOS](https://github.com/coreos/prometheus-operator).
11+
12+
Furthermore, the operator can run sidecar containers for ArangoDB
13+
deployments of type Cluster which expose metrics in Prometheus format.
14+
Use the attribute `spec.metrics` to set this up see the [spec
15+
reference](./DeploymentResource.md) for details.

0 commit comments

Comments
 (0)