Skip to content

Add OTLP protocol telemetry options#1648

Merged
stephentoub merged 4 commits into
github:mainfrom
loganrosen:loganrosen/add-otlp-protocol-options
Jun 16, 2026
Merged

Add OTLP protocol telemetry options#1648
stephentoub merged 4 commits into
github:mainfrom
loganrosen:loganrosen/add-otlp-protocol-options

Conversation

@loganrosen

@loganrosen loganrosen commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a global OTLP HTTP protocol telemetry config option across Node.js, Python, Go, .NET, Java, and Rust SDKs.
  • Map the option to OTEL_EXPORTER_OTLP_PROTOCOL when the SDK spawns the Copilot CLI.
  • Document JSON/protobuf protocol selection and update focused mapping tests.

Testing

  • just format
  • cd java && mvn spotless:apply
  • cd nodejs && npm test -- --run test/telemetry.test.ts test/e2e/client_options.e2e.test.ts -t "TelemetryConfig env var mapping|should propagate process options"
  • cd nodejs && npm test -- --run test/e2e/client_options.e2e.test.ts -t "should propagate process options"
  • cd python && uv run pytest test_telemetry.py e2e/test_client_options_e2e.py::TestClientOptions::test_should_propagate_process_options_to_spawned_cli e2e/test_telemetry_e2e.py::TestTelemetryConfig -q
  • cd go && go test . && go test ./internal/e2e -run 'TestTelemetryConfigUnit|TestClientOptionsE2E/should_propagate_process_options_to_spawned_cli'
  • cd dotnet && dotnet test test/GitHub.Copilot.SDK.Test.csproj --filter "FullyQualifiedName~GitHub.Copilot.Test.Unit.TelemetryTests|FullyQualifiedName~Should_Propagate_Process_Options_To_Spawned_Cli"
  • cd rust && cargo test --features test-support --lib otlp_http_protocol_serde_matches_env_value && cargo test --features test-support --lib telemetry_config && cargo test --features test-support --lib build_command
  • cd java && mvn verify

Note: full auth-dependent local E2E runs hit harness/auth isolation without GITHUB_ACTIONS=true, so validation focused on the affected telemetry mapping paths.

Expose OTLP HTTP protocol selection through each SDK telemetry config and map the values to the standard OpenTelemetry protocol environment variables when spawning the Copilot CLI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread dotnet/src/Types.cs Outdated
Keep the SDK telemetry API focused on the global OTLP HTTP protocol option and rely on direct environment variables for uncommon signal-specific overrides.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@loganrosen loganrosen marked this pull request as ready for review June 15, 2026 20:06
@loganrosen loganrosen requested a review from a team as a code owner June 15, 2026 20:06
Copilot AI review requested due to automatic review settings June 15, 2026 20:06

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for configuring the OTLP/HTTP protocol used by the spawned CLI’s OpenTelemetry exporter via a new otlp_protocol / otlpProtocol option across SDKs and docs.

Changes:

  • Introduce an OTLP protocol option in each SDK’s TelemetryConfig, and propagate it to OTEL_EXPORTER_OTLP_PROTOCOL when spawning the CLI.
  • Update unit/E2E tests to cover the new env var mapping.
  • Update READMEs and observability docs to document the new option and its allowed values.
Show a summary per file
File Description
rust/src/lib.rs Adds OtlpHttpProtocol enum and plumbs otlp_protocol into CLI env var injection + tests.
rust/README.md Documents Rust usage of OtlpHttpProtocol and mentions the new env var.
python/copilot/client.py Extends TelemetryConfig TypedDict and forwards OTEL_EXPORTER_OTLP_PROTOCOL on spawn.
python/test_telemetry.py Updates unit test mapping for telemetry env vars to include protocol.
python/e2e/test_telemetry_e2e.py Extends E2E coverage for default/unset and set telemetry protocol.
python/e2e/test_client_options_e2e.py Ensures protocol is propagated to the spawned CLI in E2E.
python/README.md Documents otlp_protocol option and allowed values.
nodejs/src/types.ts Adds otlpProtocol to TS TelemetryConfig type.
nodejs/src/client.ts Propagates otlpProtocol into OTEL_EXPORTER_OTLP_PROTOCOL for spawned CLI.
nodejs/test/telemetry.test.ts Extends env var mapping tests to include OTLP protocol.
nodejs/test/e2e/client_options.e2e.test.ts Validates protocol propagation in E2E capture.
nodejs/README.md Documents otlpProtocol option and allowed values.
java/src/main/java/com/github/copilot/rpc/TelemetryConfig.java Adds otlpProtocol field + getter/setter with Javadoc.
java/src/main/java/com/github/copilot/CliServerManager.java Injects OTEL_EXPORTER_OTLP_PROTOCOL into ProcessBuilder env.
java/src/test/java/com/github/copilot/TelemetryConfigTest.java Adds unit coverage for otlpProtocol getter/setter + fluent chaining.
java/src/test/java/com/github/copilot/CliServerManagerTest.java Updates telemetry setup in tests to include protocol.
go/types.go Adds OTLPProtocol field to Go TelemetryConfig.
go/client.go Injects OTEL_EXPORTER_OTLP_PROTOCOL into the CLI process env.
go/internal/e2e/telemetry_e2e_test.go Extends telemetry config tests for default/unset and set protocol.
go/internal/e2e/client_options_e2e_test.go Ensures protocol is propagated in E2E env capture.
go/README.md Documents OTLPProtocol option and allowed values.
dotnet/src/Types.cs Adds OtlpProtocol property with XML docs.
dotnet/src/Client.cs Injects OTEL_EXPORTER_OTLP_PROTOCOL into spawned CLI env.
dotnet/test/Unit/TelemetryTests.cs Extends unit tests for default/unset and set protocol.
dotnet/test/E2E/ClientOptionsE2ETests.cs Validates protocol propagation in E2E env capture.
dotnet/README.md Documents OtlpProtocol option and allowed values.
docs/observability/opentelemetry.md Adds protocol option to the cross-SDK table and explains expected values.
docs/getting-started.md Adds protocol option to the getting-started telemetry table and guidance.

Copilot's findings

  • Files reviewed: 28/28 changed files
  • Comments generated: 4

Comment thread rust/src/lib.rs
Comment thread rust/src/lib.rs
Comment thread python/copilot/client.py Outdated
Comment thread docs/observability/opentelemetry.md Outdated
loganrosen and others added 2 commits June 15, 2026 16:13
Narrow the Python OTLP protocol type, avoid hardcoding the CLI default in docs, and add Rust serde coverage tying protocol wire values to env values.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Wrap the OTLP protocol TypedDict docstring so Python CI lint passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@stephentoub stephentoub left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks

@stephentoub stephentoub added this pull request to the merge queue Jun 16, 2026
Merged via the queue into github:main with commit b5ce1c8 Jun 16, 2026
39 checks passed
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.

3 participants