Skip to content

jitsi_jibri_healthy Prometheus metric reports 0 even when Jibri is healthy #590

@mozkomor05

Description

@mozkomor05

Description

The jitsi_jibri_healthy Prometheus gauge always reads 0.0 on a freshly started Jibri instance, even though the instance is healthy.

The REST health endpoint correctly reports HEALTHY:

$ curl http://localhost:2222/jibri/api/v1.0/health
{"status":{"busyStatus":"IDLE","health":{"healthStatus":"HEALTHY","details":{}}}}

But the Prometheus metric stays at 0:

$ curl http://localhost:2222/metrics | grep jitsi_jibri_healthy
# TYPE jitsi_jibri_healthy gauge
# HELP jitsi_jibri_healthy Whether the jibri instance is currently healthy.
jitsi_jibri_healthy 0.0

Root cause

In JibriMetrics.kt, the healthy gauge is registered with a default value of 0.0. It only gets updated when updateStatus() is called:

fun updateStatus(status: JibriStatus) {
    healthy.set(status.health.healthStatus == ComponentHealthStatus.HEALTHY)
    recording.set(status.busyStatus == ComponentBusyStatus.BUSY)
}

In JibriStatusManager.kt, publishStatus() is only called when a state transition occurs (old != new). Since Jibri starts healthy and no transition happens, the metric subscriber never receives the initial state, and the gauge remains at 0.

The XMPP presence does get the initial HEALTHY status (via updatePresence at startup), but the Prometheus metric does not.

Expected behavior

jitsi_jibri_healthy should report 1.0 when Jibri is healthy and idle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions