{"record":{"id":"952bc040a62760d7","repo":"vitessio/vitess","slug":"unknown-metric-name-s","errorCode":null,"errorMessage":"unknown metric name: %s","messagePattern":"unknown metric name: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/grpcvtctldserver/server.go","lineNumber":2104,"sourceCode":"\n\treturn &vtctldatapb.GetSrvKeyspacesResponse{\n\t\tSrvKeyspaces: srvKeyspaces,\n\t}, nil\n}\n\n// UpdateThrottlerConfig updates throttler config for all cells\nfunc (s *VtctldServer) UpdateThrottlerConfig(ctx context.Context, req *vtctldatapb.UpdateThrottlerConfigRequest) (resp *vtctldatapb.UpdateThrottlerConfigResponse, err error) {\n\tspan, ctx := trace.NewSpan(ctx, \"VtctldServer.UpdateThrottlerConfig\")\n\tdefer span.Finish()\n\n\tdefer panicHandler(&err)\n\n\tif req.Enable && req.Disable {\n\t\treturn nil, errors.New(\"--enable and --disable are mutually exclusive\")\n\t}\n\n\tif req.MetricName != \"\" && !base.KnownMetricNames.Contains(base.MetricName(req.MetricName)) {\n\t\treturn nil, fmt.Errorf(\"unknown metric name: %s\", req.MetricName)\n\t}\n\n\tif len(req.AppCheckedMetrics) > 0 {\n\t\tspecifiedMetrics := map[base.MetricName]bool{}\n\t\tfor _, metricName := range req.AppCheckedMetrics {\n\t\t\t_, knownMetric, err := base.DisaggregateMetricName(metricName)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid metric name: %s\", metricName)\n\t\t\t}\n\t\t\tif _, ok := specifiedMetrics[knownMetric]; ok {\n\t\t\t\treturn nil, fmt.Errorf(\"duplicate metric name: %s\", knownMetric)\n\t\t\t}\n\t\t\tspecifiedMetrics[knownMetric] = true\n\t\t}\n\t}\n\n\tupdate := func(throttlerConfig *topodatapb.ThrottlerConfig) *topodatapb.ThrottlerConfig {\n\t\tif throttlerConfig == nil {","sourceCodeStart":2086,"sourceCodeEnd":2122,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/grpcvtctldserver/server.go#L2086-L2122","documentation":"UpdateThrottlerConfig validates the requested throttler metric name against the set of metrics known to the throttle base package (base.KnownMetricNames). If req.MetricName is non-empty and not in that set, the RPC is rejected before any topo update so an invalid metric never reaches the throttlers.","triggerScenarios":"Calling the UpdateThrottlerConfig vtctld RPC (or `vtctldclient UpdateThrottlerConfig --metric-name <name>`) with a --metric-name value that is not one of the known throttler metric names (e.g. a typo like 'loadavg' instead of the accepted names).","commonSituations":"Hand-typed vtctldclient commands, config templates copied from older Vitess versions where metric names changed, or automation passing a user-supplied metric name without validation.","solutions":["Check the accepted metric names (base.KnownMetricNames in go/vt/vttablet/tabletserver/throttle/base) and correct the metric name spelling/case.","Omit req.MetricName entirely if you do not intend to change the throttler's metric (empty string skips this check).","Upgrade/downgrade awareness: if a metric name was valid in another Vitess version, use a name valid for this version."],"exampleFix":"// before\nvtctldclient UpdateThrottlerConfig --metric-name loadavg\n// after\nvtctldclient UpdateThrottlerConfig --metric-name loadaverage","handlingStrategy":"validation","validationCode":"metric := base.MetricName(req.MetricName)\nif req.MetricName != \"\" && !base.KnownMetricNames.Contains(metric) {\n    return fmt.Errorf(\"metric %q not in known set %v\", req.MetricName, base.KnownMetricNames)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a constants list of valid throttler metric names in your tooling and validate flags against it","Only set MetricName when you actually want to change it (empty string skips validation)","Add an integration test that calls UpdateThrottlerConfig with each metric name your automation uses"],"tags":["vitess","throttler","validation","grpc"],"backgroundTag":"invalid-config-value","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}