Repository navigation
Conversation
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4643/ |
`startBrowserSdk()` from `@elastic/opentelemetry-browser` replaces ten hand-wired `@opentelemetry/*` packages. The SDK posts to `/v1/traces` and `/v1/logs` under `apiBasePath`, and its batch processors flush on page hide, so the custom auto-flush is gone. `tsconfig.json` now lists `node` in `types`. Without it the pre-commit `typescript-check` fails on `process`, `global` and `node:path` in files that already used them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
akira28
force-pushed
the
feature/edot-browser-0.4
branch
from
November 2, 2026 09:58
367669e to
6e66f0c
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The browser now starts telemetry with
startBrowserSdk()from@elastic/opentelemetry-browser0.4.0 instead of ten hand-wired@opentelemetry/*packages. The SDK posts to the standard/v1/tracesand/v1/logspaths, so the ALB needs matching rules before this ships.Affects:
Site UIPrompt summary: Migrate the frontend telemetry from raw OpenTelemetry packages to the Elastic EDOT browser SDK, as described in the earlier draft #4185. Rebase that work on current
mainand adapt it to the 0.4.0 release, which changed the configuration shape.Why
The frontend assembles providers, exporters, propagators and instrumentations by hand across ten packages, while the backend already uses an Elastic distribution. #4185 stalled: it conflicted with
main, and it re-added the in-app OTLP proxy that #3521 removed in favour of ALB routing. EDOT 0.4.0 also renamed its options, so that branch no longer matched the SDK.What
SDK setup
instrumentation.tsmakes onestartBrowserSdk()call.exportConfig.urlis an absolute URL built fromapiBasePath, because the SDK validates it withnew URL()and starts a no-op SDK when it fails. The synthetic-monitor check and environment detection stay.Fetch instrumentation
The
fetchoption keeps trace propagation for same-origin requests. It ignores/v1/{traces,logs,metrics}and the API availability check, so telemetry does not trace itself.Flushing
The custom
visibilitychangeflush is gone. The SDK exposes noforceFlush()any more, and the browser batch processors insdk-traceandsdk-logsalready flush when the page hides.Dependencies and types
The ten
@opentelemetry/*packages are replaced by@elastic/opentelemetry-browser.tsconfig.jsonnow listsnodeintypes; without it the pre-committypescript-checkfails onprocess,globalandnode:path.Risk: the browser posts to
/v1/traces,/v1/logsand/v1/metrics. Until the ALB and collector accept those paths, browser telemetry is dropped. Merge only after the infra change deploys. Opened as a draft for that reason.Out of scope: the backend proxy from #4185 is not brought back. The old
/v1/o/{t,l}routes keep serving already-cached pages.Verify