test(observability): verify startup with a newer host OTel SDK - #1015
test(observability): verify startup with a newer host OTel SDK#1015Kiran01bm wants to merge 7 commits into
Conversation
Host binaries embed this server as a Go module and resolve their own OpenTelemetry SDK version, so telemetry-init conflicts (such as semconv schema URL mismatches) cannot reproduce inside this module. Add a consumer test module that pins a newer otel/sdk and proves SetupTelemetry succeeds, wired into make test and the unit CI job.
There was a problem hiding this comment.
Pull request overview
Adds a “consumer module” test harness to validate SchemaBot’s telemetry startup compatibility when embedded by a host binary that resolves a newer OpenTelemetry SDK version (the real-world scenario that can trigger semconv schema URL merge conflicts).
Changes:
- Introduces a nested Go module under
e2e/consumermodule/that pins a newergo.opentelemetry.io/otel/sdkand exercisesapi.SetupTelemetry. - Wires the new consumer-module test into
make testand runs it as an explicit step in the Unit Tests GitHub Actions job. - Adds the consumer module’s
go.mod/go.sumto make the scenario deterministic and reproducible in CI.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Makefile | Adds test-consumer-module and includes it in make test. |
| e2e/consumermodule/go.mod | Defines a nested consumer module that pins newer OTel SDK versions and replaces the parent module locally. |
| e2e/consumermodule/go.sum | Captures the nested module dependency resolution for repeatable CI runs. |
| e2e/consumermodule/consumer_test.go | Adds a startup test that calls api.SetupTelemetry under a newer host OTel SDK. |
| .github/workflows/test.yaml | Runs the consumer-module startup test in the Unit Tests job. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The scenario guard could pass vacuously if the host SDK ever stopped setting a schema URL on its default resource.
…t/CI Assert against an exported schema-URL pin so the guard cannot drift from pkg/api, verify service.name survives the resource merge, drop a stale go-mysql replace the parent module no longer carries, lint the nested module, and cover its dependency delta in the CI Go cache.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Adversarial correctness review, requested by Armand and performed by his agent. Reviewed at head Verdict: this is a genuinely load-bearing test and it's safe to land. I attacked the thing that matters most for a canary test — whether it can quietly stop testing anything — and it holds: I regressed Findings1. The mirrored 2. The pre-commit hook never lints this module, so its files are only checked in CI. 3. (nit) The test isn't hermetic against OTel environment variables. Action items
Verified (tried to break, couldn't)Ran the test at head and it passes; regressed This review was generated by Claude Code (claude-opus-5). |
aparajon
left a comment
There was a problem hiding this comment.
🤖 Approving on Armand's behalf after the adversarial correctness review above (no blocking findings). This stamp was left by Claude Code (claude-opus-5).
Guard mirrored replace directives against parent go.mod drift, lint the nested module from the pre-commit hook, and pin the test to the Prometheus-only telemetry path.
|
🤖 Review response — created by Kiran's code review agent (Amp, Claude Opus 4.5) — pull/1015, All three findings addressed:
|
Summary
Add a consumer-module startup test proving a host binary with a newer OpenTelemetry SDK can initialize schemabot telemetry.
Why
Host binaries embed this server as a Go module and resolve their own OTel SDK version, so a semconv schema URL conflict in telemetry init cannot reproduce inside this module — both SDK and semconv resolve together here. The existing unit test simulates a foreign base resource, but nothing exercised the real failure mode: a consumer whose
resource.Default()carries a different schema URL than the semconv version this repo compiles against.What
e2e/consumermodule/: a nested Go module that pinsgo.opentelemetry.io/otel/sdkahead of the parent repo and callsapi.SetupTelemetry. A precondition assertion fails loudly if the pins ever drift into alignment (telling the maintainer to bump the consumer pin) so the test can't silently stop testing the conflict.make test-consumer-module, included inmake testand run as a step in the Unit Tests CI job.Verified: the test fails against the pre-fix telemetry code with
conflicting Schema URL: 1.43.0 and 1.40.0and passes on main.