add option to expose metrics via nextcloud-exporter
continuous-integration/drone/pr Build is failing
continuous-integration/drone/pr Build is failing
This commit is contained in:
@@ -107,3 +107,7 @@ DEFAULT_QUOTA="10 GB"
|
||||
#HSTS_ENABLED=1
|
||||
# Uncomment this line to add the `preload` part
|
||||
#HSTS_PRELOAD=1
|
||||
|
||||
# Metrics
|
||||
# COMPOSE_FILE="$COMPOSE_FILE:compose.metrics.yml"
|
||||
# SECRET_METRICS_TOKEN_VERSION=v1 # length=32 charset=hex
|
||||
@@ -128,6 +128,17 @@ To disable dashboard app (since it is so corporate):
|
||||
|
||||
- Configure a `defaultapp` in your `config.php` or use [apporder](https://apps.nextcloud.com/apps/apporder)
|
||||
|
||||
## Metrics
|
||||
|
||||
There is a [metrics exporter](https://github.com/xperimental/nextcloud-exporter) that can be run as sidecar container, also part of the nextcloud helm charts. Its configured via alloys label-based auto-discovery provided by the updated [monitoring-stack](https://git.coopcloud.tech/coop-cloud/monitoring-ng)
|
||||
To enable, uncomment
|
||||
```
|
||||
COMPOSE_FILE="$COMPOSE_FILE:compose.metrics.yml"
|
||||
SECRET_METRICS_TOKEN_VERSION=v1 # length=32 charset=hex
|
||||
```
|
||||
then generate the secret with abra and run
|
||||
`abra app cmd <domain> app set_metrics_token`
|
||||
|
||||
## Upgrading Nextcloud
|
||||
Upgrading Nextcloud can be a hair raising experiance. They [don't support downgrading](https://docs.nextcloud.com/server/latest/admin_manual/maintenance/upgrade.html) even for minor versions.
|
||||
|
||||
|
||||
@@ -193,3 +193,7 @@ set_windowsfriendly_filenames() {
|
||||
upgrade_mariadb() {
|
||||
mariadb-upgrade -p`cat /run/secrets/db_root_password`
|
||||
}
|
||||
|
||||
set_metrics_token() {
|
||||
run_occ "config:app:set serverinfo token --value '$(cat /run/secrets/metrics_token)'"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
app:
|
||||
secrets:
|
||||
- metrics_token
|
||||
metrics:
|
||||
image: xperimental/nextcloud-exporter:0.9.0
|
||||
environment:
|
||||
- NEXTCLOUD_SERVER=https://$DOMAIN
|
||||
- NEXTCLOUD_AUTH_TOKEN=@/run/secrets/metrics_token
|
||||
secrets:
|
||||
- metrics_token
|
||||
networks:
|
||||
- proxy
|
||||
deploy:
|
||||
labels:
|
||||
- "prometheus.io/scrape=true"
|
||||
- "prometheus.io/port=9205"
|
||||
secrets:
|
||||
metrics_token:
|
||||
external: true
|
||||
name: ${STACK_NAME}_metrics_token_${SECRET_METRICS_TOKEN_VERSION}
|
||||
Reference in New Issue
Block a user