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>
krukow
added a commit
to copilot-community-sdk/copilot-sdk-clojure
that referenced
this pull request
Jun 18, 2026
* chore(schema): bump CLI schema 1.0.61 -> 1.0.63 and regenerate Pins @github/copilot to 1.0.63 and regenerates generated/event_specs.clj from the refreshed JSON Schemas. Pulls in new wire surface: the session.todos_changed event, optional AssistantUsageData fields (contentFilterTriggered, finishReason), ToolExecutionCompleteResult structuredContent, ToolExecutionStartData toolDescription, and the plugin/session ExtensionSource values. Upstream: github/copilot-sdk#1686 (1.0.63), commit a115246a (1.0.62). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(sync): port post-v1.0.1 config, lifecycle, and event additions Adds the public-SDK surface introduced upstream after v1.0.1: - :memory session config ({:enabled boolean}) forwarded on both create-session and resume-session, omitted when unset. github/copilot-sdk#1617 - :otlp-protocol telemetry option mapped to OTEL_EXPORTER_OTLP_PROTOCOL. github/copilot-sdk#1648 - Graceful runtime.shutdown in stop! for SDK-owned processes, bounded by a 10s timeout; force-stop! left unchanged. github/copilot-sdk#1667 - :mcp-defer-tools (#{:auto :never}) on MCP stdio/http server configs, rendered as deferTools on the wire (1.0.63 schema). - :token-prices on ::model-billing. github/copilot-sdk#1633 - Optional event-data fields surfaced by the 1.0.63 schema (assistant.usage content-filter/finish-reason, tool.execution_complete structured-content) and the :copilot/session.todos_changed public event. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(sync): cover memory, otlp, graceful shutdown, and deferTools Adds integration coverage for the new session config and wire mappings, mock-server handling for the runtime.shutdown RPC, and process-level assertions for graceful termination ordering. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(sync): document new config and bump version to 1.0.1.1 Documents :memory, :otlp-protocol, MCP :defer-tools, :token-prices, the session.todos_changed event, and graceful shutdown across API.md, the MCP overview, and CHANGELOG. Bumps the Clojure patch to 1.0.1.1. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(sync): address Copilot review feedback Resolve four findings from the Copilot Code Review bot on PR #139: - process.clj: preserve the thread interrupt flag in wait-for-exit!. .waitFor throws InterruptedException (a subclass of Exception), so the generic catch was swallowing it and clearing the interrupt flag. Catch it separately and re-set the flag via (.interrupt (Thread/currentThread)) so callers still observe cancellation. - util.clj: correct the mcp-server->wire docstring example. clj->wire produces camelCase keyword keys, not string keys. - specs.clj: fix the memory-config comment to cite upstream PR #1617 (not #1638). - CHANGELOG.md: drop the nonexistent ::memory-enabled spec reference; only ::memory exists (reusing the existing ::enabled spec). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(sync): drop non-exposed RPC method reference from todos_changed row The session.todos_changed event reference pointed Clojure users at session.plan.readSqlTodosWithDependencies(), a TS-style method call for an @experimental upstream method this SDK does not expose. Reword the row as signal-only with no payload, consistent with how the rest of the doc names JSON-RPC methods. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- 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.