Skip to content

Realtime: worker uptime gauge #15108

Closed
Closed

Description

@ArnabChatterjee20k

Context

Every realtime server metric is a counter or histogram recorded only on activity. A stalled or freshly started worker exports nothing until traffic arrives. MQTT solves this with mqtt.server.uptime in app/mqtt.php.

Goal

Add realtime.server.uptime, an observable gauge of seconds since the realtime worker started, observed on every collect.

Activity

  1. added
    api / realtime
    on Oct 30, 2026
  2. sundeep8967 commented on Oct 31, 2026

    @sundeep8967

    Hi @ArnabChatterjee20k @eldadfux,

    I noticed that realtime.server.uptime was already introduced in app/realtime.php (lines 479-484) via recent commits to track seconds since the realtime worker started:

        if (!$telemetry instanceof NoTelemetry) {
            $workerStartedAt = \microtime(true);
            $telemetry
                ->createObservableGauge('realtime.server.uptime', 's', 'Seconds since the realtime worker started.')
                ->observe(fn (callable $observe) => $observe(\microtime(true) - $workerStartedAt, $workerTelemetryAttributes));
        }

    Since this gauge is now registered and observed on every collect alongside mqtt.server.uptime, this issue appears to be resolved on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api / realtime

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions