OpenTelemetry for browser applications

What OpenTelemetry can and cannot do for front-end monitoring today, how to set up browser tracing that links to back-end traces, and when a dedicated RUM tool is still needed.

On this page

What OpenTelemetry browser instrumentation covers today

OpenTelemetry can carry one telemetry standard from the browser to the back end, but the browser side is not yet production-grade in the way the server side is. The browser client instrumentation is experimental and, according to the OpenTelemetry browser documentation, mostly unspecified, so APIs, package names and default behavior can change between releases. The Collector and back-end side is the mature part: the Collector is a vendor-agnostic way to receive, process and export telemetry, and it can accept browser-originated data just as it accepts data from services. Treat the browser layer as a pilot with a defined exit test, not as a settled foundation for alerting or SLOs.

This page covers what the browser SDK can capture today, the difference between document load and fetch tracing, how to pass a trace context from a page request to back-end spans, and where a dedicated real user monitoring (RUM) tool still fills gaps. It does not repeat Collector deployment or backend choices, which are covered in the sibling pipeline and backend sections. Before you commit, confirm with your team the exact browser SDK packages and versions you plan to pin, and check the current maturity notes for each instrumentation you intend to use. The decision you should be able to make after reading is whether browser traces are good enough for a defined set of user journeys, and which signals (performance timing, errors, user sessions, session replay) need a different tool.

Plan for two things early. First, the browser sends telemetry from devices you do not control, so the Collector endpoint must accept requests from the public internet, which means authentication, rate limits and attribute filtering become design work for the browser path specifically. Second, browser payloads can contain URLs with query strings, form data and user identifiers, so review what the instrumentation captures and use the Collector's redaction capabilities before data leaves your boundary. Ask the people who will own the pilot to name the journeys, the error budget for experimental behavior and the owner who approves an SDK upgrade.

Which browser signals OpenTelemetry handles well and which it does not

Browser telemetry is where OpenTelemetry's coverage is thinnest, because the browser client instrumentation is still experimental and mostly unspecified. The cards below separate the signals the docs support from the ones your team must verify before relying on them for user-facing monitoring.

Document load timing

Page load timing (navigation, resources and paint timings) is the most mature browser signal in the OpenTelemetry JavaScript browser packages. Confirm which timing entries the version you deploy records, how it handles single-page route changes that never trigger a full load, and whether the values match what your performance tooling reports on the same pages. Test on slow networks and older browsers your users actually run.

Browser getting started

Fetch and XHR tracing

Outgoing fetch and XMLHttpRequest calls can create client spans and propagate trace context headers to your back ends, which is what links a browser action to server traces. Verify that the traceparent header is allowed by your CORS policy and gateway, that it reaches the services you expect, and that request bodies, query strings and auth headers are excluded from span attributes.

User interaction spans

Clicks and other user actions can be turned into spans, but the docs do not define a standard set of interaction semantics for the browser. Your team decides which elements, events and route names become spans, how to avoid capturing text typed into form fields, and how to keep span names low cardinality. Expect to write and maintain this instrumentation yourself.

Browser metrics

OpenTelemetry does not provide a complete, stable set of browser metrics comparable to a dedicated RUM product. If you need Core Web Vitals, JavaScript error rates or page-level percentiles, confirm which metrics your chosen browser packages emit, how they are aggregated, and whether you must build them yourself from spans or custom instruments.

Browser logs

Client-side logs and errors need an explicit design. Confirm how uncaught exceptions and console errors are captured, whether they are exported through the browser SDK or a separate path, and how they are linked to the active trace. Plan for exporting from users' browsers to a collector endpoint that you can reach, authenticate and rate limit.

Session and user context

Session identifiers and user attributes are not defined as browser semantics, so you must choose them. Decide whether a session ID is generated and stored in the browser, how it expires, and which user identifiers are allowed. Pseudonymous IDs are safer than email addresses or account names, and any consent requirements for storing identifiers must be confirmed with your privacy team before launch.

Choosing the browser SDK setup for your application type

A single-page application loads one HTML shell and then changes views in JavaScript, so page loads no longer capture most user activity. Setup starts with the browser SDK registered once at application startup, before the framework router and HTTP client are created, so that route changes and outgoing requests are captured from the first interaction. Teams typically add the framework-specific instrumentation packages alongside the core browser packages and confirm which view changes produce spans in their own build.

  • Startup order: Register the tracer provider before the router and API client initialize, or early navigation and first requests will not be traced.
  • Propagation: Configure the fetch and XHR instrumentations to send the W3C trace context headers only to first-party API origins, so third-party calls do not receive your trace headers.
  • Exporter: Point the OTLP exporter at a first-party endpoint, since a direct export to a third-party origin adds a CORS and content blocking dependency.
  • Build pipeline: Keep the SDK version pinned, because the browser client instrumentation is still experimental and its packages change between releases.
  • Sampling and volume: Set a sampling rate in the SDK for high-traffic single-page views, because every interaction can produce spans.

Check that a route change, a failed API call and a slow view each produce a span that appears in your back end under the same trace as the server handling the request.

Setting up browser tracing with OpenTelemetry step by step

This sequence takes a team from an unconfirmed browser setup to a single trace that starts in the user's browser and continues into a back-end service, with payload and sampling choices made deliberately. Each step ends with a check you can run before moving on.

  1. Confirm the browser SDK version and stability

    Start by reading the OpenTelemetry browser documentation for the SDK packages and the stability notes that apply to client-side instrumentation. The browser documentation warns that client instrumentation for the browser is experimental and mostly unspecified, so treat every browser signal as a set of choices your team owns, not a settled standard. Record the exact package versions you intend to pin, the browser targets you must support, and the signals you plan to use. The step is done when a written note lists those versions, targets and signals, and a named engineer has approved them.

  2. Decide the exporter route through a gateway

    Decide whether browser telemetry goes directly to a back end or through an OpenTelemetry Collector gateway. A gateway accepts data from many sources and lets you apply authentication, filtering and redaction in one place before data reaches storage, which matters because browser traffic originates outside your network. Your security team should confirm the endpoint the browser calls, how that endpoint authenticates anonymous or session-based traffic, and how it limits abuse. The step is done when an architecture diagram shows the browser, the gateway, and the back end, with the gateway's receiver and exporter settings written down.

  3. Add document load and fetch instrumentation

    Add the document load instrumentation and the fetch instrumentation to the web application's startup code, then initialize the tracer provider with a service name and the exporter configured in the previous step. Document load captures page navigation and resource timing, while fetch instrumentation creates spans for outgoing HTTP calls made with the fetch API. Confirm in your browser's network panel that the export requests reach the gateway endpoint and do not block page rendering. The step is done when a test page load produces a document load span and at least one fetch span in the gateway's debug output.

  4. Configure propagation to named back-end origins

    Configure trace context propagation so that the browser adds the traceparent header only to requests sent to origins you name explicitly. Listing allowed origins keeps trace headers away from third-party domains, which should never receive your internal identifiers. Check that your back-end services accept the headers, and check any CORS policy that must allow them. Also confirm that the headers are not stripped by a proxy or content delivery network between the browser and your services. The step is done when a request to an allowed origin carries the header and a request to a third-party origin does not.

  5. Verify one trace across browser and service

    Trigger a user action in the browser that calls a back-end service instrumented with OpenTelemetry, then find the resulting trace in your back-end tool. The browser span should be the parent of the server span, and both should share one trace identifier. If the trace splits into two, check the propagation configuration, the CORS response headers and any proxy that rewrites headers. Repeat the test on each browser your team supports, because propagation behavior can differ. The step is done when a single trace shows browser and service spans joined under one trace identifier for each supported browser.

  6. Review sampling and payload contents

    Set a sampling rule for browser traces so that volume stays within what your back end and budget can handle, then review what each span and attribute contains. Remove or redact URL query strings, form values, cookies, tokens and any personal data before export, and configure the gateway's redaction processing as a second layer. Ask your privacy and security teams to sign off on the attribute list, since browser data is collected from end users. The step is done when a sample export is reviewed against the approved attribute list, and no query parameter, cookie or identifier outside that list appears in the stored spans.

How a page request becomes one trace across browser and back end

The trace starts in the user's browser, where document load and fetch instrumentation create spans and attach a trace context header to outgoing API calls. The browser exporter sends spans across the trust boundary to a Collector gateway inside the organization's network, which forwards them to back-end services and a telemetry backend. Check that the trace context header reaches each back-end service, that the gateway's endpoint is authenticated and reachable from the public internet only where you intend, and that browser-side data is scrubbed before it leaves the page.

Browser spans cross the trust boundary into the organization's Collector gateway.

Security risks of sending telemetry from the browser

Browser telemetry leaves your control the moment it is sent, so the risks sit on both sides of the connection. The cards cover what ships to the client, what personal data can slip into telemetry, how the receiving Collector is exposed, and where redaction must happen before storage.

Exporter endpoints and credentials in client code

Anything bundled into a browser script is readable by every visitor, including the exporter endpoint and any token or API key used to authenticate it. Assume the collector address will be found and abused, so treat the browser as untrusted. Check whether the front end ships a write-capable credential at all, and whether a rotated or revoked key can stop abuse without a redeploy. Confirm that the design relies on the Collector, not the browser, to hold secrets.

Collector security guidance

Personal data and tokens in URLs

Browser instrumentation records document URLs and request URLs by default, and query strings often carry session tokens, email addresses, reset codes or account identifiers. Once captured, these values appear in traces and in the backend that stores them. Review which URL parts are recorded and which request headers are attached to spans before enabling automatic fetch or document load tracing in production. Confirm this with your privacy team against the data they have classified.

Sensitive values in span attributes

Custom attributes added by front-end code often contain form values, search terms, user names or error messages that echo user input. These are easy to add during debugging and hard to notice in review. Keep a written list of permitted attribute names, and check that exception messages and event payloads do not include request bodies. Test a representative set of pages and forms and inspect the exported data before rollout.

Collector endpoints exposed to the internet

A Collector that accepts browser data must be reachable from the internet, which makes it a public ingestion point that anyone can send data to. Since Collector v0.110.0, server components bind to localhost by default rather than 0.0.0.0, but any deliberate public bind, reverse proxy or load balancer rule reopens the exposure. Place the receiver behind controlled ingress, limit request size and origins where your setup allows, and confirm the bind address in the deployed configuration.

Collector security guidance

Authentication and encryption on the Collector

Browser-facing receivers should use TLS and an authentication method that fits the threat model, since open ingestion lets anyone pollute dashboards or flood storage. Collector authenticator extensions can check incoming connections, for example with OIDC, but a token embedded in the browser is still visible to users, so pair it with rate limits and origin checks. Confirm which option your team can operate and how credentials are rotated.

Collector configuration docs

Redaction in the Collector

The Collector redaction processor can remove sensitive attributes before data reaches storage, which gives a central control that does not depend on every front-end developer. Define the attribute list from your data classification, add it to the pipeline, and test it with sample spans that contain known test values. Redaction only removes what it is configured to match, so review new attribute names in each release. Store the configuration securely and build only the components you need.

Questions buyers ask before adding browser monitoring

Does OpenTelemetry replace a dedicated RUM tool?

Not on its own, at least not for every team. OpenTelemetry is an observability framework for generating, exporting and collecting telemetry, and it is not an observability backend, so it does not store or visualize data by itself. Its browser documentation describes client instrumentation as experimental and mostly unspecified, which means the browser side is less settled than the server side. Teams that need session replay, real user performance analytics, error grouping or business-facing dashboards usually keep a RUM product for those jobs and use OpenTelemetry for the trace data that links front-end activity to back-end services. Decide per capability: list the features your product, support and performance teams rely on today, then check which ones a browser SDK and your chosen backend can cover before you retire anything. The OpenTelemetry browser guide is the place to confirm current coverage.

What does the team need in place before browser instrumentation starts?

You need a clear owner for the front end, a back-end tracing setup that already accepts OpenTelemetry data, and a plan for where browser telemetry will be stored and viewed. The browser SDK sends telemetry to a collector or backend endpoint, so the Collector pipeline, its authentication and its network path have to exist first. Someone must also decide which pages, user flows and third-party scripts are in scope, and who reviews what data leaves the browser. Front-end engineers must be able to test changes in staging and see traces end to end. Without these pieces, the browser instrumentation produces spans that nobody can query or trust. Confirm your ownership model and backend choice before writing any code.

What drives the effort of instrumenting a front end?

Effort depends on the number of application frameworks, the number of routes or user flows, and how much of the front end is built with single-page navigation. Document load and fetch tracing cover a common baseline, but each custom flow, such as checkout, login or file upload, may need manual spans and attributes that only your team can name. Other drivers include how many API domains the browser calls, whether requests cross CORS boundaries that need trace headers allowed, bundle size limits, consent banners that gate telemetry, and how much personal data could end up in span attributes. Testing across browsers and content security policies adds more time. Ask any partner to size the work by flow count, framework count and API domain count, and to show how redaction will be verified.

Can our own engineers instrument the browser without a partner?

Often yes for a basic baseline, and harder for a production rollout that must hold up to review. A team that already runs OpenTelemetry on the back end can follow the browser getting-started guide, add document load and fetch tracing, and confirm that trace IDs appear in both browser and server spans. Problems start when the work expands to privacy review, sampling decisions, custom spans for business flows, and a Collector setup that is secured and documented for your compliance team. Those tasks need time from front-end engineers, platform engineers and security reviewers at the same time. Assess your team's capacity honestly, and write down which parts you will own, which you will ask a partner to deliver, and how the handover will work.

How does browser SDK stability change over time?

Expect the browser side to move more than the server side. OpenTelemetry's stable status covers trace APIs and SDKs in most backend languages, while its browser documentation labels client instrumentation as experimental and mostly unspecified. That means package names, configuration options, semantic conventions and instrumentation behavior may change between releases. Pin your versions, read release notes before each upgrade, and keep browser instrumentation in its own configuration module so changes stay contained. Plan a test pass after each upgrade of the browser packages and the Collector. Track the status page and the Collector release history to know when a change affects your setup.

What should we confirm about browser SDK maturity before committing?

Confirm five things before committing: which browser signals are supported today, which instrumentations you need (document load, fetch, XHR, user interactions, or custom spans), whether your backend accepts browser traces with the attributes you plan to send, how the SDK behaves with your bundler and frameworks, and what happens to telemetry when a user blocks requests or loses connectivity. Also confirm how the project describes stability for each piece, since mixed maturity is common across Collector components too. Ask for a proof of concept on one real flow in a non-production environment and record what you found. The OpenTelemetry browser guide and the status page are the first places to check.

What privacy and security risks come with browser telemetry?

The main risk is that browser telemetry carries data the user never typed into a server form, including URLs with query strings, element text, headers and error messages. Those values can contain identifiers, tokens or personal data, and anything sent from the browser is visible to every user's device. Treat the browser as untrusted: avoid sending secrets, tie collection to consent where your rules require it, and use redaction before data is stored. The Collector's redaction processor can remove sensitive attributes on the server side, and the OpenTelemetry security guidance recommends encryption and authentication for Collector endpoints. Document which attributes are collected and review them with your security and privacy teams before production rollout.

Limits to confirm in your environment before you commit

Browser telemetry is the part of an OpenTelemetry rollout with the least settled ground. The cards below cover the items that decide whether browser spans will be useful, lawful and visible in your back end, and each one is a check to run before a build is scoped.

Experimental, unspecified client instrumentation

OpenTelemetry's own browser documentation says client instrumentation for the browser is experimental and mostly unspecified. That means semantic conventions, package APIs and default behavior may change between releases. Pin exact package versions, read the release notes before each upgrade, and decide in advance which browser signals you will depend on for incident response and which are only exploratory. Treat browser coverage as a moving target, not a stable contract.

Browser docs

Browser versions and frameworks in use

Instrumentation runs inside each user's browser and inside your front-end framework's build and routing model. List the browsers and versions your users actually run, including any managed or kiosk browsers in government or healthcare settings. Then confirm how your framework handles client-side route changes, so that page-load and navigation spans match what users experience. Test each supported browser and framework combination in a staging build before you rely on the data.

Consent and privacy for session data

Traces and session identifiers can carry URLs, query strings, user identifiers and form-related attributes. Decide with your privacy and legal teams what may be collected before the first build, and whether collection waits for consent in the regions you serve. Plan attribute allow lists and redaction in the Collector or the browser SDK so personal data does not reach storage. Ask the vendor or your own review which attributes each instrumentation package adds by default.

Ad blockers and network filtering

Exporter requests from the browser to your collector endpoint can be blocked by ad blockers, corporate proxies, or DNS filters that match telemetry hostnames or paths. Expect some share of sessions to be missing, and avoid assuming that a gap is a front-end failure. Test with common blockers enabled, decide whether to serve the collector from a first-party hostname you control, and document the expected loss so that dashboards are read correctly.

Back-end support for the chosen signals

A browser trace is only useful if your back end stores it and joins it to server spans. Confirm that the tracing backend accepts browser-originated spans, that trace context headers from the browser reach your services through your gateway and CORS settings, and that the metrics and logs you want from the browser have a destination. Ask which signals your chosen backend supports today and which need a separate tool, such as a dedicated RUM product.

When a dedicated RUM tool is still the better choice

OpenTelemetry does not replace a dedicated real-user monitoring (RUM) tool when the job is session replay, real-user performance analytics, error grouping or product analytics. The browser SDK and its instrumentation produce spans and can carry the trace context that links a page load or fetch to a back-end request, but they do not give you a recording of what a user saw, a ranked view of Core Web Vitals across your audience, or the grouping and triage workflow that RUM products build around front-end errors. Those are product features built on top of raw telemetry, and OpenTelemetry's browser documentation describes client instrumentation as experimental and mostly unspecified, so you should not assume a stable contract for them.

Before you decide, list the questions your front-end team actually asks each week. If they ask "what did the customer click before the payment failed," you need session replay, which is outside what OpenTelemetry covers. If they ask "which release increased error rates for Safari users in one region," you need error grouping, aggregation by browser and release, and alerting on those dimensions. If product managers ask about funnels and conversion, you need product analytics. Confirm with each RUM vendor which of these they cover, how they handle personal data in replays and inputs, and whether they can be configured to meet your data residency and retention rules. Also ask whether they accept OpenTelemetry trace context, so you know whether correlation is possible at all.

Running both is a workable pattern. Keep the OpenTelemetry browser SDK for trace context propagation and for spans that join front-end activity to the back-end traces you already collect through the Collector, and add the RUM vendor's script for replay and analytics. Agree on one trace identifier format, verify in a test environment that the traceparent header reaches your services and that both tools record the same request, and check that the RUM script does not double-instrument fetch calls or add a second set of headers. Plan for two sources of browser data with separate retention and access settings, and document which team owns each one. Your security review should cover both the script delivered to users and the data each tool sends off the device.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.