{"record":{"id":"a5f05285f9842fdd","repo":"argoproj/argo-workflows","slug":"metrics-registercallback-to-invalid-type-s-t","errorCode":null,"errorMessage":"Metrics registerCallback() to invalid type %s (%t)","messagePattern":"Metrics registerCallback\\(\\) to invalid type (.+?) \\(%t\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/telemetry/operators.go","lineNumber":61,"sourceCode":"\t\t(*inst).Record(ctx, val, i.attributes(ctx, attribs))\n\tdefault:\n\t\tlogging.RequireLoggerFromContext(ctx).WithField(\"name\", i.name).WithField(\"type\", i.otel).Error(ctx, \"Metrics record() to invalid type\")\n\t}\n}\n\nfunc (i *Instrument) RegisterCallback(m *Metrics, f metric.Callback) error {\n\tswitch inst := i.otel.(type) {\n\tcase *metric.Float64ObservableCounter:\n\t\t_, err := (*m.otelMeter).RegisterCallback(f, *inst)\n\t\treturn err\n\tcase *metric.Float64ObservableGauge:\n\t\t_, err := (*m.otelMeter).RegisterCallback(f, *inst)\n\t\treturn err\n\tcase *metric.Int64ObservableGauge:\n\t\t_, err := (*m.otelMeter).RegisterCallback(f, *inst)\n\t\treturn err\n\tdefault:\n\t\treturn fmt.Errorf(\"Metrics registerCallback() to invalid type %s (%t)\", i.name, i.otel)\n\t}\n}\n\nfunc (i *Instrument) ObserveInt(ctx context.Context, o metric.Observer, val int64, attribs Attributes) {\n\tswitch inst := i.otel.(type) {\n\tcase *metric.Int64ObservableGauge:\n\t\to.ObserveInt64(*inst, val, i.attributes(ctx, attribs))\n\tdefault:\n\t\tlogging.RequireLoggerFromContext(ctx).WithFields(logging.Fields{\n\t\t\t\"name\": i.name,\n\t\t\t\"type\": i.otel,\n\t\t}).Error(ctx, \"Metrics observeInt() to invalid type\")\n\t}\n}\n\nfunc (i *Instrument) ObserveFloat(ctx context.Context, o metric.Observer, val float64, attribs Attributes) {\n\tswitch inst := i.otel.(type) {\n\tcase *metric.Float64ObservableGauge:","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/util/telemetry/operators.go#L43-L79","documentation":"RegisterCallback hit its default branch: the instrument being registered is not one of the supported observable otel instrument types, so the metric callback cannot be attached. Indicates an instrument-type mismatch in the metrics wiring code.","triggerScenarios":"Thrown at util/telemetry/operators.go:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the instrument was created as an observable counter/gauge/up-down-counter before registering callbacks","Check for mixed argo-workflows versions in the process"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}