{"record":{"id":"9044500ce40ff08d","repo":"jaegertracing/jaeger","slug":"metric-storage-s-w","errorCode":null,"errorMessage":"metric storage '%s': %w","messagePattern":"metric storage '(.+?)': %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/internal/storageconfig/config.go","lineNumber":195,"sourceCode":"\tif len(backends) > 1 {\n\t\treturn fmt.Errorf(\"multiple backend types found for metric storage: %v\", backends)\n\t}\n\treturn nil\n}\n\n// Validate validates the storage configuration.\nfunc (c *Config) Validate() error {\n\tif len(c.TraceBackends) == 0 {\n\t\treturn errors.New(\"at least one storage backend is required\")\n\t}\n\tfor name, b := range c.TraceBackends {\n\t\tif err := b.Validate(); err != nil {\n\t\t\treturn fmt.Errorf(\"trace storage '%s': %w\", name, err)\n\t\t}\n\t}\n\tfor name, b := range c.MetricBackends {\n\t\tif err := b.Validate(); err != nil {\n\t\t\treturn fmt.Errorf(\"metric storage '%s': %w\", name, err)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":177,"sourceCodeEnd":200,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/internal/storageconfig/config.go#L177-L200","documentation":"The metric-storage counterpart of the trace wrapper: top-level Config.Validate() wraps any error from a named metric backend's Validate() as `metric storage '%s': %w`, identifying which entry in jaeger.storage.metric_backends failed and why.","triggerScenarios":"Calling Config.Validate() where an entry in MetricBackends fails validation — typically an empty backend body (nothing unmarshaled) or multiple backend types set on one entry.","commonSituations":"Metric backends defined with only a name and no type; a key typo under the backend so its type field never populates; merge tooling dropping the backend body.","solutions":["Fix the named entry shown in the error (`metric storage 'NAME'`) so it has exactly one valid backend type field","Remove metric_backends entries you don't use — an empty definition always fails validation","Read the wrapped cause for the specific rule violated (empty configuration vs multiple backend types)","Validate the final merged config before deploy (e.g. run the binary with `--config ...` in dry form / print effective config)"],"exampleFix":"// before (config.yaml)\njaeger:\n  storage:\n    metric_backends:\n      m1: {}\n// after\njaeger:\n  storage:\n    metric_backends:\n      m1:\n        prometheus:\n          host: \"http://prometheus:9090\"","handlingStrategy":"validation","validationCode":"var cfg storageconfig.Config\nif err := v.Unmarshal(&cfg); err != nil { return err }\nfor name, b := range cfg.MetricBackends {\n    if err := b.Validate(); err != nil {\n        return fmt.Errorf(\"pre-check metric backend %q: %w\", name, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.Validate(); err != nil {\n    var name string\n    if m := regexp.MustCompile(`metric storage '([^']+)'`).FindStringSubmatch(err.Error()); m != nil {\n        name = m[1]\n    }\n    return fmt.Errorf(\"fix jaeger.storage.metric_backends entry %q: %w\", name, err)\n}","preventionTips":["Validate metric_backends entries before deploy; each needs exactly one type field","Delete unused metric backend entries instead of leaving them empty","Check config-merge output for emptied backend bodies","Run jaeger with a rendered config dump in CI to catch this early"],"tags":["config","storage","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}