{"record":{"id":"203a1940f4793ca2","repo":"dagger/dagger","slug":"unmarshal-spans-w","errorCode":null,"errorMessage":"unmarshal spans: %w","messagePattern":"unmarshal spans: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"engine/client/client.go","lineNumber":1005,"sourceCode":"}\n\nfunc (c *Client) exportLogs(ctx context.Context, httpClient *httpClient) error {\n\t// NB: we never actually want to interrupt this, since it's relied upon for\n\t// seeing what's going on, even during shutdown\n\tctx = context.WithoutCancel(ctx)\n\n\texp := &otlpConsumer{\n\t\tpath:       \"/v1/logs\",\n\t\ttraceID:    trace.SpanContextFromContext(ctx).TraceID(),\n\t\tclientID:   c.ID,\n\t\thttpClient: httpClient,\n\t\teg:         c.telemetry,\n\t}\n\n\treturn exp.Consume(ctx, func(data []byte) error {\n\t\tvar req collogspb.ExportLogsServiceRequest\n\t\tif err := protojson.Unmarshal(data, &req); err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshal spans: %w\", err)\n\t\t}\n\t\tif err := telemetry.ReexportLogsFromPB(ctx, c.EngineLogs, &req); err != nil {\n\t\t\treturn fmt.Errorf(\"re-export logs: %w\", err)\n\t\t}\n\t\treturn nil\n\t})\n}\n\nfunc (c *Client) exportMetrics(ctx context.Context, httpClient *httpClient) error {\n\t// NB: we never actually want to interrupt this, since it's relied upon for\n\t// seeing what's going on, even during shutdown\n\tctx = context.WithoutCancel(ctx)\n\n\texp := &otlpConsumer{\n\t\tpath:       \"/v1/metrics\",\n\t\ttraceID:    trace.SpanContextFromContext(ctx).TraceID(),\n\t\tclientID:   c.ID,\n\t\thttpClient: httpClient,","sourceCodeStart":987,"sourceCodeEnd":1023,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/engine/client/client.go#L987-L1023","documentation":"The logs telemetry consumer unmarshals each SSE event as a protojson ExportLogsServiceRequest. Despite the message text saying 'unmarshal spans', this is the LOGS stream (/v1/logs); it fires when the engine's log payload fails protojson decoding.","triggerScenarios":"Engine emits log records on /v1/logs whose protojson does not decode into ExportLogsServiceRequest — engine/CLI protobuf schema mismatch, corrupted or truncated event data.","commonSituations":"Version skew after upgrading CLI or engine; payload corruption from a dying engine connection; encountering an unexpected field from a newer engine.","solutions":["Align CLI and engine versions exactly","Enable ExtraDebug logging to capture the failing payload and confirm the cause","Retry the session; transient corruption is logged as a consume warning","Check dagger issue tracker for OTLP logs decode bugs in your version pair"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"cliV, _ := daggerVersion(); engV, _ := engineVersion()\nif cliV != engV { return fmt.Errorf(\"version skew: cli=%s engine=%s\", cliV, engV) }","typeGuard":null,"tryCatchPattern":"if err := client.Close(); err != nil {\n    if strings.Contains(err.Error(), \"unmarshal spans:\") {\n        slog.Warn(\"dropped undecodable log payload (usually version skew)\", \"err\", err)\n        return nil\n    }\n    return err\n}","preventionTips":["Upgrade CLI and engine in lockstep","Treat single consume warnings as non-fatal; investigate only if persistent","Capture ExtraDebug payloads when reproducing for bug reports"],"tags":["telemetry","otlp","logs","json"],"backgroundTag":"otlp-payload-unmarshal-failed","analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}