Repository navigation
deps: bump otel-go to v1.47.0 (OpenTelemetry 1.47) - #15261
Merged
Merged
Conversation
vito
force-pushed
the
bump-otel-go-v1.47.0
branch
from
November 24, 2026 06:00
70b1299 to
b713a2b
Compare
vito
added a commit
to dagger/go-sdk
that referenced
this pull request
Nov 24, 2026
Generated modules require otel-go v1.47.0, while an engine seeds its pre-warmed builds from dagger.io/dagger at defaultTarget, which still resolves an older otel-go: those builds match only once the engine's seed resolves the pinned otel-go too (dagger/dagger#15261 moves sdk/go there). Signed-off-by: Alex Suraci <[email protected]>
vito
force-pushed
the
bump-otel-go-v1.47.0
branch
from
November 25, 2026 16:17
b6dfdce to
e850e1b
Compare
sipsma
approved these changes
Nov 25, 2026
otel-go v1.47.0 moves to OpenTelemetry v1.47, whose log API (since v1.45) drops log.KeyValue, log.Value and log.Kind for attribute.KeyValue, attribute.Value and attribute.Type. otel-go's SpanStdio, NewWriter and GlobalWriter now take attribute.KeyValues, and ReexportLogsFromPB takes a request's []*ResourceLogs rather than the request. - Drop the replaces pinning otel/log, sdk/log and the otlplog exporters to v0.16.0 from the root module and sdk/go: otel v1.47's internal/global imports otel/log, and otel-go needs the new log API. sdk/go no longer requires gRPC: otel-go now links it only for programs that import github.com/dagger/otel-go/otlp. - Move every otel/log value to its attribute equivalent: Kind() is Type(), AsBytes() is AsByteSlice(), KeyValue.Key is an attribute.Key, and the values compare with ==. - The CLI and the engine import otel-go/otlp, so OTEL_EXPORTER_OTLP_* collectors keep OpenTelemetry's own exporters, grpc included. - The CLI's resource uses semconv v1.43.0, the schema of the SDK's detectors: with v1.40.0 every command warned of a schema URL conflict. - clientdb's attribute encoder matches otel-go's again: an empty value is an empty AnyValue, not "INVALID", and byte slices, slices and maps, new attribute types, take otel-go's conversion. - validUTF8LogValue also repairs string slices, a log value type now. - A test that built a zero sdklog.Record takes one from a provider: a zero record's attribute count limit of 0 now keeps no attributes. - google.golang.org/api moves to v0.264.0 with gRPC, which deprecates option.WithCredentialsFile: the GCP secret provider leaves GOOGLE_APPLICATION_CREDENTIALS to Application Default Credentials, which read it first already. cli-dev, engine-dev and viztest require the same otel-go, as before. Signed-off-by: Alex Suraci <[email protected]>
OpenTelemetry v1.47's LoggerProvider.Shutdown waits for every emit in flight before it shuts its processors down. The engine event emitter's drain emits into a BlockingLogProcessor, whose OnEmit waits for queue space until the processor shuts down: with Cloud unreachable and the queue full, the provider's shutdown waited out its deadline without shutting the processor down, and the drain stayed blocked for good. The drain now emits under a context Close cancels when its own context ends: the waiting emit gives up, and the events not handed over yet are counted as dropped. TestEngineEventsShutdownWithinBudget covers it. Signed-off-by: Alex Suraci <[email protected]>
Go module codegen copied sdk/go's replace directives into every module's go.mod and go.work, to pin the then-unstable OpenTelemetry log modules (otel/log, sdk/log and the otlplog exporters) to v0.16.0. sdk/go has no replaces now: the log modules are stable, at v1.47.0. Remove the copying, and engine-dev's seed module's copy of it. Modules generated before still carry the pins, and with otel v1.47, whose internal/global imports otel/log, they make an import cycle. So codegen now drops a replace of one of those modules by a v0 release of itself, from the module's go.mod and from the go.work. A replace by a local path or another module is the user's, and stays. It edits go.mod's syntax: codegen parses go.mod with modfile.ParseLax, which leaves replaces out of File.Replace. Go applies every workspace module's replaces, so while another module of the go.work still pins otel/log or sdk/log, the go.work replaces it with sdk/go's version instead, overriding the module's pin until that module is generated again. TestGo/TestStaleOTelLogReplaces builds a module whose go.mod has the pins; it failed with the import cycle before. Signed-off-by: Alex Suraci <[email protected]>
OpenTelemetry v1.47's LoggerProvider.Shutdown returns once its context ends without shutting its processors down: a processor whose emits were still waiting, such as the engine event export's BlockingLogProcessor against an unreachable Cloud, kept retrying its exports after the engine's stop, and its exporter was never shut down. enginetel.ShutdownLoggerProvider shuts the processors down itself when the provider ran out of time. The engine event export and the session's logger provider shut down through it. Close of the engine event emitter also waits, briefly, for its drain to count the events it gave up on, so the shutdown's warning reports them. Signed-off-by: Alex Suraci <[email protected]>
Go modules' go.mod changes on their next codegen: say why, and what module code using the OpenTelemetry log API must change. Signed-off-by: Alex Suraci <[email protected]>
The PR number exists now. Signed-off-by: Alex Suraci <[email protected]>
Generated module mains imported semconv v1.40.0, which otel-go v1.47 and sdk/resource no longer import (they use v1.39.0 and v1.43.0). The Go SDK prebuilds archives for what the bootstrapped module imports, so they lacked it, and prepare-go-runtime's export driver declined to load collection modules. v1.43.0 is sdk/resource's, so it is always in the archives, and its schema URL matches resource.Default's. Signed-off-by: Alex Suraci <[email protected]>
CI's go-sdk/generate/stale regenerates viztest with the released engine (v1.0.0-beta.27), whose codegen still pins otel/log to v0.16.0: with the otel v1.47 that otel-go v1.47 requires, that is an import cycle. viztest builds from its committed sources, so its go.mod, go.sum and main.go go back to what that engine generates, as on main, until CI's engine has the codegen that drops the pins. A comment in go.mod says so. Signed-off-by: Alex Suraci <[email protected]>
OpenTelemetry v1.47's SDK (resource, trace, log) uses semconv v1.43.0, and the CLI and generated modules already moved to it; every hand-written import follows, buildkit's v1.17.0 included, so one semconv version is in the graph. Every attribute key and value used keeps its spelling (service.*, test.*, exception.stacktrace), except that v1.43.0 no longer defines the gen_ai attributes: gen_ai.agent.id and gen_ai.agent.name are now telemetryattrs constants with the same keys, which the UI and Dagger Cloud match on. The tests check the literal keys. Signed-off-by: Alex Suraci <[email protected]>
semconv v1.43.0 has ExceptionStacktrace, which sets the same exception.stacktrace key the hand-built attribute did. It also changes tracing.go's size. Go caches what a source file imports by its size and modification time, and CI's checkouts give every file the same time, so with the size unchanged CI's warm Go cache still read the old semconv v1.17.0 import and failed to compile the package. Signed-off-by: Alex Suraci <[email protected]>
Go caches the imports of a package directory under a hash of its files' names, sizes and modification times. CI's checkouts give every file the same time, so the same-size v1.40.0 -> v1.43.0 import edits left CI's warm cache serving the old import lists: lint and go generate then failed with "could not import go.opentelemetry.io/otel/semconv/v1.43.0". Each affected directory gets a change, with no change in behavior: the engine names its service with semconv's helpers, tests use semconv's test status values, and TestSessionSpansNameEngine checks the engine resource as a whole. The idtui golden for the CLI resource now also checks the schema URL, which an older semconv would make conflict with the SDK's detectors. Signed-off-by: Alex Suraci <[email protected]>
The otel-go v1.47.0 tag predates otel-go's move to semconv v1.43.0, so its
fallback resource still uses semconv v1.39.0 and conflicts with OpenTelemetry
1.47's resource.Default ("conflicting Schema URL"). Tags are immutable, so per
the otel-bump policy pin the fix commit's pseudo-version instead
(e79f0e10530f) in the root, sdk/go, cli-dev and engine-dev modules. viztest
keeps its deliberate lag.
Signed-off-by: Alex Suraci <[email protected]>
go-sdk moves from v1.7.0 to v1.8.0. Its generated module mains import semconv v1.43.0, the version OpenTelemetry v1.47.0's resources use, and its generated modules require otel-go on OpenTelemetry v1.47.0. Its daggerGo is dagger/go v0.5.0, so the built-in Go SDK's dagger/go pin in sdk/go/runtime moves from 79a92be to the same commit (262b66d), as the engine image's build requires: the gobuild the image ships is then on OpenTelemetry v1.47.0 too. Every other dagger/go pin moves from c40d1b4 to v0.5.0, which holds c40d1b4's linker quoting and moves gobuild to OpenTelemetry v1.47.0. Both alpine pins move to dagger/alpine's f1e5587, the merge of its OpenTelemetry v1.47.0 bump. Regenerated with `dagger generate --go-sdk --dang-sdk` on v1.0.0-beta.27; nothing is edited by hand but dagger.toml and sdk/go/runtime/dagger-module.toml. Signed-off-by: Erik Sipsma <[email protected]>
sipsma
force-pushed
the
bump-otel-go-v1.47.0
branch
from
November 25, 2026 20:03
e850e1b to
cb14fd5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps
github.com/dagger/otel-gofromv1.43.1-0.20261102220336-aa07da582c21to the tagged v1.47.0 (diff), and with it OpenTelemetry Go from 1.43–1.46 to 1.47.0.What changed in otel-go that mattered
otel/logdroppedlog.KeyValue,log.Valueandlog.Kindforattribute.KeyValue,attribute.Valueandattribute.Type. otel-go'sSpanStdio,NewWriter,GlobalWriterandWriter.Emitnow take attribute values, andLogValueFromPB/LogValueToPBspeakattribute.Value.ReexportLogsFromPBtakes[]*ResourceLogsrather than the wholeExportLogsServiceRequest.Configured*Exporterspeak http/protobuf only; programs that want OpenTelemetry's own exporters (grpc, TLS, compression, retries) importgithub.com/dagger/otel-go/otlp.AnyValue, no longer the string"INVALID".otel/internal/globalimportsotel/log, so thereplace … otel/log => … v0.16.0pins we carried are now an import cycle; and the log SDK'sLoggerProvider.Shutdownnow waits for in-flight emits, and skips its processors entirely once its context has ended. A zerosdklog.Record's attribute count limit of 0 now keeps no attributes.What this PR does
deps: bump otel-go to v1.47.0sdk/go,cli-devandengine-devgo.mods move to otel-go v1.47.0 / otel v1.47.0 and lose thev0.16.0replace pins (vizteststays behind for now; see Temporary below).sdk/gono longer requires gRPC at all.otel/logvalue use moves toattribute(~90 files, an AST rewrite plus hand fixes):Kind()→Type(),AsBytes()→AsByteSlice(),KeyValue.Keyis anattribute.Key,Equalbecame==,Empty()isType() == attribute.EMPTY.otel-go/otlp, so a user'sOTEL_EXPORTER_OTLP_*collector keeps working over grpc as before.conflicting Schema URL.clientdb's hand-rolled attribute encoder (which must match otel-go byte for byte) encodes empty values as otel-go now does, and falls back to otel-go's conversion for byte slices, slices and maps.validUTF8LogValuealso repairs string slices, now a possible log value type.google.golang.org/apimoves to v0.264.0 with gRPC (it can't stay at v0.257.0 without downgrading otel); it deprecatesoption.WithCredentialsFile, so the GCP secret provider leavesGOOGLE_APPLICATION_CREDENTIALSto ADC, which reads it first anyway.engine: end the event drain when its stop runs outandengine: shut log processors down past the deadlineWith Cloud unreachable, the engine event drain blocked forever in
BlockingLogProcessor.OnEmit, andLoggerProvider.Shutdownthen waited for that emit until its deadline and never shut the processor down (caught byTestEngineEventsShutdownWithinBudget). The drain now emits under a context thatClosecancels when its budget runs out, and the newenginetel.ShutdownLoggerProvidershuts processors down itself when the provider ran out of time; the engine event export and the session's logger provider use it.codegen: drop the otel log replaces old SDKs wroteGo codegen used to copy
sdk/go's replaces into every generated module's go.mod/go.work; that copying (and engine-dev's seed-module copy of it) is gone. Migration: modules generated by older engines still carryreplace go.opentelemetry.io/otel/log => go.opentelemetry.io/otel/log v0.16.0(and sdk/log, otlploggrpc, otlploghttp), which would now be an import cycle. Codegen drops exactly those — a same-path replace of one of the four modules by a v0 release — from the module's go.mod and the go.work; local-path or other-module replaces stay. Since Go applies every workspace module's replaces, if a sibling module in the go.work still pins otel/log or sdk/log, the go.work instead replaces them withsdk/go's version until that sibling is regenerated. (Codegen parses go.mod withParseLax, which leaves replaces out ofFile.Replace, so this edits the syntax tree.)codegen: import semconv v1.43.0 in module mainsGenerated module mains imported
semconv/v1.40.0, which otel-go v1.47 andsdk/resourceno longer pull in (v1.39.0 / v1.43.0). The Go SDK prebuilds export archives for what the bootstrapped module imports, so they lacked it, andcodegen prepare-go-runtime(modules with+collectiontypes) failed with "the export driver declined … the listing or the archives lack packages the roots import" — the 45test-basefailures. v1.43.0 issdk/resource's, so it is always in the archives, and its schema URL matchesresource.Default's.telemetry: unify on semconv v1.43.0Every hand-written semconv import moves to v1.43.0, the version OpenTelemetry v1.47's SDK uses (engine, clientdb, dagui, core, spanfootprint, tests, and buildkit's v1.17.0). The emitted attribute keys don't change:
service.*,test.*andexception.stacktraceare spelled the same in v1.43.0. v1.43.0 no longer defines thegen_ai.*attributes, sogen_ai.agent.idandgen_ai.agent.nameare nowtelemetryattrsconstants with the same keys, and the tests assert the literal keys. Thecustom-spanidtui golden now also checks that the CLI resource's schema URL is semconv v1.43.0's.CI cache note: Go's package index caches a directory's imports keyed on its files' names, sizes and mtimes, and CI's checkouts give every file the same mtime. So same-size
v1.40.0→v1.43.0edits left CI's warm cache serving the old imports ("could not import …/semconv/v1.43.0" in lint and go generate). The follow-up commits (tracing: use semconv's ExceptionStacktrace helper,telemetry: let CI's Go cache see the semconv move) make a behavior-neutral change in each affected directory. Any future same-size import edit can hit the same thing; a lasting fix isGODEBUG=goindex=0(or real mtimes) in the CI Go toolchains.Generated files still import semconv v1.40.0 because they come from the dagger/go-sdk templates (being moved to v1.43.0 separately). They change when they're regenerated:
dagger.dispatch.gen.goof.dagger/modules/*andmodules/git-releaserdagger.gen.goofmodules/ruff,sdk/{elixir,java,php,python,typescript}/runtime,dagql/idtui/viztest{,/dep,/dep/nested-dep}dagger.gen.go/dagger.dispatch.gen.goof thecore/integration/testdatafixtureschanges: …— a.changes/unreleasedentry.Temporary
viztest: stay on released engines' otel-go—go-sdk/generate/staleregeneratesdagql/idtui/viztest(a legacyruntime = "go"module) with CI's engine, the released v1.0.0-beta.27, whose codegen still copiesreplace go.opentelemetry.io/otel/log => … v0.16.0(and sdk/log, otlplog*) into it. With otel v1.47 that is the import cycle, so the check can't pass with viztest on otel-go v1.47. viztest builds from its committed sources in the goldens, so its go.mod, go.sum and main.go stay exactly as onmain(otel-goaa07da582c21, the oldlog.KeyValueAPI), with aTEMPORARYcomment in its go.mod. Move it to otel-go v1.47 once CI's engine includes this PR. (Versioned self-replaces can't work around it: beta.27'sgo mod edit -replace path=…removes every replace of that path, versioned ones included.)Testing
go vet ./...(root,sdk/go,cli-dev,engine-dev,viztest) andgolangci-lint/lint-allpass.engine/{telemetry,server,clientdb,agentcontrol,slog,snapshots},dagql/{dagui,idtui},core,core/schema,cmd/engine,cmd/codegen/.... New:TestSyncModReplaceAndTidyDropsStaleOTelLogReplaces,TestSyncModReplaceAndTidyFixesStaleOTelLogGoWorkReplaces,TestShutdownLoggerProviderShutsProcessorsDownPastDeadline;TestMarshalKeyValueList/TestValidUTF8LogValue*cover the new value types.dagql/idtuiTestTelemetry/TestGoldenagainst a dev engine passes (goldens unchanged).TestGo/TestStaleOTelLogReplaces: a Go module whose go.mod has the old pins builds and runs on a dev engine. Before the codegen fix, the same module failed withimport cycle not allowed(otel/internal/global↔otel/log).internal/cmd/dagger'sTestInitConsoleShowsCommandsandTestDaggerCMD/TestAgentWorkspace*fail in my sandbox, identically onmain.Not changed / follow-ups
dagger.io/dagger(the go-sdk-generated testdata modules, most of.dagger/modules/*) still pin otel-goaa07da582c21/ otel 1.46, asdagger.io/dagger v1.0.0-beta.26requires; they move on their next regeneration against a new SDK. Fixtures and SDK runtimes pinned at older fixed versions (otel-go v1.41.0) are left alone.dagger.tomlpinsgithub.com/dagger/go@79a92beb…; gobuild: bump otel-go to v1.47.0 go#110 bumps its otelgotest runner pin to otel-go v1.47.0, so a follow-up can bump that pin once it merges. (engine-dev's own otelgotest build follows the root go.mod already.)