Elastic Distribution of OpenTelemetry Browser breaking changes
Breaking changes can impact your applications, potentially disrupting normal operations. Before you upgrade, carefully review the Elastic Distribution of OpenTelemetry breaking changes and take the necessary steps to mitigate any issues.
Webpack 4 is not officially supported
EDOT Browser no longer officially supports Webpack 4. Bundling with Webpack 4 may still work in some setups, but it is not tested or documented as a supported bundler.
Impact
- Applications that depend on the former Webpack 4 sample configuration or official support guidance no longer have a maintained reference.
- Webpack 4 does not fully support modern package features used by EDOT Browser and its OpenTelemetry dependencies (for example
package.jsonexportsandimports), so builds may require custom workarounds that are outside the supported path. Action - Upgrade to Webpack 5 or another supported bundler such as Rollup or esbuild.
- If you must stay on Webpack 4, treat any required configuration as unsupported and untested.
addObserver replaced by observe
The SDK returned by startBrowserSdk no longer exposes addObserver. Use observe(eventName, handler) to register session lifecycle callbacks. Event names are 'session:start' and 'session:end'. Each call returns its own unsubscribe function.
Impact
- TypeScript users see a compilation error if they still call
sdk.addObserver(). - At runtime,
addObserverisundefinedon the returned SDK object. - One registration per event replaces a single object with
onSessionStartedandonSessionEnded. You need separateobservecalls (and separate unsubscribe calls) if you listen to both events. Action - Replace
sdk.addObserver({ onSessionStarted, onSessionEnded })withsdk.observe('session:start', onSessionStarted)andsdk.observe('session:end', onSessionEnded)as needed. - Store and call both unsubscribe functions returned by
observewhen you tear down listeners. - Refer to Session configuration for behavior and examples.
Removal of the metrics signal
EDOT Browser no longer configures the OpenTelemetry MeterProvider or exports metrics over OTLP. The exportConfig.metricsUrl option is removed. Built-in RUM data such as Core Web Vitals and page timing continues on the logs signal.
Impact
- Application metrics created with the OpenTelemetry Metrics API (
metrics.getMeter(), counters, histograms, and so on) are no longer exported to/v1/metrics. - TypeScript users see a compilation error if they still set
exportConfig.metricsUrl. - At runtime,
exportConfig.metricsUrlis ignored. Action - Remove
exportConfig.metricsUrlfrom your configuration. - If you need the metrics signal, configure a MeterProvider and OTLP metrics export separately with the OpenTelemetry Metrics SDK.
- Update dashboards or pipelines that expected OTLP metrics from EDOT Browser. Built-in RUM measurements remain available as log records; refer to Metrics, traces, and logs.
Removal of enabled in instrumentation configuration
With the update to @opentelemetry/browser-instrumentation 0.11.0, per-instrumentation configuration objects no longer support an enabled option. EDOT Browser always registers the built-in instrumentations and uses disableInstrumentations to turn off selected defaults.
Impact
- TypeScript users see a compilation error if
instrumentationsentries still includeenabled. - At runtime,
enabled: falseis ignored and the instrumentation keeps running unless its key is listed indisableInstrumentations. - Other options under
instrumentations['<key>']continue to apply when the instrumentation is enabled. Action - Replace patterns such as
instrumentations: { 'web-vitals': { enabled: false } }withdisableInstrumentations: ['web-vitals']. - Use
instrumentationsonly for upstream passthrough options, not to enable or disable defaults. Refer to Configure EDOT Browser.
Session sampling applies to all traces and logs
When a session is sampled out (session.sampleRate), EDOT Browser does not export traces or logs for that session. The decision applies to automatic instrumentation and to spans and log records your application creates with the OpenTelemetry Traces and Logs APIs. Built-in instrumentations may still run in the browser; export is dropped at the trace sampler and logger.
Impact
- Manual spans and log records are no longer exported for sampled-out sessions.
- In 0.4, session sampling was documented as disabling automatic instrumentations for unsampled sessions. From 0.5.0, sampling gates export of all traces and logs for the session instead.
- Metrics you configure separately with the OpenTelemetry Metrics SDK are not gated by session sampling.
Action
- Treat
session.sampleRateas applying to every trace and log your app sends through EDOT Browser, not only built-in RUM instrumentations. - If you need manual telemetry when automatic RUM is sampled out, emit it outside the EDOT Browser SDK pipeline or raise
session.sampleRate. - Refer to Session sampling and Sessions. Refer to PR #147.
Session sampling replaces root sampleRate
EDOT Browser now applies sampling at session scope. Configure the rate with session.sampleRate (0–1). The former top-level sampleRate option (trace-ID ratio sampling) is removed.
Impact
- Top-level
sampleRateis ignored at runtime. TypeScript types may still list it until updated. - Sampling is per session, not per trace ID. For a sampled session, automatic spans and log records are collected for the whole session; for an unsampled session, instrumentations are disabled.
Action
- Move
sampleRateintosession: { sampleRate: … }. - Revisit dashboards and volume estimates if you relied on trace-ID sampling for partial span volume within a single user session. Refer to PR #128.
Replacement of document load instrumentation for navigation timing
Document instrumentation (@opentelemetry/instrumentation-document-load) has been replaced by navigation-timing from @opentelemetry/browser-instrumentation. The new instrumentation emits a log records instead of a trace Span to report the timings.
Impact
- TypeScript users see a compilation error if they still use the old instrumentation key or options.
- At runtime, configuration under the old key is ignored.
- Document load no longer produce spans.
- Load timings are exported on the logs signal (/v1/logs), not traces.
Action
- Remove instrumentations['@opentelemetry/instrumentation-document-load'] configutration option.
- Update dashboards/queries that relied on document-load spans to use navigation-timing log events instead. Refer to PR #102.
In 1.0.0, the document-load instrumentation emits a documentLoad span again (root span, no resource child spans). Load timing details stay on the navigation-timing log records. Refer to the 1.0.0 release notes.
Switch to new user action instrumentation
User interaction instrumentation (@opentelemetry/instrumentation-user-interaction) has been replaced by user-action from @opentelemetry/browser-instrumentation. The new instrumentation emits log records (for example browser.user_action.click) instead of trace spans.
Impact
- TypeScript users see a compilation error if they still use the old instrumentation key or options.
- At runtime, configuration under the old key is ignored.
- Clicks no longer produce spans. Subsequent fetch / XHR spans are no longer grouped under a click parent span in trace views.
- User actions are exported on the logs signal (/v1/logs), not traces.
- submit and other event types previously configured via eventNames are not supported by user-action (only click today). This change produces a compilation error
Action
- Change instrumentations['@opentelemetry/instrumentation-user-interaction'] to instrumentations['user-action'].
- Replace eventNames with autoCapturedActions (for example ['click']).
- Replace span hooks (shouldPreventSpanCreation) with applyCustomLogRecordData.
- Update dashboards/queries that relied on user-interaction spans to use user-action log events instead. Refer to PR #101.
Configuration change for export
The export configuration (url, headers) has been grouped to a new key named
exportConfig. This aligns with the configuration type of the upstream SDK.
Impact
This change produces a compilation error if you use the SDK with TypeScript.
At runtime the old configuration options will be ignored and EDOT will export to the default
endpoint http://localhost:4318.
Action
Put the otlpEndpoint configuration value into the new key exportConfig.url.
Put the exportHeaders configuration value into the new key exportConfig.headers.
Refer to PR #100.
Configuration change in fetch instrumentation
The configuration key for fetch instrumentation has changed from
@opentelemetry/instrumentation-fetch to a shorter name fetch.
Impact
This change produces a compilation error if you use the SDK with TypeScript.
At runtime the configuration will be ignored if using the old configuration key.
Action
Change the configuration key to fetch.
Refer to PR #97.
Configuration change in XmlHttpRequest instrumentation
The configuration key for xml-http-request instrumentation has changed from
@opentelemetry/instrumentation-xml-http-request to a shorter name xhr.
Impact
This change produces a compilation error if you use the SDK with TypeScript.
At runtime the configuration will be ignored if using the old configuration key.
Action
Change the configuration key to xhr.
Refer to PR #97.
Signature change in XmlHttpRequest applyCustomAttributesOnSpan hook
The applyCustomAttributesOnSpan callback for xhr instrumentation now receives
(span, xhr) instead of (span, xhr, result).
Impact
Custom attribute hooks that read the third result argument will no
longer receive response data. TypeScript users may see compilation errors if their
hook signature still expects three arguments.
Action
Update xhr instrumentation hooks to use (span, xhr) and read
response attributes from the xhr object (for example, xhr.status) instead of
the removed third argument.
Refer to PR #97.
Removal of ignoreNetworkEvents in fetch and XmlHttpRequest instrumentations
The ignoreNetworkEvents configuration option is no longer supported for fetch
and xhr instrumentations.
Impact
If you previously set ignoreNetworkEvents: true to suppress network
events on HTTP spans, that setting is ignored and network events may appear in
exported spans again.
Action
Remove ignoreNetworkEvents from your fetch and xhr
instrumentation configuration. If you need to exclude specific requests from
tracing, use ignoreUrls instead.
Refer to PR #97.
Configuration change in navigation instrumentation
The configuration key for navigation instrumentation has changed from @opentelemetry/instrumentation-browser-navigation
to a shorter name navigation.
Impact
This change produces a compilation error if you use the SDK with TypeScript. At runtime the configuration
will be ignored if using the old configuration key.
Action
Change the configuration key to navigation.
Refer to PR #96.
Configuration change in web exception instrumentation
The configuration key for web-exception instrumentation has changed from @opentelemetry/instrumentation-web-exception
to a shorter name errors.
Impact
This change produces a compilation error if you use the SDK with TypeScript. At runtime the configuration
will be ignored if using the old configuration key.
Action
Change the configuration key to errors.
Refer to PR #95.
Configuration change in web vitals instrumentation
The configuration key for web-vitals instrumentation has changed from @opentelemetry/instrumentation-web-vitals
to a shorter name web-vitals.
Impact
This change produces a compilation error if you use the SDK with TypeScript. At runtime the configuration
will be ignored if using the old configuration key: web vitals turned off with { enabled: false } are collected again,
and hooks such as applyCustomLogRecordData stop running.
Action
Change the configuration key to web-vitals.
Refer to PR #107.