Repository navigation
Conversation
|
Pull request dashboard statusWaiting on reviewers · refreshed 2026-10-20 23:26 UTC Review the latest changes. Status above doesn't look right?
|
There was a problem hiding this comment.
🟢 Approval recommended
The supplied changes consistently implement explicit schema selection, with focused regression coverage and migration documentation and no unresolved findings.
No open issues 🎉
What changed in this PR
Completes the schema-selection migration by making InstrumenterBuilder.setSchemaUrl(...) the sole source of schema URLs across instrumenter telemetry.
Changes:
- Removes attribute-based schema inference and provider implementations.
- Adds coverage for explicit, custom, and absent schemas across signals.
- Documents the breaking change and required migration.
| File | Description |
|---|---|
| instrumentation/camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/camel/v2_20/CamelSingletons.java | Removes schema forwarding from the extractor wrapper. |
| instrumentation/aws-lambda/aws-lambda-events-common-2.2/library/src/main/java/io/opentelemetry/instrumentation/awslambdaevents/common/v2_2/internal/SpanKeyOmittingAttributesExtractor.java | Removes schema forwarding while retaining attribute delegation. |
| instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java | Tests schema propagation across spans, metrics, and logs. |
| instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/SchemaUrlProvider.java | Deletes the internal schema-provider interface. |
| instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java | Uses only explicitly selected schemas. |
| instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcAttributesExtractorTest.java | Removes obsolete schema-provider assertions. |
| instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/messaging/MessagingAttributesExtractorTest.java | Removes obsolete schema-provider coverage. |
| instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesExtractorTest.java | Removes obsolete SQL schema-provider coverage. |
| instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesExtractorTest.java | Removes obsolete database schema-provider assertions. |
| instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/builder/internal/HttpInstrumenterSchemaTest.java | Tests independence from supporting attributes and span names. |
| instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcCommonAttributesExtractor.java | Removes RPC extractor schema provision. |
| instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/messaging/MessagingAttributesExtractor.java | Removes messaging extractor schema provision. |
| instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesExtractor.java | Removes SQL extractor schema provision. |
| instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesExtractor.java | Removes database extractor schema provision. |
| docs/contributing/using-instrumenter-api.md | Explains explicit schema selection and its scope. |
| CHANGELOG.md | Records the breaking change and migration. |
Review effort: Balanced
2811749 to
9916458
Compare
| } | ||
|
|
||
| @Test | ||
| void conventionalSpanNameDoesNotSelectSchema() { |
There was a problem hiding this comment.
@copilot Simplify the schema-selection tests in this PR according to .github/instructions/java-tests.instructions.md. Update this PR directly on its existing head branch; do not create a separate follow-up PR as a workaround. Preserve its existing draft/ready state.
The requested cleanup is in instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/builder/internal/HttpInstrumenterSchemaTest.java. Remove the newly added conventionalSpanNameDoesNotSelectSchema() test: span naming never participated in schema inference, and this PR does not change that behavior. Remove the newly added attributeExtractorsDoNotSelectSchema(boolean multipleDomains) domain-combination test rather than preserving the removed inference algorithm's cases as historical-absence tests.
Keep focused central coverage of the supported schema default and explicit schema propagation, without duplicating it in HTTP or per-domain tests. The PR already adds schemaUrl_allSignals(String schemaUrl) in instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java, including a null case that omits setSchemaUrl() and explicit URLs, with span, metric, and conditional exception-log assertions. Inspect and reuse that coverage; do not add another default-schema test if it is already sufficient.
Assess the newly added supportingAttributesDoNotChangeSignalSchema() against that central all-signals test and the existing emitsHttpSchemaOnSignals() and customClientInstrumenterEmitsHttpSchema() tests. Remove it if it only repeats supported behavior those tests already establish. Retain it only if it adds distinct coverage of a supported contract that would merit testing independently of the removed inference feature. Do not add absence tests merely to prove removed functionality stays removed or to cover unrelated combinations.
Limit changes to this test cleanup and directly resulting unused imports, mocks, or fixtures. Preserve the PR's production behavior and useful existing schema coverage. Follow the repository testing guidance, run the narrowest relevant formatting and tests, and commit and push the cleanup to this PR's existing head branch.
There was a problem hiding this comment.
Removed the three redundant/non-contract tests and their unused fixtures/imports, retaining the HTTP-specific schema coverage. The focused tests and formatting checks passed. Commit: 14d292de.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: trask <218610+trask@users.noreply.github.com>
b64c2cf to
22ca7c4
Compare
Make
InstrumenterBuilder.setSchemaUrl(...)the only source of the schema URL shared by spans, operation metrics, and exception logs. The schema identifies the conventions defining those signals, independent of supporting attributes.Instrumenter.<Request, Response>builder(openTelemetry, "my-instrumentation", spanNameExtractor) + .setSchemaUrl("https://opentelemetry.io/schemas/1.41.0") .addAttributesExtractor(attributesExtractor) .buildInstrumenter();Breaking change: Builders that relied on attribute-derived schemas must add the setter shown above. Without it, telemetry has no schema URL in any mode. Explicit custom URLs remain supported.
Fourth and final layer on #20760, tracking #20755.