Skip to content

agentHost: resolve native OTLP trace endpoints - #337783

Merged
Joaquín Ruales (jruales) merged 1 commit into
mainfrom
agents/managed-otel-regression-fix
Sep 24, 2026
Merged

Joaquín Ruales (jruales) merged 1 commit into
mainfrom
agents/managed-otel-regression-fix

Conversation

@jruales

Copy link
Copy Markdown
Contributor

Summary

Addresses the trace-routing portion of #337413.

Agent Host copied a bare collector URL such as http://localhost:4318 into the native trace-specific endpoint. Unlike a base OTLP endpoint, that value is used verbatim, so Copilot's native runtime posted traces to / instead of /v1/traces.

  • Reuse resolveOtlpTracesEndpoint when constructing native HTTP trace configuration.
  • Preserve explicit/custom paths, query parameters, gRPC endpoints, headers, and the external/base destination used by other signals.
  • Keep the DB-mode loopback unchanged, and normalize the direct fallback if DB startup fails.
  • Add regression coverage and update the Agent Host OTel documentation.

Validation

  • npm run transpile-client
  • Agent Host OTel integration suite: 19 passing.
  • Shared outbound forwarder and Agent Host configuration/managed-policy translation suites: 49 passing.
  • Targeted ESLint, git diff --check, and commit hygiene passed.
  • The new HTTP JSON/protobuf endpoint regressions failed before the production fix and pass afterward.
  • Real native SDK stdio smoke tests with a loopback-only collector fixture, no account or model turn:
    • Release SDK 1.0.15-unstable.35393089353.gfc44743.
    • Current checkout SDK 1.0.15-preview.2.
    • For both SDKs and both JSON/protobuf: before the fix, POST / received 404; afterward, POST /v1/traces received 200.

The native smoke tests used a strict local collector fixture, not the official OpenTelemetry Collector.

Scope

This fixes endpoint routing once telemetry configuration reaches the runtime. It does not resolve the separate native managed-telemetry initialization/enforcement gap or the governed-identity portion of #337413, so that issue remains open.

Resolve bare HTTP collector URLs before forwarding them as native trace-specific endpoints. Preserve explicit paths, gRPC, other signal destinations, and DB-mode routing, including startup-failure fallback.

Related to #337413.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 24, 2026 19:25
@jruales
Joaquín Ruales (jruales) marked this pull request as ready for review September 24, 2026 19:27
@jruales
Joaquín Ruales (jruales) marked this pull request as draft September 24, 2026 19:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused implementation preserves existing routing semantics and includes appropriate regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes Agent Host native OTLP/HTTP trace routing so base collector URLs target /v1/traces.

Changes:

  • Resolves HTTP trace endpoints while preserving gRPC and other signal destinations.
  • Covers pass-through and DB-fallback behavior.
  • Documents endpoint-routing semantics.
File Description
src/​vs/​platform/​agentHost/​node/​otel/​agentHostOTelService.ts Resolves native HTTP trace endpoints.
src/​vs/​platform/​agentHost/​common/​otel/​agentHostOTelService.ts Clarifies the trace endpoint contract.
src/​vs/​platform/​agentHost/​test/​node/​otel/​agentHostOTelService.integrationTest.ts Adds routing regression coverage.
src/​vs/​platform/​agentHost/​OTEL.md Documents pass-through routing behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: ceeb50ec Current: 8445dd69

Changed (1)

imageCarousel/imageCarousel/SingleSectionMiddleImage/Light
Before After
before after

1 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

@jruales
Joaquín Ruales (jruales) merged commit 3452ab2 into main Sep 24, 2026
56 of 57 checks passed
@jruales
Joaquín Ruales (jruales) deleted the agents/managed-otel-regression-fix branch September 24, 2026 21:22
@vs-code-engineering vs-code-engineering Bot added this to the 1.140.0 milestone Sep 24, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Nov 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants