Skip to content

[v0.13.0-beta1-m.1] detect: sever semconv relationship to otel sdk#9

Merged
smerkviladze merged 1 commit into
Mirantis:v0.13.0-beta1-m.1from
smerkviladze:mcr25-otel-schema-fix
Jul 9, 2026
Merged

[v0.13.0-beta1-m.1] detect: sever semconv relationship to otel sdk#9
smerkviladze merged 1 commit into
Mirantis:v0.13.0-beta1-m.1from
smerkviladze:mcr25-otel-schema-fix

Conversation

@smerkviladze

@smerkviladze smerkviladze commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Cherry-picked from commit 9863dd3 (9cbf3ac)

Mirantis/buildx#10 bumps google.golang.org/grpc to v1.80.0, which forces the OpenTelemetry SDK from v1.14.0 up to v1.43.0. buildkit's util/tracing/detect builds its trace resource by merging resource.Default() (schema URL follows the otel SDK version, now 1.40.0) with its own attributes pinned to semconv v1.17.0. resource.Merge refuses conflicting schema URLs, so any program vendoring this buildkit with a newer otel SDK fails as soon as an exporter is configured:

ERROR: conflicting Schema URL: https://opentelemetry.io/schemas/1.40.0 and https://opentelemetry.io/schemas/1.17.0

Backport adjustments:

  • otel.Version() instead of sdk.Version() (the otel sdk root package does not exist at v1.14.0)
  • introduce the exported detect.Resource variable, which is the override hook programs like docker/compose use

Verification:
Reproduced the schema-URL error with buildx (Mirantis/buildx#10) built against buildkit v0.13.0-beta1-m.1, then confirmed it is gone with the replace directive pointed at this branch.

Copies over the telemetry sdk detection to utilize our own version of
semconv rather than mix the versions between different packages. This
will keep a consistent schema url instead of constantly chasing
whichever one the otel sdk is using.

The only thing left from the otel sdk is `WithFromEnv` which is
schemaless and won't conflict for that reason so we can continue to use
it.

Backport adjustments for v0.13.0-beta1-m.x:
- use otel.Version() instead of sdk.Version(): the otel sdk root
  package does not exist at the otel version pinned by this branch,
  and its builtin telemetrySDK detector reports otel.Version() too
- introduce the exported Resource variable (not previously present on
  this branch) so importing programs can override the detected
  resource with one matching their own semconv schema version

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
(cherry picked from commit 9863dd3)
Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit 9cbf3ac)
Signed-off-by: Sopho Merkviladze <smerkviladze@mirantis.com>
@smerkviladze smerkviladze merged commit 29a3d33 into Mirantis:v0.13.0-beta1-m.1 Jul 9, 2026
44 of 46 checks passed
@smerkviladze smerkviladze deleted the mcr25-otel-schema-fix branch July 9, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants