Skip to Content
Platform Ontology

OpenTelemetry in the browser (real user monitoring)

A script that packages page timings, network calls and clicks into the OpenTelemetry format and sends them to the site's collector.

Used to track youWhile you use it

OpenTelemetry is not a browser feature. It is an open standard and a set of libraries that a site loads. In the browser it reads the timing APIs the page already has (navigation, resource, paint and user timing), wraps fetch and XHR, and records clicks, then ships it all as traces and metrics. It can also stamp a trace id on requests to the site's own servers, so one visit can be followed from the click to the database.

What it can and can't do

What the user does: Nothing. It runs as the page loads and as you use it

It can

  • Time every page load, request and click
  • Tie your browser activity to the site's server logs with a shared trace id
  • Send device, browser and language details with each batch
  • Show the site exactly where a slow visit lost time

It cannot

  • Read other sites' requests or timings
  • Ask permission first
  • Get finer timers than the browser allows
  • Keep working if a blocker stops the collector address

How it differs between platforms: The data is only as identifying as what the site attaches: some add a user or session id, which turns it into a per person activity log.

Browser support

How a site asks for it

API@opentelemetry/sdk-trace-web with document-load, fetch, xml-http-request and user-interaction instrumentations; OTLP/HTTP exporter (POST /v1/traces, /v1/metrics, /v1/logs)
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
Activationnone
How long it lastsPer page; buffered spans are sent with fetch or sendBeacon and nothing is stored in the browser by default
How to take it backNothing to revoke; content blockers that block the collector address stop the export
Inside an iframePer frame; it only sees what that frame's own timing APIs and network calls expose

Typical flow

  1. Page loads the OpenTelemetry web SDK and its instrumentations
  2. SDK reads navigation and resource timing for the page load
  3. Fetch and XHR are wrapped so each request becomes a span, and a traceparent header is added for allowed origins
  4. Clicks and other events become spans or span events
  5. Batches are POSTed as OTLP to the site's collector

Data you get

What comes back: Spans, metrics and logs with nanosecond timestamps (browser timers are coarsened to about 0.1 ms or more)
Shape: list
How often: Batched, usually every few seconds and on page hide

FieldTypeUnitRangePrecision
traceIdstringNone32 hex charactersrandom per trace
span durationfloatms0 and uptimer resolution
http.url / url.fullstringNoneNot listedfull request URL
user_agent.originalstringNoneNot listedNot listed
browser.platform / browser.mobile / browser.languagestringNoneNot listedfrom User Agent Client Hints where available

Technical limits

  • It is a library, not a browser API: support is whatever the underlying APIs (Performance, PerformanceObserver, fetch) have
  • The browser client is still marked experimental by the OpenTelemetry project
  • The traceparent header goes to cross origin servers only when the site lists them, and those servers must allow it in CORS
  • Export needs the collector to allow CORS from the page origin; OTLP over HTTP usually listens on port 4318
  • Timings are limited by the browser's coarsened timers

The story

What it is

An open standard that bundles a page's timings, network calls and clicks into traces and sends them to the site.

For you

You never see it. When a site uses it, every load, request and click on that site can be timed and sent home, often with your browser and device details.

For makers

One format for front end and back end telemetry. The browser span and the server span share a trace id, so a slow checkout can be followed end to end. Any OTLP backend can receive it, so there is no lock in to one monitoring vendor.

Where you see it

TypeExampleApps
shoppingA shop follows one slow checkout from the button click through every API call to the payment service.None named
productivityA web app compares page load and request times by browser after each release.None named

Risks

  • Silent and always on where used
  • Can carry full URLs and ids
  • Links browser activity to server logs

What the platform says

Good uses and abuse

Legitimate uses

  • Real user monitoring
  • End to end tracing from click to database
  • Release and performance regression checks

Known abuse

  • Detailed per visit activity logs
  • Joining browser behavior to server side identity

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits2Rough identifying entropy, when known

History

  • 2019-05, all: OpenTracing and OpenCensus announce their merger into OpenTelemetry
  • 2021-02, all: OpenTelemetry tracing specification reaches 1.0

Sources

How well checked: Based on official documentation.

On this page