{"record":{"id":"4baf095d30fd13bc","repo":"prometheus/node_exporter","slug":"disabled-collector-s","errorCode":null,"errorMessage":"disabled collector: %s","messagePattern":"disabled collector: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/collector.go","lineNumber":114,"sourceCode":"// does not contain information about which flag called the action.\n// See: https://github.com/alecthomas/kingpin/issues/294\nfunc collectorFlagAction(collector string) func(ctx *kingpin.ParseContext) error {\n\treturn func(_ *kingpin.ParseContext) error {\n\t\tforcedCollectors[collector] = true\n\t\treturn nil\n\t}\n}\n\n// NewNodeCollector creates a new NodeCollector.\nfunc NewNodeCollector(logger *slog.Logger, filters ...string) (*NodeCollector, error) {\n\tf := make(map[string]bool)\n\tfor _, filter := range filters {\n\t\tenabled, exist := collectorState[filter]\n\t\tif !exist {\n\t\t\treturn nil, fmt.Errorf(\"missing collector: %s\", filter)\n\t\t}\n\t\tif !*enabled {\n\t\t\treturn nil, fmt.Errorf(\"disabled collector: %s\", filter)\n\t\t}\n\t\tf[filter] = true\n\t}\n\tcollectors := make(map[string]Collector)\n\tinitiatedCollectorsMtx.Lock()\n\tdefer initiatedCollectorsMtx.Unlock()\n\tfor key, enabled := range collectorState {\n\t\tif !*enabled || (len(f) > 0 && !f[key]) {\n\t\t\tcontinue\n\t\t}\n\t\tif collector, ok := initiatedCollectors[key]; ok {\n\t\t\tcollectors[key] = collector\n\t\t} else {\n\t\t\tcollector, err := factories[key](logger.With(\"collector\", key))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tcollectors[key] = collector","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/collector.go#L96-L132","documentation":"node_exporter returns this when a collector name passed via the --collector.disable/--collector.enable (or per-collector enabled/disabled) filters refers to a collector that exists but is currently turned off. NewNodeCollector validates every filter name against collectorState and refuses to build a collector set containing a disabled collector, so a scrape configuration never silently runs a collector the operator excluded.","triggerScenarios":"Calling NewNodeCollector with a filter list that names a collector registered with enabled=false (e.g. the binary was built/started with that collector disabled, or it is gated behind a build tag so its state is disabled on this OS).","commonSituations":"Operators pass --collector.<name> for a collector they earlier disabled with --collector.disable-defaults or a disable flag; running a Linux-gated collector name on another OS where it is registered as disabled; typos are reported differently ('missing collector'), so this specifically means a real but disabled name.","solutions":["Remove the collector name from the enabled/disabled filter list, or enable it with its --collector.<name> flag","Check `node_exporter --help` (or the README collector table) to confirm the collector is enabled by default on this platform","If the collector is build-tag gated, use a binary built for the target OS"],"exampleFix":"// before\ninnerHandler(filters incl. \"arp\" while --collector.arp=false)\n// after\nstart exporter with --collector.arp (or drop \"arp\" from the filter list)","handlingStrategy":"validation","validationCode":"// Go: check collector state before requesting it\nif enabled, ok := collectorState[name]; !ok {\n    return fmt.Errorf(\"missing collector: %s\", name)\n} else if !*enabled {\n    return fmt.Errorf(\"collector %s is disabled; add --collector.%s\", name, name)\n}","typeGuard":null,"tryCatchPattern":"if err := startExporter(filters); err != nil {\n    if strings.HasPrefix(err.Error(), \"disabled collector:\") {\n        log.Warn(\"collector disabled, retrying without it\", \"collector\", err)\n        filters = removeFilter(filters, extractName(err))\n        return startExporter(filters)\n    }\n    return err\n}","preventionTips":["Check `node_exporter --help` for default-enabled collectors before adding filters","Only pass --collector.enable/--collector.disable names that appear in the README collector table","On multi-OS deployments, gate collector lists per platform"],"tags":["collector","configuration","go"],"backgroundTag":"feature-not-enabled","analyzedSha":"17ddd77c59ba27e1508e9f7894b1e55b44d6aed3","analyzedAt":"2026-09-07T17:54:06.211Z","contentChangedAt":"2026-09-07T17:54:06.211Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}