argoproj/argo-workflows · error

missing histogram.value

Error message

missing histogram.value

What it means

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.

Source

Thrown at workflow/metrics/util.go:38

	return model.LegacyValidation.IsValidMetricName(string(model.LabelValue(name))) && !strings.Contains(name, `:`)
}

func ValidateMetricValues(metric *wfv1.Prometheus) error {
	if metric.Gauge != nil {
		if metric.Gauge.Value == "" {
			return errors.New("missing gauge.value")
		}
		if metric.Gauge.Realtime != nil && *metric.Gauge.Realtime {
			if strings.Contains(metric.Gauge.Value, "resourcesDuration.") {
				return errors.New("'resourcesDuration.*' metrics cannot be used in real-time")
			}
		}
	}
	if metric.Counter != nil && metric.Counter.Value == "" {
		return errors.New("missing counter.value")
	}
	if metric.Histogram != nil && metric.Histogram.Value == "" {
		return errors.New("missing histogram.value")
	}
	return nil
}

func ValidateMetricLabels(metrics map[string]string) error {
	for name := range metrics {
		if !IsValidMetricName(name) {
			return fmt.Errorf(invalidMetricLabelError, name)
		}
	}
	return nil
}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Set histogram.value to an expression, e.g. '{{node.duration}}'
  2. Remove the histogram block if not intended
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at workflow/metrics/util.go:38 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/d5d88d6fd51cea17. Report an issue: GitHub.