feat: add OpenTelemetry support across all SDKs#785
Conversation
Cross-SDK Consistency Review: OpenTelemetry SupportI've reviewed this PR for cross-SDK consistency across all four language implementations (Node.js, Python, Go, .NET). Overall, the implementation is very well done with excellent feature parity! 🎉 ✅ Consistent Across All SDKsThe following features are implemented consistently across all languages:
|
There was a problem hiding this comment.
Generated by SDK Consistency Review Agent for issue #785
| Arguments: req.Arguments, | ||
| } | ||
|
|
||
| result, err := handler(invocation) |
There was a problem hiding this comment.
Consistency suggestion: For consistency with the other SDK implementations, consider restoring the trace context before calling the handler here:
// Restore trace context (even though ToolHandler can't receive it)
ctx := contextWithTraceParent(context.Background(), req.Traceparent, req.Tracestate)
// Note: ToolHandler signature doesn't accept context.Context, so any spans created
// by the handler won't be automatically parented unless the handler manually propagates context.
result, err := handler(invocation)The other SDKs all restore trace context in their v2 handlers:
- Node.js uses
withTraceContext(traceparent, tracestate, () => handler(...)) - Python uses
with trace_context(tp, ts): result = handler(...) - .NET uses
using var _ = RestoreTraceContext(traceparent, tracestate);
While Go's limitation is well-documented in the README, adding the context restoration (even if unused) would make the intent clearer and align with the other implementations.
There was a problem hiding this comment.
Addressed in an earlier commit — we now populate ToolInvocation.TraceContext with the restored context in both the v2 (client.go) and v3 (session.go) paths. The handler receives a fully usable context.Context.
… documentation Add telemetry documentation across all SDK docs: - getting-started.md: New 'Telemetry & Observability' section with per-language examples, TelemetryConfig options table, file export example, and trace context propagation explanation - Per-SDK READMEs (Node.js, Python, Go, .NET): Add telemetry option to constructor/options lists and new Telemetry sections with language-specific examples and dependency notes - observability/opentelemetry.md: Add 'Built-in Telemetry Support' section at top with multi-language examples, options table, propagation details, and dependency matrix - docs/index.md: Update Observability description Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
37ac924 to
da436ad
Compare
✅ Cross-SDK Consistency Review: ExcellentThis PR demonstrates exemplary cross-language consistency in adding OpenTelemetry support to all four SDK implementations. Here's what I verified: ✅ Consistent Implementation Across All SDKs1. TelemetryConfig Structure — All SDKs expose the same five configuration options with appropriate naming conventions:
2. Environment Variable Mapping — Consistent across all languages:
3. Trace Context Propagation — All SDKs propagate W3C Trace Context (
4. Tool Handler Context Restoration — All SDKs restore trace context before invoking user tool handlers in both v2 RPC (
5. Telemetry Modules — Each SDK has a dedicated telemetry helper module ( 6. Documentation — Comprehensive and consistent:
📝 Known Limitation (Documented)The Go SDK has a documented limitation: the 🎯 Test CoverageAll four SDKs include telemetry unit tests:
Summary: This PR maintains feature parity and API consistency across all language implementations. No cross-SDK inconsistencies found. 🚀
|
da436ad to
37e2217
Compare
Cross-SDK Consistency Review ✅I've completed a thorough review of PR #785 for cross-language consistency across all four SDK implementations (Node.js, Python, Go, and .NET). This is an excellent example of consistent feature implementation! SummaryThis PR adds OpenTelemetry support across all SDKs with excellent consistency. The implementation maintains API parity while respecting language-specific idioms and conventions. ✅ What's Consistent1. TelemetryConfig API SurfaceAll SDKs expose the same five configuration fields with equivalent semantics:
Naming follows language conventions (camelCase, snake_case, PascalCase) appropriately. 2. Environment Variable MappingAll SDKs map the same config fields to the same CLI environment variables:
3. W3C Trace Context PropagationAll SDKs propagate
4. Telemetry Helper ModulesEach SDK has a dedicated telemetry module with equivalent functionality:
5. Graceful DegradationAll SDKs handle missing OpenTelemetry dependencies gracefully:
6. Documentation
✅ Language-Specific Design Choices (Appropriate)These differences are intentional and correct based on language idioms:
📝 Notable Design DecisionGo ToolHandler Limitation: The PR includes an appropriate comment in 🎯 VerdictNo consistency issues found. This PR exemplifies how to add a feature across multiple language SDKs while maintaining:
The implementation is ready from a cross-SDK consistency perspective. Great work! 🎉
|
Add TelemetryConfig to all four SDKs (Node, Python, Go, .NET) to configure OpenTelemetry instrumentation on the Copilot CLI process. This includes: - TelemetryConfig type with OTLP endpoint, file exporter, source name, and capture-content options, mapped to CLI environment variables - W3C Trace Context propagation (traceparent/tracestate) on session.create, session.resume, and session.send RPC calls - Trace context restoration in tool call handlers (v2 RPC and v3 broadcast) so user tool code executes within the correct distributed trace - Telemetry helper modules (telemetry.ts, telemetry.py, telemetry.go, Telemetry.cs) with unit tests - Updated generated types from latest schema Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
37e2217 to
73baf16
Compare
✅ Cross-SDK Consistency Review: PASSI've completed a comprehensive consistency review of PR #785 across all four SDK implementations (Node.js, Python, Go, .NET). This PR demonstrates excellent cross-language consistency in implementing OpenTelemetry support. ✅ Consistent Implementation Across All SDKs1. TelemetryConfig API - Fully ConsistentAll SDKs expose equivalent configuration options following language conventions:
2. W3C Trace Context Propagation - Fully ConsistentAll SDKs propagate
3. Tool Handler Trace Context Restoration - ConsistentAll SDKs restore inbound trace context before invoking tool handlers:
* Known Limitation Properly Documented: Go's current 4. CLI Environment Variable Mapping - Fully ConsistentAll SDKs set identical environment variables when spawning the CLI:
5. Test Coverage - Fully ConsistentAll SDKs include telemetry unit tests:
6. Documentation - Fully Consistent
7. Generated Types Updated - Fully ConsistentRPC request/response types updated to include SummaryThis PR maintains exceptional feature parity across all four SDK implementations. The API design is parallel, accounting appropriately for language idioms (camelCase, snake_case, PascalCase). The one limitation in Go's tool handler signature is both unavoidable (would require breaking change) and properly documented. No consistency issues found. 🎉
|
2f9499a to
71cbed5
Compare
|
@stephentoub Thanks for this! It generally looks great. I made two small alterations - hope this seems OK to you:
|
Cross-SDK Consistency ReviewI've reviewed this PR for consistency across all four SDK implementations. Overall, this is an excellent and very thorough piece of work that adds OpenTelemetry support comprehensively across all languages. The implementation is remarkably consistent, but I found one important inconsistency: ✅ Consistent Across All SDKs
|
There was a problem hiding this comment.
Generated by SDK Consistency Review Agent for issue #785
| arguments: args, | ||
| traceparent, | ||
| tracestate, | ||
| }); |
There was a problem hiding this comment.
Cross-SDK consistency note: Node.js passes traceparent/tracestate to the user handler but doesn't automatically restore the trace context. In contrast:
- Python automatically restores via
with trace_context(traceparent, tracestate): - Go automatically restores via
contextWithTraceParent() - .NET automatically restores via
using (TelemetryHelpers.RestoreTraceContext(...))
This means Node.js users must manually restore the context (as shown in the docs), while other SDK users get automatic parent-child span linking. Consider whether this is intentional or if Node.js should also automatically restore for consistency.
There was a problem hiding this comment.
This is intentional. Node.js removed the @opentelemetry/api dependency entirely, so the SDK can't auto-restore context without pulling in that package. Instead, raw traceparent/tracestate strings are passed on ToolInvocation and users who want span linkage restore it themselves (documented in the OpenTelemetry guide). Python, Go, and .NET all have OTel/Activity dependencies already, so they auto-restore.
docs/observability/opentelemetry.md
Outdated
| }); | ||
| ``` | ||
|
|
||
| For **Go**, the `ToolInvocation.TraceContext` field is a `context.Context` with the trace already restored — use it directly as the parent for your spans. For **Python** and **.NET**, extract from the raw `traceparent`/`tracestate` strings using the respective APIs. |
There was a problem hiding this comment.
Documentation accuracy issue: This states that only Go has trace context already restored, and that Python and .NET need to "extract from the raw traceparent/tracestate strings."
However, reviewing the actual implementations shows:
- Python (session.py:337): Automatically restores via
with trace_context(traceparent, tracestate): - .NET (Session.cs:419): Automatically restores via
using (TelemetryHelpers.RestoreTraceContext(...)) - Go (session.go:542): Automatically restores via
contextWithTraceParent()
So all three of these SDKs automatically restore trace context, not just Go. Only Node.js requires manual restoration by the user.
Suggest updating this section to accurately reflect the current implementations across all four languages.
There was a problem hiding this comment.
Good catch — fixed. The docs now accurately describe that Go, Python, and .NET all auto-restore trace context, and only Node.js requires manual restoration (since it has no OTel dependency).
71cbed5 to
05feedb
Compare
Replace the optional @opentelemetry/api peer dependency with a
user-provided callback approach:
- Add TraceContext interface and TraceContextProvider type
- Add onGetTraceContext callback to CopilotClientOptions
- Pass traceparent/tracestate directly on ToolInvocation for inbound context
- Remove @opentelemetry/api from peerDependencies and devDependencies
- Rewrite telemetry.ts to a simple callback-based helper (~27 lines)
- Update tests, README, and OpenTelemetry docs with wire-up examples
Users who want distributed trace propagation provide a callback:
const client = new CopilotClient({
onGetTraceContext: () => {
const carrier = {};
propagation.inject(context.active(), carrier);
return carrier;
},
});
TelemetryConfig (CLI env vars) is unchanged and requires no dependency.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
05feedb to
6c862cc
Compare
There was a problem hiding this comment.
Pull request overview
Adds OpenTelemetry integration across Node.js, Python, Go, and .NET SDKs to enable distributed tracing between SDK consumers and the Copilot CLI, including W3C Trace Context propagation and tool-handler context restoration.
Changes:
- Introduces
TelemetryConfigin each SDK and maps it to CLI environment variables to enable/export telemetry. - Propagates
traceparent/tracestateon key RPC calls (create/resume/send) and restores inbound context for tool execution. - Adds new telemetry helper modules + unit tests, updates documentation, and updates Go scenario module files to reflect new deps.
Reviewed changes
Copilot reviewed 63 out of 95 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/scenarios/transport/tcp/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/transport/tcp/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/transport/stdio/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/transport/stdio/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/transport/reconnect/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/transport/reconnect/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/tools/virtual-filesystem/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/tools/virtual-filesystem/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/tools/tool-overrides/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/tools/tool-overrides/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/tools/tool-filtering/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/tools/tool-filtering/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/tools/skills/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/tools/skills/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/tools/no-tools/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/tools/no-tools/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/tools/mcp-servers/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/tools/mcp-servers/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/tools/custom-agents/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/tools/custom-agents/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/sessions/streaming/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/sessions/streaming/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/sessions/session-resume/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/sessions/session-resume/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/sessions/infinite-sessions/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/sessions/infinite-sessions/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/sessions/concurrent-sessions/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/sessions/concurrent-sessions/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/prompts/system-message/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/prompts/system-message/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/prompts/reasoning-effort/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/prompts/reasoning-effort/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/prompts/attachments/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/prompts/attachments/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/modes/minimal/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/modes/minimal/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/modes/default/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/modes/default/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/callbacks/user-input/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/callbacks/user-input/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/callbacks/permissions/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/callbacks/permissions/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/callbacks/hooks/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/callbacks/hooks/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/bundling/fully-bundled/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/bundling/fully-bundled/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/bundling/container-proxy/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/bundling/container-proxy/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/bundling/app-direct-server/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/bundling/app-direct-server/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/bundling/app-backend-to-server/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/bundling/app-backend-to-server/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/auth/gh-app/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/auth/gh-app/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/auth/byok-openai/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/auth/byok-openai/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/auth/byok-ollama/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/auth/byok-ollama/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/auth/byok-azure/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/auth/byok-azure/go/go.sum | Updates dependency checksums for Go scenario module. |
| test/scenarios/auth/byok-anthropic/go/go.mod | Adds indirect OTel deps for Go scenario module. |
| test/scenarios/auth/byok-anthropic/go/go.sum | Updates dependency checksums for Go scenario module. |
| python/test_telemetry.py | Adds Python unit tests for trace context helpers and env-var mapping behavior. |
| python/pyproject.toml | Adds telemetry optional dependency group for opentelemetry-api. |
| python/copilot/types.py | Adds TelemetryConfig type and telemetry field on SubprocessConfig. |
| python/copilot/telemetry.py | Adds OpenTelemetry-based trace context injection/restoration helpers (optional import). |
| python/copilot/session.py | Injects outbound trace context on session.send and restores inbound context around tool handlers. |
| python/copilot/client.py | Injects trace context on create/resume; maps telemetry config to CLI env vars; restores inbound context for v2 tool calls. |
| python/copilot/init.py | Exports TelemetryConfig in the Python package API. |
| python/README.md | Documents Python telemetry configuration and install instructions. |
| nodejs/test/telemetry.test.ts | Adds Node unit tests for trace context provider and telemetry env-var mapping. |
| nodejs/test/client.test.ts | Adds Node tests asserting trace context inclusion in create/resume/send RPCs. |
| nodejs/src/types.ts | Adds TelemetryConfig, TraceContext, and onGetTraceContext typing; adds trace context fields to tool invocation. |
| nodejs/src/telemetry.ts | Adds helper to safely call user trace-context provider without SDK OTel deps. |
| nodejs/src/session.ts | Propagates outbound trace context on session.send; forwards inbound trace fields to tool handlers. |
| nodejs/src/index.ts | Re-exports telemetry-related types. |
| nodejs/src/client.ts | Maps telemetry config to CLI env vars; injects trace context into session.create/resume; forwards inbound trace fields for v2 tool calls. |
| nodejs/README.md | Documents Node telemetry config and advanced trace context propagation setup. |
| go/types.go | Adds Go TelemetryConfig and trace context fields on RPC payload structs; adds ToolInvocation.TraceContext. |
| go/telemetry.go | Adds Go helpers to inject/extract W3C trace context via global OTel propagator. |
| go/telemetry_test.go | Adds unit tests for Go trace context helpers and ToolInvocation trace restoration. |
| go/session.go | Injects trace context into session.send; restores inbound trace context for tool handlers (broadcast path). |
| go/client.go | Injects trace context into create/resume; maps telemetry config to CLI env vars; restores inbound trace context for v2 tool calls. |
| go/go.mod | Adds OTel dependency to Go module. |
| go/go.sum | Adds checksums for new Go dependencies. |
| go/README.md | Documents Go telemetry config and trace context propagation behavior. |
| dotnet/test/TelemetryTests.cs | Adds .NET unit tests for TelemetryConfig and options cloning behavior. |
| dotnet/src/Types.cs | Adds .NET TelemetryConfig and adds it to CopilotClientOptions. |
| dotnet/src/Telemetry.cs | Adds .NET helpers to read current trace context and restore inbound trace context for tool handlers. |
| dotnet/src/Session.cs | Injects trace context into session.send payload; restores inbound trace context around tool execution. |
| dotnet/src/Client.cs | Injects trace context into create/resume; maps telemetry config to CLI env vars; restores inbound trace context for v2 tool calls; updates request types. |
| dotnet/README.md | Documents .NET telemetry configuration and trace propagation. |
| docs/observability/opentelemetry.md | Adds a cross-language guide for built-in telemetry config + trace propagation and advanced examples. |
| docs/getting-started.md | Adds telemetry/observability section and configuration examples across languages. |
| docs/index.md | Updates observability docs index entry to reflect new telemetry content. |
| )) | ||
| ``` | ||
|
|
||
| Install with telemetry extras: `pip install copilot-sdk[telemetry]` (provides `opentelemetry-api`) |
| | Language | Dependency | Notes | | ||
| |---|---|---| | ||
| | Node.js | — | No dependency; provide `onGetTraceContext` callback for outbound propagation | | ||
| | Python | `opentelemetry-api` | Install with `pip install copilot-sdk[telemetry]` | |
|
|
||
| Trace context (`traceparent`/`tracestate`) is automatically propagated between the SDK and CLI on `CreateSession`, `ResumeSession`, and `Send` calls, and inbound when the CLI invokes tool handlers. | ||
|
|
||
| > **Note:** The current `ToolHandler` signature does not accept a `context.Context`, so the inbound trace context cannot be passed to handler code. Spans created inside a tool handler will not be automatically parented to the CLI's `execute_tool` span. A future version may add a context parameter. |
| // Set up W3C propagator | ||
| otel.SetTextMapPropagator(propagation.TraceContext{}) | ||
| defer otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator()) | ||
|
|
| return Activity.Current is { } activity | ||
| ? (activity.Id, activity.TraceStateString) | ||
| : (null, null); |
|
|
||
| Trace context (`traceparent`/`tracestate`) is automatically propagated between the SDK and CLI on `create_session`, `resume_session`, and `send` calls, and inbound when the CLI invokes tool handlers. | ||
|
|
||
| Install with telemetry extras: `pip install copilot-sdk[telemetry]` (provides `opentelemetry-api`) |
✅ Cross-SDK Consistency ReviewI've reviewed this PR for consistency across all four SDK implementations (Node.js/TypeScript, Python, Go, and .NET). Here are my findings: ✅ Excellent Consistency Across SDKsThis PR successfully implements OpenTelemetry support consistently across all four languages with appropriate adaptations for each ecosystem. All major features are present in all SDKs: 1. TelemetryConfig Structure ✅All four SDKs have equivalent configuration with the same 5 fields:
All map to the same environment variables and have equivalent semantics. 2. Trace Context Propagation (SDK → CLI) ✅All SDKs propagate
Design differences (documented and intentional):
3. Trace Context Restoration (CLI → SDK) ✅Both v2 RPC (
This design difference is appropriate because Node.js has no OpenTelemetry dependency, maintaining the SDK's zero-dependency philosophy for users who don't need telemetry. 4. Documentation ✅
5. Testing ✅All SDKs have telemetry tests:
🎯 ConclusionThis PR maintains excellent cross-SDK consistency while respecting language-specific conventions and dependencies. The design differences (particularly Node.js's manual trace context extraction vs. automatic restoration in other SDKs) are intentional, documented, and appropriate for each language's ecosystem. No consistency issues found. This PR is ready from a cross-SDK consistency perspective. Great work! 🚀
|
Summary
Adds OpenTelemetry integration to all four language SDKs (Node.js, Python, Go, .NET), enabling distributed tracing between SDK consumers and the Copilot CLI.
What's included
TelemetryConfigtype (all SDKs)New configuration object on
CopilotClientOptionsthat maps to CLI environment variables:otlpEndpoint→OTEL_EXPORTER_OTLP_ENDPOINTfilePath→COPILOT_OTEL_FILE_EXPORTER_PATHexporterType→COPILOT_OTEL_EXPORTER_TYPEsourceName→COPILOT_OTEL_SOURCE_NAMEcaptureContent→OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTWhen provided,
COPILOT_OTEL_ENABLED=trueis set on the spawned CLI process.W3C Trace Context propagation
traceparent/tracestatefields are now sent on:session.createsession.resumesession.sendTrace context restoration in tool handlers
Both v2 RPC (
tool.call) and v3 broadcast (tool.call.requested) tool call paths restore the inbound trace context before invoking user tool handlers, so tool execution is linked to the originating trace.Telemetry helper modules
Each SDK has a new telemetry module (
telemetry.ts,telemetry.py,telemetry.go,Telemetry.cs) with unit tests.Updated generated types
Regenerated RPC and session-event types from the latest schema to include
traceparent/tracestatefields.Documentation
Added OpenTelemetry configuration docs and per-language README sections.
This PR depends on the Copilot CLI supporting the
traceparent/tracestatefields in the RPC protocol. It will need to update to the next version of the CLI before this can move forward.Known limitation
The Go
ToolHandlertype does not accept acontext.Contextparameter, so while trace context is restored around the handler call (for theHandlePendingToolCallRPC), it cannot be passed directly into user tool code. A comment has been added noting this; a future breaking change to the handler signature would fully resolve it.