Skip to content

fix(otel): propagate incoming trace context for HTTP requests#18800

Open
Betula-L wants to merge 1 commit intoanomalyco:devfrom
Betula-L:trace-http-context-pr
Open

fix(otel): propagate incoming trace context for HTTP requests#18800
Betula-L wants to merge 1 commit intoanomalyco:devfrom
Betula-L:trace-http-context-pr

Conversation

@Betula-L
Copy link

@Betula-L Betula-L commented Mar 23, 2026

Issue for this PR

Fixes #18801
Related to #219
Related to #12142

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This propagates incoming W3C trace context at the HTTP boundary.

If a request includes traceparent / tracestate, the server now extracts that context and runs request handling inside it. This lets request traces attach to an upstream trace instead of starting disconnected traces at the server boundary.

I kept this scoped to standard OTel/W3C propagation in core. It does not add a vendor-specific tracing backend.

How did you verify your code works?

  • bun test test/server/trace-context.test.ts
  • bun run typecheck
  • verified against a real sandbox flow with Langfuse via the existing plugin/export path

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. needs:title labels Mar 23, 2026
@github-actions
Copy link
Contributor

Hey! Your PR title trace: propagate incoming trace context for HTTP requests doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@Betula-L Betula-L changed the title trace: propagate incoming trace context for HTTP requests fix(opencode): propagate incoming trace context for HTTP requests Mar 23, 2026
@github-actions github-actions bot added needs:issue and removed needs:title needs:compliance This means the issue will auto-close after 2 hours. labels Mar 23, 2026
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@Betula-L Betula-L changed the title fix(opencode): propagate incoming trace context for HTTP requests fix(otel): propagate incoming trace context for HTTP requests Mar 23, 2026
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.

[FEATURE]: propagate incoming trace context for HTTP requests

1 participant