{"record":{"id":"d5d88d6fd51cea17","repo":"argoproj/argo-workflows","slug":"missing-histogram-value","errorCode":null,"errorMessage":"missing histogram.value","messagePattern":"missing histogram\\.value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/metrics/util.go","lineNumber":38,"sourceCode":"\treturn model.LegacyValidation.IsValidMetricName(string(model.LabelValue(name))) && !strings.Contains(name, `:`)\n}\n\nfunc ValidateMetricValues(metric *wfv1.Prometheus) error {\n\tif metric.Gauge != nil {\n\t\tif metric.Gauge.Value == \"\" {\n\t\t\treturn errors.New(\"missing gauge.value\")\n\t\t}\n\t\tif metric.Gauge.Realtime != nil && *metric.Gauge.Realtime {\n\t\t\tif strings.Contains(metric.Gauge.Value, \"resourcesDuration.\") {\n\t\t\t\treturn errors.New(\"'resourcesDuration.*' metrics cannot be used in real-time\")\n\t\t\t}\n\t\t}\n\t}\n\tif metric.Counter != nil && metric.Counter.Value == \"\" {\n\t\treturn errors.New(\"missing counter.value\")\n\t}\n\tif metric.Histogram != nil && metric.Histogram.Value == \"\" {\n\t\treturn errors.New(\"missing histogram.value\")\n\t}\n\treturn nil\n}\n\nfunc ValidateMetricLabels(metrics map[string]string) error {\n\tfor name := range metrics {\n\t\tif !IsValidMetricName(name) {\n\t\t\treturn fmt.Errorf(invalidMetricLabelError, name)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":20,"sourceCodeEnd":51,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/metrics/util.go#L20-L51","documentation":"ValidateMetricValues requires a Prometheus metric of type counter to provide a non-empty counter.value expression. This validation guard fires during template validation (via validateTemplate) when a workflow declares a counter metric whose value expression is missing, so the controller would have no counter value to increment.","triggerScenarios":"Thrown at workflow/metrics/util.go:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set histogram.value to an expression, e.g. '{{node.duration}}'","Remove the histogram block if not intended"],"exampleFix":null,"handlingStrategy":"validation","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"}