From 32128041a37dedf82598f307c8d3af2a0a9b9640 Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 24 Apr 2025 18:34:03 +0200 Subject: [PATCH] Add support for metrics.. --- README.install-notify_push | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.install-notify_push b/README.install-notify_push index 023d77d..75153d2 100644 --- a/README.install-notify_push +++ b/README.install-notify_push @@ -28,6 +28,7 @@ PHP_VERSION=8.3 WEBSITE="cloud-test.oopen.de" WEBSITE="cloud-02-test.oopen.de" WEBSITE="cloud-01.oopen.de" +WEBSITE="cloud-test-01.oopen.de" WEB_BASE_DIR="/var/www/${WEBSITE}" NC_INSTALL_DIR="${WEB_BASE_DIR}/nextcloud" @@ -78,7 +79,7 @@ systemctl restart apache2 # proxy_set_header Connection "Upgrade"; # proxy_set_header Host $host; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -# } + } # reload nginx # @@ -109,6 +110,21 @@ systemctl restart php-${PHP_VERSION}-fpm # 4 Create Service 'notify_push' # ================================ # +# Metrics +# +# The push server can expose some basic metrics about the number of connected clients and +# the traffic flowing through the server by setting the METRICS_PORT environment variable. +# +# Once set the metrics are available in a prometheus compatible format at /metrics on the +# configured port. Inside the service file set: +# +# Environment=METRICS_PORT=7868 +# +# Run 'curl http://localhost:7868/metrics +# +# Additionally you can manually check the metrics by running the occ notify_push:metrics +# command, this will function even if you haven't setup METRICS_PORT. +# cat < /etc/systemd/system/notify_push.service [Unit] Description = Push daemon for Nextcloud clients @@ -116,7 +132,9 @@ Documentation=https://github.com/nextcloud/notify_push [Service] # Change if you already have something running on this port -Environment=PORT=7867 +Environment=PORT=7867A +# Run 'curl http://localhost:7868/metrics' to eee some metrivcs +Environment=METRICS_PORT=7868 Environment=NEXTCLOUD_URL=https://${WEBSITE} ExecStart=${NC_INSTALL_DIR}/apps/notify_push/bin/x86_64/notify_push ${NC_INSTALL_DIR}/config/config.php # requires the push server to have been build with the systemd feature (enabled by default)