add option to expose metrics via nextcloud-exporter #125
Closed
simon
wants to merge 0 commits from
nextcloud-metrics into main
pull from: nextcloud-metrics
merge into: :main
:main
:pr-15.0.0+34.0.4
:renovate/nextcloud-35.x
:renovate/docker.elastic.co-elasticsearch-elasticsearch-9.x
:nextcloud-metrics
:renovate/mariadb-13.x
:trusted-domains
:renovate/pgautoupgrade-pgautoupgrade-18.x
:pr-15.2.0+34.0.2-fpm
:pr-14.2.0+33-fpm
:upload-limit
:feature/imaginary
:local
:kc_stable
:update-nginx-conf
:split-bbb-onlyoffice-compos
:split-onlyoffice-bbb-config
:authentik_sso
:healthchecks
:occ_cmds
:auto_configure_sso
Dismiss Review
Are you sure you want to dismiss this review?
No labels
enhancement
Milestone
No items
No Milestone
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
dannygroenewegen (Danny Groenewegen)
decentral1se (d1)
fauno (fauno)
ineiti (Linus Gasser)
javielico (Javielico)
jjsfunhouse
kawaiipunk (KawaiiPunk)
knoflook
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
renovate-bot (Comrade Renovate Bot)
simon
stevensting
trav (Trav Fryer)
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/nextcloud#125
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR adds a metrics sidecar container that's being scraped by the new alloy autodiscovery from https://git.coopcloud.tech/coop-cloud/monitoring-ng
It also comes with an example-dashboard for grafana:
#llm_assisted as I chatted with Claude during development to set everything up.
2bcd83c40bto768531d1a2Looks nice - thanks a lot. Some small nitpicks.
@@ -131,1 +131,4 @@## MetricsThere 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)Nitpick: please respect 80 character limit per line and start new sentences on a new line.
@@ -132,0 +137,4 @@COMPOSE_FILE="$COMPOSE_FILE:compose.metrics.yml"SECRET_METRICS_TOKEN_VERSION=v1 # length=32 charset=hex```then generate the secret with abra and runI prefer the additional line for the very lazy admins:
@@ -0,0 +6,4 @@metrics:image: xperimental/nextcloud-exporter:0.9.0environment:- NEXTCLOUD_SERVER=https://$DOMAINUninformed question: shouldn't this point to the docker service name of the nextcloud server? Or will this be called from an external app?
Didn't work for me whereas using $DOMAIN did. Also it's been quite common to do this elsewhere in coop-cloud recipes, so should be fine I think?
Great addition! But: Nextcloud v33 added a metrics endpoint. I think we should use that, no need for a separate container.
https://docs.nextcloud.com/server/stable/admin_manual/configuration_monitoring/index.html
Just tried
config:system:set openmetrics_allowed_clients 0 --value="0.0.0.0/0", and this enabled the metrics endpoint for me with Prometheus data. This should then be set to the IP range of the proxy network so Alloy can reach it, without it being exposed publicly. And still needs the compse.metrics.yml to addprometheus.io/scrapelabels to the web container.oh, missed that, but very good point.
had to add some nginx config (with help of Claude) as Nextclouds trusted_domains config blocked alloy otherwise
@@ -0,0 +7,4 @@labels:- "prometheus.io/scrape=true"- "prometheus.io/port=9205"- "prometheus.io/path=/metrics"/metrics is the default path, so this label could be removed.
I actually prefer making it explicit as its also serves the purpose of documenting which path on which port is used. For me this falls into the "shorter is not always better" category - but on the other hand its not that important, so if you prefer it deleted - I did that now ;)
@@ -188,0 +188,4 @@{{ if env "METRICS_ENABLED" }}server {listen 9205;Is there any reason for configuring an extra port for this? To simplify, the whole
location = /metricsblock could also be put inside the existing port 80 block. And the reference to/var/www/htmlcould be replaced with$document_root/index.phpfelt safer to me, but I agree its not necessary
Pull request closed