Skip to Content
Xeonr Developer Docs

Telemetry

Every XMB app — iPhone, iPad, Apple TV, Android, and the web player — keeps a black box: a structured stream of diagnostic events (playback lifecycles, screen changes, connectivity probes, errors) that a server admin reads back when reconstructing what happened after the fact. Hubs and grabbers ship their own log lines the same way, and the platform's task runs narrate themselves beside them, so one playback session can be read across the app, the hub and the platform in a single view.

Records are written to and read back from Lantern's client ingest at https://in.lntrn.dev, with Lantern's device tokens. The API is in neither the write path nor the read path. A device sends its batches to the ingest directly, and an admin's browser reads them back from it directly. The API's whole part is minting the short-lived tokens, because the signing key must never reach a browser, an app bundle or a customer's hub.

One service carries that surface, under xmb.api.v1:

RPCAuthWhat it does
TelemetryService.MintTelemetryTokenoptionalAn app asks for an ingest token
TelemetryService.MintTelemetryReadTokenxmb:adminAn admin asks for a read token scoped to one server

Hubs and grabbers do not call either: their credential arrives on every announce response as telemetry (a xmb.node.v1.TelemetryCredential — the ingest URL, a token, and how long it lasts). The heartbeat renews it, so a node manages one credential lifecycle rather than two. A node sends standard OTLP/HTTP — logs, traces and metrics, from the OpenTelemetry SDK — to that URL with the token as Authorization: Bearer; its calls to the API carry traceparent, so a node's work and the platform's share one trace. A platform with no Lantern signing key configured omits the field, and the mint RPCs answer Unimplemented; a client treats either as telemetry off, never as an error.

Ingest tokens

MintTelemetryToken takes which app is asking (client), the app's stable install_id — the same one playback sessions carry, which is what lets a session row and a device's trace name each other — and, optionally, the server_slug the app is signed in to plus the device's own description (app_version, os_name, os_version, model).

Authentication is optional on purpose. The errors most worth having are the ones before anyone signs in: telemetry that starts at login cannot see a blank screen on launch. An anonymous caller gets a token with no server and no user, whose records only the platform can read. A signed-in caller additionally gets their user id baked in, and — when they name a server they are a member of — that server too. Membership is checked exactly as it is for playback; naming a server while signed out is refused.

Everything baked into the token is stamped by the ingest over whatever the device sends. An app therefore cannot relabel itself as another client, attribute its records to somebody else, or file them under a server it is not on, however its bundle has been tampered with.

The response is the ingest URL (https://in.lntrn.dev), the token and expires_in. Tokens are short-lived (an hour by default); an app re-mints a minute before expiry. A client must send to the URL the response names rather than a host of its own: that is how the platform moves the write path without an app release.

Read tokens

MintTelemetryReadToken requires the xmb:admin scope and server administration of the named server_slug, which is always required: there is deliberately no way to ask for a project-wide read. The scope can narrow further to one install_id, one node (a hub or grabber the server owns or has been granted), one task_run_uuid, or one playback_session_id.

The scope rides in the token's read grant. Lantern ANDs it into every query and every live tail, so the holder can narrow but never widen — the admin UI's own filters only ever subtract. A shared hub's log is read narrowed, exactly as hub sharing describes: the lines this tenant's own requests tagged, plus the untagged machine-level remainder.

The response carries the read URL, the token and expires_in, plus the Lantern project_id, which a read does not need: the token's key decides the project. Use the URL the response names rather than a host of your own; it is configured separately from the ingest URL and the two can differ.

Read with Lantern's lantern.api.v1.ClientReadService on that URL, the token as Authorization: Bearer: ListClientLogs and ListClientEvents for history, newest first and cursor-paged, and TailClientRecords for the live tail, a stream on the same token with no ticket to exchange. The admin UI reads through @lntrn/web/read; Reading covers the calls, filters and tail behaviour. Read tokens are shorter-lived than ingest tokens (fifteen minutes by default) because they are a wider authority; the UI re-mints as it needs to, including on every tail reconnect.

What a record carries

Records are logs, metrics and events in Lantern's device format (the web player writes them with @lntrn/device). Every one carries the attributes the token asserted (service, server, user_id, and the device description for apps; service, node_id and server for nodes; service=api for the platform's own lines) plus whatever the writer adds. Attributes must be declared on the project to be kept; anything undeclared is dropped and named in the ingest's response, never rejected, so a client shipping a new field before it is declared keeps ingesting. The OpenTelemetry keys below need no declaration. The ingest never keeps username or email, even when a token asserts them; user_id is the identity.

In Lantern every record's service.name is the project's, xmb-devices (xmb-forest for records before 2026-10-16 17:30 UTC), with deployment.environment prod or stage. Which app, node or platform wrote it is the service attribute.

The declared vocabulary includes boot_id (one process lifetime — a change between adjacent records is the restart marker), playback_session_id and transcode_session_id (what stitches one play across the app, the hub and the platform), seq (per-boot ordering that survives a device's clock steps), task_run_uuid, task_key and stage_key for the platform's task lines, tenant for a shared hub's per-request attribution, and detail, one JSON attribute carrying each record's open-ended fields.

Apps also send three OpenTelemetry keys Lantern reads directly: session.id (the playback session again, so Lantern's device page stitches a play), service.version (the app's release, on every record) and, on a crash, exception.type, exception.message and exception.stacktrace with url.path for the route or screen, which is what Lantern's Issues screen groups on. Stack traces pass through the same URL stripping as everything else before they leave the device.

The web player additionally reports its browser telemetry (uncaught errors, requests that could not complete, web vitals and one span per RPC) as the separate Lantern project xmb-ui. Those records are not in the black box and an admin does not read them.

What a play's trace holds

One playback session is written by three services, each keyed by the same playback_session_id, so a read token scoped to that one attribute returns the whole story in order.

The app (service is the client: web, ios, tvos, android, …) writes its lifecycle as logs with kind set — start, attach, stall edges, engine errors, failover, seek, pause, end — and every ten seconds while playing samples playback.position_s, playback.buffered_ahead_s, playback.dropped_frames, playback.bandwidth_kbps and playback.level_bitrate_kbps. Events: playback.first_frame (time to first frame in detail), playback.rung_change, and playback.stall_ms as a metric on each stall's end.

The platform (service=api) writes playback.decide when the play is set up — direct or transcode, the reasons, the hub chosen — and playback.stop when it ends; while an encode runs, each renew samples transcode.encoded_ahead_s from the hub's reported state.

The hub (service=hub, with transcode_session_id on every record) writes the encoder's edges as events — log records named by event.name: transcode.start (plan, accel, slot wait), transcode.park, transcode.reposition, transcode.exit (killed, short, failed, how far it got) — and gauges transcode.speed_x and transcode.encoded_ahead_s every ten seconds per live encode. The serve path records histograms of serve.request_ms and serve.bytes per request and serve.segment_wait_ms per HLS segment, with tenant on a shared hub.

The open-ended fields of every event travel in detail as one JSON string, so new fields never need declaring.

The previous intake

ClientEventService (ShipClientEvents, ListClientEvents, ListClientInstalls) and the node-log intake (ShipHubLogs, ShipGrabberLogs, NodeLogService) are the pipeline this replaces. They are still accepted while app releases and the node fleet move over, and will be removed once nothing calls them. New integrations should not use them.

Retention and privacy

Lantern keeps XMB's records for 90 days. The web player's browser telemetry (xmb-ui) is kept for 14 days.

The stream is intentionally detailed: it includes which titles were played, which screens were opened, and error text, attributed to a user and a device. Server admins can read all of it for their server. Apps strip URLs to origin and path before recording them — media tokens and other query-string credentials never leave the device — but operators of multi-tenant servers should treat this surface as personal data and say so in their privacy documentation.

On this page