mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-07-09 17:19:02 +00:00
docs(telemetry): disclose telemetry.enabled dependency on propagateTraceContext
Self-review pass on R4 commit 9bdd3bd6f flagged one footgun: both
`docs/developers/development/telemetry.md` and the settingsSchema.ts
description for `outboundCorrelation.propagateTraceContext` describe
the toggle's behavior without noting that the flag is a silent no-op
when `telemetry.enabled` is false. An operator who sets only
`outboundCorrelation.propagateTraceContext: true` and forgets the
telemetry switch gets zero behavior change — no error, no warning, no
traceparent.
Fix: add the dependency disclosure to both surfaces, plus a JSON
example showing both flags wired together for the ARMS+DashScope
cross-process trace continuation use case.
Also fix a minor comment accuracy nit at `sdk.test.ts:683`: said the
SDK installs `W3CTraceContextPropagator` instance when opt-in is true,
but the actual default is `CompositePropagator(W3CTraceContextPropagator
+ W3CBaggagePropagator)` per `@opentelemetry/sdk-node` source.
Vscode-ide-companion settings.schema.json regenerated to reflect the
expanded description string.
🤖 Generated with [Qwen Code](https://github.com/QwenLM/qwen-code)
This commit is contained in:
parent
9bdd3bd6f9
commit
0be0df270e
4 changed files with 24 additions and 5 deletions
|
|
@ -327,6 +327,24 @@ for cross-process trace stitching — e.g. ARMS Tracing serving DashScope.
|
|||
For most operators the value is `false`; cross-vendor trace continuation
|
||||
is niche.
|
||||
|
||||
**Depends on `telemetry.enabled: true`.** The OTel SDK only initializes
|
||||
when telemetry is enabled, so `propagateTraceContext` only takes effect
|
||||
in that state. Setting it to `true` while telemetry is disabled is a
|
||||
silent no-op — no SDK, no propagator, no `traceparent` on the wire.
|
||||
Verify both flags when wiring an ARMS+DashScope correlation setup:
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"telemetry": {
|
||||
"enabled": true,
|
||||
"otlpTracesEndpoint": "http://tracing-analysis-...",
|
||||
},
|
||||
"outboundCorrelation": {
|
||||
"propagateTraceContext": true,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
### Other outbound correlation headers
|
||||
|
||||
`X-Qwen-Code-Session-Id` and `X-Qwen-Code-Request-Id` are **not part of
|
||||
|
|
|
|||
|
|
@ -1052,7 +1052,7 @@ const SETTINGS_SCHEMA = {
|
|||
properties: {
|
||||
propagateTraceContext: {
|
||||
description:
|
||||
"Inject W3C `traceparent` header on outbound `fetch` requests (LLM SDK calls, MCP StreamableHTTP, WebFetch, ...). Default: false — trace context stays internal to the operator's OTLP collector and is NOT written onto third-party request streams. Set true only when you want cross-process trace stitching with an OTel-aware LLM provider (e.g. ARMS+DashScope). Note: client HTTP spans are still emitted in either case; this flag only governs the wire `traceparent` header.",
|
||||
"Inject W3C `traceparent` header on outbound `fetch` requests (LLM SDK calls, MCP StreamableHTTP, WebFetch, ...). Default: false — trace context stays internal to the operator's OTLP collector and is NOT written onto third-party request streams. Set true only when you want cross-process trace stitching with an OTel-aware LLM provider (e.g. ARMS+DashScope). Note: client HTTP spans are still emitted in either case; this flag only governs the wire `traceparent` header. Depends on `telemetry.enabled: true` — the OTel SDK only initializes when telemetry is enabled, so this flag is a silent no-op without it.",
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -677,9 +677,10 @@ describe('Telemetry SDK', () => {
|
|||
).mockReturnValue(true);
|
||||
initializeTelemetry(mockConfig);
|
||||
// textMapPropagator is omitted from NodeSDK options → SDK installs
|
||||
// its default W3C composite propagator. Test asserts the absence
|
||||
// because the actual W3CTraceContextPropagator instance is created
|
||||
// inside @opentelemetry/sdk-node which is auto-mocked here.
|
||||
// its default `CompositePropagator` (W3CTraceContextPropagator +
|
||||
// W3CBaggagePropagator). Test asserts the absence at the constructor
|
||||
// boundary because the default composite is constructed inside
|
||||
// @opentelemetry/sdk-node, which is auto-mocked here.
|
||||
expect(getTextMapPropagator()).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"propagateTraceContext": {
|
||||
"description": "Inject W3C `traceparent` header on outbound `fetch` requests (LLM SDK calls, MCP StreamableHTTP, WebFetch, ...). Default: false — trace context stays internal to the operator's OTLP collector and is NOT written onto third-party request streams. Set true only when you want cross-process trace stitching with an OTel-aware LLM provider (e.g. ARMS+DashScope). Note: client HTTP spans are still emitted in either case; this flag only governs the wire `traceparent` header.",
|
||||
"description": "Inject W3C `traceparent` header on outbound `fetch` requests (LLM SDK calls, MCP StreamableHTTP, WebFetch, ...). Default: false — trace context stays internal to the operator's OTLP collector and is NOT written onto third-party request streams. Set true only when you want cross-process trace stitching with an OTel-aware LLM provider (e.g. ARMS+DashScope). Note: client HTTP spans are still emitted in either case; this flag only governs the wire `traceparent` header. Depends on `telemetry.enabled: true` — the OTel SDK only initializes when telemetry is enabled, so this flag is a silent no-op without it.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue