Everything on this page is published OpenTelemetry. There is no Rocketgraph browser SDK, and there will not be one — your instrumentation stays portable to any OTLP backend.
Install
Sessions
A session id turns a page load, four fetches, and the backend work they caused into one person trying to do one thing. Do not write your own — OpenTelemetry publishes generation, persistence, idle rotation, and span stamping.createSessionSpanProcessor(sessionManager) writes session.id onto every span. Its interface is getSessionId(): string | null.
Your own attributes
This is the only code you write, and it is the only part specific to your business.onStart runs per span and sees what the app knows at that moment.
Name keys in dotted namespaces (tenant.plan, checkout.version). Cohorts discovers dimensions by sampling attribute keys and filtering on cardinality, so a key that reads like a dimension becomes one, and a key that behaves like an identifier is filtered out.
Carry the session to your backend
traceparent links spans into one trace and carries no attributes at all. Your backend spans know they share a trace and nothing else. To get session.id onto them, use the other W3C header: baggage.
Wire it up
BatchSpanProcessor last.
Auto-instrumentation
Real user clicks
instrumentation-user-interaction opens a span for each real click and runs your handler inside that span’s context — so the fetch it fires becomes a child of the click, not a sibling. One tree per user action:
eventNames. The default set includes mousedown and mouseup, which triples every interaction for no extra information.
Span names come from the DOM target. On an app with generated class names they are unreadable, so add a
data-* convention on the elements you care about. Client-side route changes are not captured — emit a span on pathname change if you need them.Send spans to your own origin
Point the browser at your own server and forward to Rocketgraph from there.- No CORS. Same origin means no preflight to misconfigure, and no failure mode where spans are dropped with nothing logged anywhere.
- It is where a browser ingest key belongs. A key shipped to browsers is public by definition and needs origin checks, rate limits, and quotas.
- It is where PII scrubbing goes. URLs and attributes leak order ids and email addresses. Stripping them before storage is far cheaper than deleting them afterwards.
Receive the session on your backend
Baggage already flows — both the Python and Node SDKs shiptracecontext,baggage as default propagators, so it is extracted inbound and re-injected on outbound calls. What is missing is anything writing it onto a span.
Verify
provider.register(). That is the failure every time.
Page navigations carry no baggage — fetch and XHR do, but document loads and static assets do not — so expect partial coverage on your web tier and full coverage on everything behind it. Session drill-down scopes by trace id rather than the attribute for exactly this reason, which also means it works for a frontend that propagates nothing at all.
Next
Cohorts
Rank any attribute by failure rate, then drill into the sessions and spans behind it.
OpenTelemetry web SDK
Upstream documentation for everything on this page.