{"record":{"id":"6ed453f016aa4353","repo":"cilium/cilium","slug":"hubble-metrics-configuration-validation-failed-w","errorCode":null,"errorMessage":"hubble-metrics configuration validation failed: %w","messagePattern":"hubble-metrics configuration validation failed: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/hubble/metrics/cell/cell.go","lineNumber":74,"sourceCode":"\tflags.String(\"hubble-metrics\", def.Metrics, \"List of Hubble metrics to enable.\")\n\tflags.Bool(\"enable-hubble-open-metrics\", def.EnableOpenMetrics, \"Enable exporting hubble metrics in OpenMetrics format.\")\n\tflags.String(\"hubble-metrics-server\", def.MetricsServer, \"Address to serve Hubble metrics on.\")\n\tflags.String(\"hubble-dynamic-metrics-config-path\", def.DynamicMetricConfigFilePath, \"Filepath with dynamic configuration of hubble metrics.\")\n}\n\nfunc (cfg Config) Validate() error {\n\tif cfg.DynamicMetricConfigFilePath != \"\" && len(cfg.Metrics) > 0 {\n\t\treturn errors.New(\"cannot configure both static and dynamic Hubble metrics\")\n\t}\n\treturn nil\n}\n\n// ValidatedConfig is a config that is known to be valid.\ntype ValidatedConfig Config\n\nfunc newValidatedConfig(c Config) (ValidatedConfig, error) {\n\tif err := c.Validate(); err != nil {\n\t\treturn ValidatedConfig{}, fmt.Errorf(\"hubble-metrics configuration validation failed: %w\", err)\n\t}\n\treturn ValidatedConfig(c), nil\n}\n\ntype params struct {\n\tcell.In\n\n\tLogger    *slog.Logger\n\tLifecycle cell.Lifecycle\n\tJobGroup  job.Group\n\n\tGRPCServerMetrics *grpc_prometheus.ServerMetrics\n\tTLSConfigPromise  tlsConfigPromise\n\n\tConfig ValidatedConfig\n}\n\nfunc newFlowProcessor(p params) (metrics.FlowProcessor, error) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/pkg/hubble/metrics/cell/cell.go#L56-L92","documentation":"newValidatedConfig wraps the cell's Config.Validate() result. Any failure while parsing/validating the hubble-metrics configuration (unknown metric, bad option, conflicting plugins) is re-wrapped with this message. It is the cell-level aggregate error; the underlying cause (%w) names the actual problem.","triggerScenarios":"Providing an invalid hubble-metrics config string via --hubble-metrics (or helm values) such that Config.Validate() returns an error, e.g. unknown metric name, invalid context option, or a plugin conflict like error 2922.","commonSituations":"Agent fails to start after editing hubble metrics in CiliumConfig; typos in metric names like `flows` instead of `flow`; invalid per-metric options after an upgrade changed accepted options.","solutions":["Read the wrapped cause (%w) in the log to identify the specific invalid setting","Correct the --hubble-metrics / metrics list using the documented metric names and options","Validate the config with a matching Cilium version's docs before applying"],"exampleFix":"// before\nhubble-metrics: \"flows dns:query;labelsContext=bogus\"\n// after\nhubble-metrics: \"flow dns:query;labelsContext=source_pod\"","handlingStrategy":"validation","validationCode":"// Validate locally before applying to the cluster\ncfg := api.ParseStaticMetricsConfig(strings.Fields(metricsList))\nif _, err := api.NewRegistry(cfg /* ... */); err != nil {\n    return fmt.Errorf(\"metrics config invalid: %w\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always read the wrapped %w cause — it names the exact bad entry","Keep hubble-metrics values in version control and review on upgrades","Test config changes in CI against the target Cilium version"],"tags":["hubble","metrics","configuration","validation"],"backgroundTag":"config-validation-failed","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}