Skip to content

Add opt-in product telemetry for the console - #1197

Merged
railgrid-prow[bot] merged 1 commit into
railgrid:mainfrom
mjudeikis:product-telemetry
Nov 19, 2026
Merged

railgrid-prow[bot] merged 1 commit into
railgrid:mainfrom
mjudeikis:product-telemetry

Conversation

@mjudeikis

Copy link
Copy Markdown
Contributor

What

Opt-in product telemetry for the console: which pages are opened and which marked controls are clicked, reported to an analytics backend the operator runs (Umami). Off by default.

Without --telemetry-url the hub registers no telemetry route, /healthz answers "telemetry": false, and the portal records, stores and sends nothing. There is no built-in destination; Railgrid itself never phones home.

How

browser ── POST /api/telemetry/events ──▶ hub ── POST {url}/api/send ──▶ Umami
          (same origin, signed-in only)
  • Hub (pkg/hub/telemetry): a relay behind the user-only middleware, so it is not an open proxy. It validates each event, answers 204 at once and delivers from a bounded queue that drops when the backend is slow. Umami is one Sink implementation; nothing else knows about it.
  • Flags and chart: --telemetry-url + --telemetry-website-id (hub.telemetry.url / hub.telemetry.websiteID). Setting one without the other fails at startup and at helm template.
  • Portal (portal/src/telemetry): page views from router.afterEach, clicks from a document listener on [data-track]. The CSP is unchanged (connect-src 'self'). Provider UIs render in the same document, so data-track works inside them with no provider code.
  • Docs: docs/telemetry.md is the contract for what may be sent.

What is sent, and what is not

Sent: route name, route pattern (/:orgID/:workspaceID/mcp/:name), event name and data-track-* labels, arrival origin on the first page, screen size and language.

Never sent: the address bar, page titles or text, form values, user/org/workspace identity, the path inside a provider page, or the name of an organization's own provider (reported as org-provider). The hub enforces the shape too: a route with a query string, an unknown type or an oversized field is discarded there.

The hub passes the browser's IP and user agent to Umami, which hashes them into an anonymous session ID. Reporting under the same website ID as the marketing site therefore joins a visitor's site session to their console session without any identifier passing between the two. The doc states that consent is the operator's responsibility.

Tagged so far

create_workspace and enable_provider (the submit buttons; a click is the attempt, not the outcome). Everything else is page views until more data-track attributes are added.

Checked

  • go test ./pkg/hub/telemetry/ ./pkg/hub/, make lint, make verify-boilerplate.
  • Portal: vue-tsc -b, npm test (746 pass, 10 new for the tracker).
  • helm template: off renders no telemetry args; on renders both; half-configured and an extraArgs duplicate both fail.
  • The exact payloads the Umami sink produces were posted to a live Umami: stored as expected, and a site-shaped and a console-shaped event with the same IP and user agent landed in one session.

Not checked: a live hub. Route registration, the /healthz field and the portal-to-hub request have not been exercised end to end.

Off by default. With --telemetry-url and --telemetry-website-id the
portal reports route names, route patterns and clicks on data-track
elements to the hub, which relays them to an operator-run Umami. Without
the flags the hub registers no route, /healthz reports telemetry false
and the portal records and sends nothing.

The portal never sends a raw URL, page text or an identity, and the hub
discards events outside that shape. docs/telemetry.md is the contract.
@mjudeikis
mjudeikis requested a review from cwilhit as a code owner November 19, 2026 08:41
@mjudeikis

Copy link
Copy Markdown
Contributor Author

/retest

@mjudeikis

Copy link
Copy Markdown
Contributor Author

/approve

@railgrid-prow

railgrid-prow Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mjudeikis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@railgrid-prow
railgrid-prow Bot merged commit 8aa329f into railgrid:main Nov 19, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant