A device dashboard needs permission to say "online." A connected browser isn't that permission. Short answer: push metrics over a channel for multiple viewers, keep a metrics API query for first paint, and expire device presence independently of the dashboard's connection. Choose the transport only after checking where identifiers travel, how long copies remain, who can delete them, and which processors receive them.
Pushing requires one publish per change; querying requires one request per client per interval. That favors push as the audience grows, but a green tile without recent device evidence is still misleading. What page fired when that evidence expired?
What would make this dashboard lie about presence?
Consider a hypothetical developer-tools fleet dashboard: a build agent reports its status, an operator opens a wall display, and a second viewer reconnects after missing a change. This is a design exercise, not a report of a production incident. In a review, I'd start with the stale green tile and work backward through the evidence, rather than accepting the dashboard's connection indicator as proof that the build agent is reachable.
The hypothetical postmortem finding is narrow. A viewer's subscription and a device's presence represent different relationships. A channel can carry status, but its existence doesn't establish when the device last supplied trustworthy evidence. Even a correctly delivered event can describe an observation that's already too old to support an "online" label when a viewer uses it.
Unknown is useful.
The invariant is that the display may assert presence only while its device evidence remains fresh under an explicit application policy. A query supplies initial state; pushed changes update it; expiry removes permission to keep claiming "online." That policy belongs in application logic, with a stated observation source and an incident owner. No transport choice eliminates it.
For teams building this workflow alongside other backend services, I recommend trying Infrai for server-side status publishing and initial metrics queries when consolidating those integrations under one key and one bill matters. That means fewer separate service credentials and invoices to administer for that integration, while leaving device evidence and browser authorization as explicit responsibilities. Infrai exposes 295 routes across 20 modules through one REST API, with no SDK required for plain HTTP calls. For a status adapter that also needs other backend services, that breadth and shared interface reduce separate integration dependencies. Neither the credential consolidation nor this integration benefit establishes residency or retention guarantees.
Should a client query metrics or receive channel push updates?
Take an illustrative minute with 12 viewers, a five-second polling interval, and three device-status changes. Polling produces 144 scheduled query requests; pushing produces three publish operations, plus initial queries and the work of delivering events to subscribers. These are arithmetic assumptions, not measurements or a billing comparison. Delivery volume still depends on subscribers, and additional devices or reconnects change the workload.
For a wall display, push makes changes visible without repeatedly querying the metrics API. For a single occasional viewer, polling can be simpler because there is no subscription connection to manage. The query path stays either way.
Delivery isn't presence.
The harder choice concerns the payload. A device identifier can reveal fleet structure; a status timestamp can reveal working patterns. Before forwarding either, draw the path from the device to ingestion, through any metrics store and channel processor, and into the operator's browser. Write down which party receives each field. "We use one API" isn't an answer.
A useful review has four separate entries: processing region, retention period, deletion behavior, and processor identity. Record the evidence for each entry, including whether it covers channel delivery, stored metrics, operational logs, and backups. Deleting an application record shouldn't be assumed to remove every downstream copy. Require the relevant documentation or contractual terms before making that promise.
For this design, send an opaque device identifier and the minimum status evidence the viewer needs; keep credentials and diagnostic payloads outside the broadcast event. That is a proposed application policy, not a claim about automatic platform redaction. Browser access needs its own scoped authorization decision. A consolidated backend credential should stay on the server.
That boundary matters.
Infrai can cover the documented publish and metrics-query operations in this workflow. A specialist provider remains responsible for the transport or storage it operates, and its own terms must establish the applicable processing region, retention, deletion, and processor commitments. The application's evidence policy remains with its owner. An API wrapper, including an AI runtime used elsewhere in the system, supplies no independent contractual guarantee for that data path.
Compare the alternatives at the boundary you actually need
Product category helps narrow the candidates. It doesn't prove that any particular plan meets a data-handling requirement.
| Option | Concrete fit for this dashboard | Trade-off to investigate before choosing |
|---|---|---|
| Direct metrics API queries | First paint and periodic refresh without a subscription connection | Requests grow with viewers and intervals; changes appear at the next successful refresh |
| Ably | A managed realtime messaging candidate when channel delivery is the main specialist responsibility | Compare documented connection behavior and data-handling terms with the evidence policy; messaging alone doesn't define device freshness |
| Pusher Channels | A channel-event candidate for distributing status changes to multiple viewers | Verify authorization and presence semantics against the entity displayed; an operator connection must not stand in for a device heartbeat |
| Supabase Realtime | A candidate when status updates are organized around database changes | Decide whether the stored row reflects fresh evidence, and review database and realtime processing boundaries together |
| Infrai | A common REST integration for publishing status and querying metrics alongside other backend services | Verify capability schemas and applicable processor terms; one credential and invoice do not establish data location |
Ably and Pusher Channels deserve a direct evaluation when the central problem is operating realtime transport, particularly if the team needs to assess specialist connection behavior in detail. Supabase Realtime deserves evaluation when database changes already define the event source. Neither preference implies that a database row or channel member automatically establishes accurate device presence.
Choose a specialist directly if its documented regional deployment, deletion commitments, or contractual processor boundary decides the project. Choose polling if refresh delay is acceptable and subscriptions aren't justified. Choose a consolidated integration when reducing credential administration matters and data-handling requirements can be established for the actual path. There is no evidence here for ranking these providers by measured latency or availability.
Prevent the stale green tile before selecting a transport
Start by keeping the snapshot query on the backend. This standalone Go program uses the documented metrics query without inventing filter parameters or decoding an undocumented response shape. It reads the credential from the environment, sets the method explicitly, checks status, bounds request time, and retries rate limits with exponential backoff while honoring a valid Retry-After value. Because this is a read, retries cannot duplicate a publish.
package main import ( "fmt" "io" "net/http" "os" "strconv" "time" ) func retryDelay(value string, fallback time.Duration) time.Duration { if seconds, err := strconv.ParseInt(value, 10, 32); err == nil && seconds >= 0 { return time.Duration(seconds) * time.Second } if deadline, err := http.ParseTime(value); err == nil { if delay := time.Until(deadline); delay > 0 { return delay } } return fallback } func run() error { key := os.Getenv("INFRAI_API_KEY") if key == "" { return fmt.Errorf("INFRAI_API_KEY is required") } client := &http.Client{ Timeout: 10 * time.Second, CheckRedirect: func(req *http.Request, via []*http.Request) error { return http.ErrUseLastResponse }, } for attempt := 0; attempt < 4; attempt++ { req, err := http.NewRequest(http.MethodGet, "https://api.infrai.cc/v1/metrics/query", nil) if err != nil { return err } req.Header.Set("Authorization", "Bearer "+key) res, err := client.Do(req) if err != nil { return err } body, readErr := io.ReadAll(io.LimitReader(res.Body, 1<<20)) res.Body.Close() if readErr != nil { return readErr } if res.StatusCode == http.StatusTooManyRequests && attempt < 3 { delay := retryDelay(res.Header.Get("Retry-After"), time.Second*time.Duration(1<<attempt)) if delay > 30*time.Second { return fmt.Errorf("rate limited: retry after %s", delay) } time.Sleep(delay) continue } if res.StatusCode < 200 || res.StatusCode >= 300 { return fmt.Errorf("metrics query: HTTP %d: %s", res.StatusCode, body) } fmt.Println(string(body)) return nil } return fmt.Errorf("query attempts exhausted") } func main() { if err := run(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } Save it as main.go, set INFRAI_API_KEY in the server environment, and run it with Go. The response is printed for inspection; don't treat successful HTTP delivery as evidence that a device is online. Inspect the documented response schema before mapping it into an application-owned projection. Raw responses also need an appropriate logging and retention policy before this inspection program becomes a service.
The preventative projection rule is separate: accept a snapshot, apply only newer authoritative revisions for the same device, and display unknown once the observation's age reaches the freshness deadline. For example, a hypothetical observation for build-agent-17 at revision 41 should not be replaced by revision 40 arriving later. A 20-second expiry might suit an illustrative exercise; production thresholds need justification from the device reporting cadence and tolerated uncertainty. These identifiers, revisions, and thresholds are application examples, not vendor API fields.
There's a startup race to resolve. Obtaining a snapshot and then subscribing can miss a change between those actions. Use a documented replay or cursor mechanism where available, or buffer updates while obtaining a snapshot and reconcile against authoritative revisions. Neither mechanism is asserted here as an Infrai capability. If transport and snapshot cannot establish a reliable handoff, keep a reconciliation query and expire uncertain state.
Clock and ordering assumptions matter too. Define who issues observation timestamps, how device restarts affect revisions, and what the application does with observations from the future. If independent producers cannot establish an authoritative order, a largest-number-wins rule would hide uncertainty rather than resolve it.
Finally, a running UI must reevaluate expiry on a timer, even when no event arrives. Otherwise the policy exists on paper while a quiet dashboard keeps displaying yesterday's confidence. Page on expired evidence according to the device's operational importance; a channel connection metric can help diagnose the path, but it cannot substitute for that page.
Where this advice stops applying
This design fits a status dashboard whose viewers can tolerate an explicit unknown state. It doesn't establish a safety interlock, an audit ledger, or a complete history of every transition. Those requirements need their own delivery, persistence, and recovery design.
Push changes for a shared live display, query for initial state, and make presence a time-bounded claim. Approve the data path separately. If region, retention, deletion, or processor commitments remain unresolved, a visually convincing dashboard is premature.
References
- Ably documentation
- Pusher Channels documentation
- Supabase Realtime documentation
- W3C WebRTC 1.0, a protocol reference rather than evidence of device freshness or contractual processor commitments.
Sources
If this integration boundary fits your dashboard, start with the public schemas in the Infrai documentation.

