Add OTLP protocol telemetry options#1648
Merged
stephentoub merged 4 commits intoJun 16, 2026
Merged
Conversation
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>
stephentoub
reviewed
Jun 14, 2026
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>
Contributor
There was a problem hiding this comment.
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 toOTEL_EXPORTER_OTLP_PROTOCOLwhen 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
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>
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.
Summary
OTEL_EXPORTER_OTLP_PROTOCOLwhen the SDK spawns the Copilot CLI.Testing
just formatcd java && mvn spotless:applycd 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 -qcd 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_commandcd java && mvn verifyNote: full auth-dependent local E2E runs hit harness/auth isolation without
GITHUB_ACTIONS=true, so validation focused on the affected telemetry mapping paths.