Set up monitoring for peertube

This commit is contained in:
Ivan R. 2024-11-16 01:39:02 +05:00
parent d154afd699
commit 11648958cd
Signed by: lumin
GPG key ID: E0937DC7CD6D3817
4 changed files with 16 additions and 3 deletions

View file

@ -180,8 +180,9 @@ backend grafana
backend peertube backend peertube
mode http mode http
option httpchk GET /.well-known/nodeinfo
http-response set-header Onion-Location http://vcomfyooxdbibyusen75qbzaunrjykw2cxkc6txm6qykkdv4z2danpid.onion%[capture.req.uri] http-response set-header Onion-Location http://vcomfyooxdbibyusen75qbzaunrjykw2cxkc6txm6qykkdv4z2danpid.onion%[capture.req.uri]
server s1 peertube:9000 check server s1 peertube:9000 check inter 15s
backend authentik backend authentik
mode http mode http

View file

@ -17,3 +17,6 @@ scrape_configs:
- job_name: authentik - job_name: authentik
static_configs: static_configs:
- targets: ["authentik-1:9300"] - targets: ["authentik-1:9300"]
- job_name: peertube
static_configs:
- targets: ["peertube:9091"]

View file

@ -48,6 +48,7 @@
- name: peertube - name: peertube
- name: haproxy - name: haproxy
- name: postgresql - name: postgresql
- name: monitoring
volumes: volumes:
- /mnt/hdd/peertube:/data - /mnt/hdd/peertube:/data
- /etc/peertube:/config - /etc/peertube:/config
@ -57,3 +58,11 @@
tmpfs_size: "4G" tmpfs_size: "4G"
recreate: "{{ cfg.changed }}" recreate: "{{ cfg.changed }}"
restart_policy: unless-stopped restart_policy: unless-stopped
healthcheck:
test: ["CMD", "curl", "--fail", "http://127.0.0.1:9000/.well-known/nodeinfo"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# TODO: enable after ansible update
# state: healthy

View file

@ -198,7 +198,7 @@ log:
# For more information: https://docs.joinpeertube.org/maintain/observability # For more information: https://docs.joinpeertube.org/maintain/observability
open_telemetry: open_telemetry:
metrics: metrics:
enabled: false enabled: true
# How often viewers send playback stats to server # How often viewers send playback stats to server
playback_stats_interval: '15 seconds' playback_stats_interval: '15 seconds'
@ -209,7 +209,7 @@ open_telemetry:
# Create a prometheus exporter server on this port so prometheus server can scrape PeerTube metrics # Create a prometheus exporter server on this port so prometheus server can scrape PeerTube metrics
prometheus_exporter: prometheus_exporter:
hostname: '127.0.0.1' hostname: '0.0.0.0'
port: 9091 port: 9091
tracing: tracing: