argoproj/argo-workflows · error
%s
Error message
%s
What it means
The telemetry builder's validator accumulates validation errors via recordError(format, args...) using fmt.Errorf. The message is whatever format string the calling validator passed — describing a problem found while validating telemetry attributes, metrics, buckets, descriptions, or span parentage. These errors are collected and reported together when the generator's validation pass finds the telemetry definitions inconsistent.
Solutions
- Read the recorded validation message — it states exactly which metric/attribute/definition is invalid.
- Fix the offending definition in the telemetry registry (util/telemetry package) — description, buckets, or attribute usage.
- Rerun `go run ./util/telemetry/builder` (or make codegen) until validation passes.
- Check for duplicates: instrument names and attribute keys must be unique across the registry.
Example fix
// before
Metric{Name: "pod_count"} // no description -> validator.recordError
// after
Metric{Name: "pod_count", Description: "Number of pods managed by the controller", Help: "..."} Defensive patterns
Strategy: validation
Validate before calling
// pre-check registry before the builder's validate pass
names := map[string]bool{}
for _, m := range metrics {
if m.Description == "" { return fmt.Errorf("metric %s missing description", m.Name) }
if names[m.Name] { return fmt.Errorf("duplicate metric %s", m.Name) }
names[m.Name] = true
} Try / catch
if err := runBuilder(); err != nil {
// validator errors are collected and reported together; read all messages
logger.Info(ctx, err.Error())
return err
} Prevention
- Give every new metric/attribute a description and help text at definition time.
- Keep instrument names and attribute keys unique in the registry.
- Run make codegen (which validates) before committing telemetry changes.
- Review validation messages as a batch — multiple errors are reported together.
When it happens
Trigger: Running the telemetry builder's validation where a metric/attribute definition violates a rule: e.g. missing description, invalid bucket definitions, duplicate instrument names, or span-parentage violations — each calls v.recordError with a specific message.
Common situations: Adding a new metric to the telemetry registry with an incomplete definition; renaming an attribute but missing a usage site; invalid histogram bucket config; failing validation in CI during make codegen.
Related errors
- Didn't successfully replace docs in
- Instrument called already exists
- invalid custom metric type
- invalid metric spec
- metric label ' ' is invalid: keys may only contain…
AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03).
Data as JSON: /api/errors/bf2a8e94aab5c821.
Report an issue: GitHub.
Appendix: source
Thrown at util/telemetry/builder/validate.go:14
package main
import (
"fmt"
"slices"
"strings"
)
type validator struct {
errors []error
}
func (v *validator) recordError(format string, args ...any) {
v.errors = append(v.errors, fmt.Errorf(format, args...))
}
func (v *validator) valid() bool {
return len(v.errors) == 0
}
func (v *validator) printErrors() {
for _, err := range v.errors {
fmt.Println(err)
}
fmt.Printf("%d validation errors\n", len(v.errors))
}
func (v *validator) telemetryAttributes(items []hasCommon, attributes *attributesList, context string) {
for _, item := range items {
c := item.Common()
for _, attribute := range c.Attributes {
if getAttribByName(attribute.Name, attributes) == nil {View on GitHub (pinned to 35bff19146)