Skip to content

feat(PLAT-1332): browser instrumentation - #5754

Draft
BenElferink wants to merge 20 commits into
mainfrom
cursor/browser-instrumentation-security-2830
Draft

feat(PLAT-1332): browser instrumentation#5754
BenElferink wants to merge 20 commits into
mainfrom
cursor/browser-instrumentation-security-2830

Conversation

@BenElferink

@BenElferink BenElferink commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Agent repo: https://github.com/odigos-io/opentelemetry-browser

Summary

Supersedes the security follow-up for #5129 (PLAT-1332).
Keeps the zero-code same-origin gateway (sidecar) but closes the production concerns raised in Slack:

Concern Resolution
Unauthenticated /__odigos/v1/* Bearer exportToken minted into /__odigos/config.js; required on OTLP POSTs
No rate limiting Per-IP + per-token token buckets; 1 MiB body cap
Inline window.__ODIGOS__ External /__odigos/config.js for CSP compatibility
Origin abuse Same-site Origin/CORS checks

Companion PRs: opentelemetry-browser, odigos-enterprise, vm-agent.

feat(PLAT-1332): browser instrumentation

Proof of data:

Screenshot 2026-09-08 at 16 17 56 Screenshot 2026-09-08 at 16 18 42 Screenshot 2026-09-08 at 16 20 38

BenElferink and others added 11 commits July 15, 2026 16:32
- Introduced a new browser proxy component to inject OpenTelemetry SDK into served HTML and forward telemetry to the Odigos collector.
- Updated Makefile to include build and push targets for the browser proxy.
- Added GitHub Actions workflow for building and testing the browser proxy image.
- Enhanced instrumentation configuration to support browser as a new agent category.
- Implemented necessary server logic for handling OTLP telemetry from the browser.

This commit lays the groundwork for improved browser instrumentation and telemetry collection.
Updated the QuickScan method in the BrowserInspector to use the correct ExePath field from the ProcessContext, ensuring accurate process name retrieval for static server process names.
Included the actions/setup-go@v6 step in the GitHub Actions build workflow to specify Go version 1.26.2, ensuring consistent Go environment for builds and tests.
Added logic to the IsRestartRequired function to ensure that a restart is required when a browser sidecar is present. This change addresses the unique deployment requirements for browser distributions, which necessitate a rollout for the sidecar to be injected into the pod manifest.
Adjusted the logic in the IsRestartRequired function to check for the presence of the RuntimeAgent after verifying the BrowserSidecar. This change ensures that the function correctly determines when a restart is necessary based on the distribution's configuration.
Enhanced the instrumentation configuration by introducing a new reason, BrowserPortMissing, to indicate when browser instrumentation cannot be applied due to the absence of a TCP container port. This update includes modifications to the relevant CRD, types, and logic to ensure proper handling of this scenario in the agent's behavior.
Fold browser e2e into the source scenario, publish the browser-proxy
image, add sidecar health probes, recompress gzip HTML after injection,
and skip mesh pods that would collide on iptables.

Co-authored-by: Cursor <cursoragent@cursor.com>
Chainsaw matches container slice length/order, so listing only the
sidecar failed even though injection succeeded.

Co-authored-by: Cursor <cursoragent@cursor.com>
Close the unauthenticated OTLP write path and stop injecting inline scripts.
The sidecar now serves /__odigos/config.js with a per-process export token,
requires Authorization on /__odigos/v1/*, rate-limits by IP/token, enforces
same-site Origin checks, and propagates CSP nonces onto injected script tags.

Co-authored-by: Ben <BenElferink@users.noreply.github.com>
@BenElferink BenElferink changed the title refactor: harden browser-proxy (CSP-safe config, auth OTLP, rate limits) refactor(PLAT-1332): harden browser-proxy (CSP-safe config, auth OTLP, rate limits) Sep 6, 2026
@BenElferink BenElferink changed the title refactor(PLAT-1332): harden browser-proxy (CSP-safe config, auth OTLP, rate limits) feat(PLAT-1332): browser instrumentation (hardened OSS proxy) Sep 6, 2026
@BenElferink BenElferink changed the title feat(PLAT-1332): browser instrumentation (hardened OSS proxy) feat(PLAT-1332): browser instrumentation Sep 6, 2026
Keep browser-proxy build/scan/load targets and BrowserPortMissing status
while adopting main's workflow matrix style, victoria-metrics kind load,
and EnabledWithOtherAgents agent reason.

Co-authored-by: Ben <BenElferink@users.noreply.github.com>
BenElferink and others added 5 commits September 6, 2026 16:30
Update public.ecr.aws/odigos/agents/browser-community image tag from
v0.2.0 to the newly released v0.3.0.

Co-authored-by: Ben <BenElferink@users.noreply.github.com>
Add missing browser language enum values to Actions and
InstrumentationConfig CRDs, and pass Release into the browser-proxy
imageName helper so helm lint can resolve .Release.Namespace.

Co-authored-by: Ben <BenElferink@users.noreply.github.com>
Chainsaw was failing on k8s 1.21 when Available/Progressing landed in
the opposite order even though the deployment was ready.

Co-authored-by: Ben <BenElferink@users.noreply.github.com>
cursoragent and others added 3 commits September 8, 2026 12:12
Browser-proxy and agents POST OTLP logs to the node collector :4318,
but the logs pipeline only wired filelog/eBPF. Without otlp/in as a
logs consumer, the OTLP HTTP receiver returns 404 for /v1/logs.

Co-authored-by: Ben <BenElferink@users.noreply.github.com>
During RollingUpdate maxSurge, status.replicas can briefly be 2 while
Available/readyReplicas/updatedReplicas are already 1, which flakes
trace-collection and similar suites.

Co-authored-by: Ben <BenElferink@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants