Restore OpenTelemetry stdin schema support for headers and correct sample_rate docs#7042
Conversation
headers and correct sample_rate docs
There was a problem hiding this comment.
Pull request overview
This PR restores alignment between the embedded JSON stdin schema and the gateway’s existing OpenTelemetry runtime behavior by allowing gateway.opentelemetry.headers, and it corrects documentation that incorrectly claimed JSON stdin support for sampleRate.
Changes:
- Extend the schema “fix-up” layer to inject
headersintoopentelemetryConfigso stdin validation no longer rejects a supported field. - Add tests that (1) assert the schema injection and (2) verify stdin loading accepts
gateway.opentelemetry.headersand propagates it intoGateway.Tracing. - Update OpenTelemetry docs to mark
sample_rateas TOML-only (still supported via CLI), removing the inaccurate JSON stdin claim.
Show a summary per file
| File | Description |
|---|---|
| internal/config/validation_schema.go | Injects headers into the fixed Draft-7 schema for opentelemetryConfig to match runtime support. |
| internal/config/load_from_stdin_coverage_test.go | Adds stdin coverage ensuring gateway.opentelemetry.headers validates and maps to runtime tracing config. |
| internal/config/fetch_and_fix_schema_test.go | Adds schema-level test coverage for the headers property injection. |
| docs/CONFIGURATION.md | Corrects docs to indicate sample_rate is TOML-only (not supported via JSON stdin). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot fix the failing ci check https://github.com/github/gh-aw-mcpg/actions/runs/27022710054/job/79754594049?pr=7042 |
Fixed in 5cf8bb8. I investigated the failing lint job and removed duplicate |
The stdin JSON schema still rejected
gateway.opentelemetry.headerseven though the implementation already parsed and applied it. Separately, the docs regressed to claim JSON stdin support forsampleRate, which is not implemented.Schema/runtime alignment
headersintoopentelemetryConfigRegression coverage
headersis present in the fixed OpenTelemetry schemagateway.opentelemetry.headersnow pass validation and populate tracing configDocumentation correction
sample_rateas TOML-onlysampleRate (JSON stdin)claim while keeping CLI support documentation intactBehavioral example
{ "gateway": { "port": 8080, "domain": "localhost", "apiKey": "test-key", "opentelemetry": { "endpoint": "https://otel-collector.example.com", "headers": "X-Test=value" } } }This config is now accepted by stdin schema validation and the
headersvalue is propagated into the runtime tracing configuration.