{"record":{"id":"a69a0eb6564dbb16","repo":"prometheus/node_exporter","slug":"collector-qdisk-device-include-and-collector-q","errorCode":null,"errorMessage":"--collector.qdisk.device-include and --collector.qdisc.device-include are mutually exclusive","messagePattern":"--collector\\.qdisk\\.device-include and --collector\\.qdisc\\.device-include are mutually exclusive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/qdisc_linux.go","lineNumber":61,"sourceCode":"\tcollectorQdisc                 = kingpin.Flag(\"collector.qdisc.fixtures\", \"test fixtures to use for qdisc collector end-to-end testing\").Default(\"\").String()\n\tcollectorQdiscDeviceInclude    = kingpin.Flag(\"collector.qdisc.device-include\", \"Regexp of qdisc devices to include (mutually exclusive to device-exclude).\").String()\n\toldCollectorQdiskDeviceInclude = kingpin.Flag(\"collector.qdisk.device-include\", \"DEPRECATED: Use collector.qdisc.device-include\").Hidden().String()\n\tcollectorQdiscDeviceExclude    = kingpin.Flag(\"collector.qdisc.device-exclude\", \"Regexp of qdisc devices to exclude (mutually exclusive to device-include).\").String()\n\toldCollectorQdiskDeviceExclude = kingpin.Flag(\"collector.qdisk.device-exclude\", \"DEPRECATED: Use collector.qdisc.device-exclude\").Hidden().String()\n)\n\nfunc init() {\n\tregisterCollector(\"qdisc\", defaultDisabled, NewQdiscStatCollector)\n}\n\n// NewQdiscStatCollector returns a new Collector exposing queuing discipline statistics.\nfunc NewQdiscStatCollector(logger *slog.Logger) (Collector, error) {\n\tif *oldCollectorQdiskDeviceInclude != \"\" {\n\t\tif *collectorQdiscDeviceInclude == \"\" {\n\t\t\tlogger.Warn(\"--collector.qdisk.device-include is DEPRECATED and will be removed in 2.0.0, use --collector.qdisc.device-include\")\n\t\t\t*collectorQdiscDeviceInclude = *oldCollectorQdiskDeviceInclude\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"--collector.qdisk.device-include and --collector.qdisc.device-include are mutually exclusive\")\n\t\t}\n\t}\n\n\tif *oldCollectorQdiskDeviceExclude != \"\" {\n\t\tif *collectorQdiscDeviceExclude == \"\" {\n\t\t\tlogger.Warn(\"--collector.qdisk.device-exclude is DEPRECATED and will be removed in 2.0.0, use --collector.qdisc.device-exclude\")\n\t\t\t*collectorQdiscDeviceExclude = *oldCollectorQdiskDeviceExclude\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"--collector.qdisk.device-exclude and --collector.qdisc.device-exclude are mutually exclusive\")\n\t\t}\n\t}\n\n\tif *collectorQdiscDeviceExclude != \"\" && *collectorQdiscDeviceInclude != \"\" {\n\t\treturn nil, fmt.Errorf(\"collector.qdisc.device-include and collector.qdisc.device-exclude are mutaly exclusive\")\n\t}\n\n\treturn &qdiscStatCollector{\n\t\tbytes: typedDesc{prometheus.NewDesc(","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/qdisc_linux.go#L43-L79","documentation":"NewQdiscStatCollector refuses to start when both the deprecated --collector.qdisk.device-include flag and the current --collector.qdisc.device-include flag are set, since it cannot decide which device filter to use. The old qdisk spelling is kept as a deprecated alias that auto-migrates to the new flag, but only when the new flag is empty; otherwise the constructor returns this error.","triggerScenarios":"Starting node_exporter with both --collector.qdisk.device-include=<v> and --collector.qdisc.device-include=<v> set to non-empty values; NewQdiscStatCollector returns this error before creating the collector.","commonSituations":"Upgrading from an older exporter config that used the qdisk spelling while a deployment tool (systemd unit, Helm chart, args file) already added the new qdisc flag, leaving both set.","solutions":["Remove the deprecated --collector.qdisk.device-include flag and keep only --collector.qdisc.device-include","Migrate all occurrences of qdisk.device-include to qdisc.device-include in deployment configs","Restart node_exporter and verify it starts without the error"],"exampleFix":"// before\nnode_exporter --collector.qdisk.device-include=eth0 --collector.qdisc.device-include=eth1\n// after\nnode_exporter --collector.qdisc.device-include=eth1","handlingStrategy":"validation","validationCode":"func validateQdiscFlags(oldInclude, newInclude string) error {\n\tif oldInclude != \"\" && newInclude != \"\" {\n\t\treturn fmt.Errorf(\"set only one of --collector.qdisk.device-include (deprecated) or --collector.qdisc.device-include\")\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"c, err := NewQdiscStatCollector(logger)\nif err != nil {\n\tlogger.Error(\"qdisc collector disabled\", \"err\", err)\n}","preventionTips":["Standardize on the new --collector.qdisc.* flags and purge qdisk spellings from all configs","Keep collector flags in one config layer to avoid duplicates","Audit systemd units and Helm args with `grep -R qdisk` after upgrades"],"tags":["cli-flags","configuration","linux","qdisc"],"backgroundTag":"mutually-exclusive-flags","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"}