Skip to content

fix: Initialize Prometheus healthy/recording metrics with current status#591

Open
mozkomor05 wants to merge 1 commit intojitsi:masterfrom
mozkomor05:fix/prometheus-healthy-metric-init
Open

fix: Initialize Prometheus healthy/recording metrics with current status#591
mozkomor05 wants to merge 1 commit intojitsi:masterfrom
mozkomor05:fix/prometheus-healthy-metric-init

Conversation

@mozkomor05
Copy link

Summary

The jitsi_jibri_healthy and jitsi_jibri_recording Prometheus gauges default to 0 and only update on status transitions via publishStatus(). Since Jibri starts healthy with no transition, the metrics remain at 0 even though the instance is healthy and idle.

This adds a single line to seed the metrics with jibriStatusManager.overallStatus immediately after registering the status handler.

Before: jitsi_jibri_healthy stays 0.0 until the first recording session triggers a state change.
After: jitsi_jibri_healthy correctly reports 1.0 from startup.

Verification

# REST API (was always correct):
curl http://localhost:2222/jibri/api/v1.0/health
# {"status":{"busyStatus":"IDLE","health":{"healthStatus":"HEALTHY","details":{}}}}

# Prometheus metric (was 0, now correctly 1):
curl -s http://localhost:2222/metrics | grep jitsi_jibri_healthy
# jitsi_jibri_healthy 1.0

Fixes #590

@mozkomor05 mozkomor05 force-pushed the fix/prometheus-healthy-metric-init branch from 110fc04 to 2bce7f6 Compare February 13, 2026 12:28
@jitsi-jenkins
Copy link

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

@mozkomor05
Copy link
Author

Done

@mozkomor05 mozkomor05 force-pushed the fix/prometheus-healthy-metric-init branch from 2bce7f6 to d9b9912 Compare February 13, 2026 12:57
The `jitsi_jibri_healthy` and `jitsi_jibri_recording` Prometheus gauges
default to 0 and only update on status transitions via publishStatus().
Since Jibri starts healthy with no transition, the metrics remain at 0
even though the instance is healthy.

Seed the metrics with the current status immediately after registering
the status handler so they reflect the actual state from startup.

Fixes jitsi#590
@mozkomor05 mozkomor05 force-pushed the fix/prometheus-healthy-metric-init branch from d9b9912 to 1a3dd92 Compare February 13, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jitsi_jibri_healthy Prometheus metric reports 0 even when Jibri is healthy

2 participants