Skip to content

fix(otel): build against OpenTelemetry v1.45 and otel/log v0.21 - #67

Merged
jasoet merged 1 commit into
nextfrom
fix/otel-log-attribute-api
Oct 5, 2026
Merged

jasoet merged 1 commit into
nextfrom
fix/otel-log-attribute-api

Conversation

@jasoet

@jasoet jasoet commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Why

go.opentelemetry.io/otel/log v0.21.0 removed log.KeyValue, log.Value and their constructors (log.String, log.StringValue, …) in favour of attribute.KeyValue / attribute.Value. Every release up to v3.0.0 uses the old API, so a consumer that raises otel/sdk/log to v0.21.0 — the release fixing GO-2026-6615 (BatchProcessor busy-spin when the export buffer is full) — can no longer compile otel, grpc or rest.

What

  • Raise otel, otel/sdk, otel/metric, otel/trace, otel/sdk/metric to v1.45.0 and otel/log, otel/sdk/log, otlploghttp to v0.21.0. This also clears GO-2026-6505 (otel/sdk).
  • Port log record attributes and bodies in otel, grpc and rest to the attribute package. No exported signature changes.
  • The console exporter now renders slice and map attributes through attribute.Value.AsInterface() (plain Go values) instead of the old log.Value structs.
  • The bump raises golang.org/x/net to v0.57.0, which deprecates http2/h2c. grpc/server.go keeps it under //nolint:staticcheck: http.Server.Protocols drops the HTTP/1.1 Upgrade: h2c path, so replacing it is a behaviour change for its own PR.

Not in this PR

govulncheck still reports advisories unrelated to OpenTelemetry (grpc v1.83.0, x/crypto v0.54.0, moby/go-archive, argo-workflows, Go stdlib 1.26.1).

Verification

task ci:check, go vet -tags='example integration argo' ./... and task test:integration all pass locally.

otel/log v0.21 dropped its own KeyValue and Value types for
attribute.KeyValue and attribute.Value, so the otel, grpc and rest
packages stopped compiling for any consumer that raised otel/sdk/log to
the release fixing GO-2026-6615.
@jasoet
jasoet merged commit 6264ee4 into next Oct 5, 2026
1 check passed
@jasoet
jasoet deleted the fix/otel-log-attribute-api branch October 5, 2026 04:56
jasoet added a commit that referenced this pull request Oct 5, 2026
Backport of #67 to the frozen v2 line, as an emergency patch.

## Why

`go.opentelemetry.io/otel/log` v0.21.0 replaced `log.KeyValue` /
`log.Value` with `attribute.KeyValue` / `attribute.Value`. v2.13.1 uses
the old API, so any build that also contains `otel/sdk/log` v0.21.0 —
the release fixing GO-2026-6615 — fails to compile `pkg/v2/otel`.
Consumers still reach v2 through `go-wf/v2`.

## What

- Raise `otel`, `otel/sdk`, `otel/metric`, `otel/trace`,
`otel/sdk/metric` to v1.45.0 and `otel/log`, `otel/sdk/log`,
`otlploghttp` to v0.21.0.
- Port log record attributes and bodies in `otel`, `grpc`, `rest` and
the otel logging example to the `attribute` package. No exported
signature changes.
- The console exporter renders slice and map attributes through
`attribute.Value.AsInterface()`.
- `golang.org/x/net` rises to v0.57.0, which deprecates `http2/h2c`;
`grpc/server.go` keeps it under `//nolint:staticcheck`.

## Release

This branch has no automated release; tag `v2.13.2` by hand after
merging.

## Verification

`task ci:check` passes locally (unit tests with race detector, lint).
`go vet` over the tagged examples reports only findings that predate
this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant