{"record":{"id":"001b015143c98431","repo":"prometheus/node_exporter","slug":"collector-qdisk-device-exclude-and-collector-q","errorCode":null,"errorMessage":"--collector.qdisk.device-exclude and --collector.qdisc.device-exclude are mutually exclusive","messagePattern":"--collector\\.qdisk\\.device-exclude and --collector\\.qdisc\\.device-exclude are mutually exclusive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/qdisc_linux.go","lineNumber":70,"sourceCode":"}\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(\n\t\t\tprometheus.BuildFQName(namespace, \"qdisc\", \"bytes_total\"),\n\t\t\t\"Number of bytes sent.\",\n\t\t\t[]string{\"device\", \"kind\"}, nil,\n\t\t), prometheus.CounterValue},\n\t\tpackets: typedDesc{prometheus.NewDesc(\n\t\t\tprometheus.BuildFQName(namespace, \"qdisc\", \"packets_total\"),\n\t\t\t\"Number of packets sent.\",\n\t\t\t[]string{\"device\", \"kind\"}, nil,\n\t\t), prometheus.CounterValue},","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/qdisc_linux.go#L52-L88","documentation":"NewQdiscStatCollector refuses to start when both the deprecated --collector.qdisk.device-exclude flag and the current --collector.qdisc.device-exclude flag are set. The deprecated qdisk spelling only auto-migrates when the new qdisc flag is empty; setting both is ambiguous and rejected.","triggerScenarios":"Starting node_exporter with both --collector.qdisk.device-exclude=<v> and --collector.qdisc.device-exclude=<v> non-empty; the constructor returns this error immediately.","commonSituations":"Leftover old flag in a systemd unit or config-management manifest after the new flag was added; duplicated args accumulated from two config layers.","solutions":["Remove the deprecated --collector.qdisk.device-exclude flag and keep only --collector.qdisc.device-exclude","Search deployment configs for 'qdisk' and replace with 'qdisc'","Restart node_exporter"],"exampleFix":"// before\nnode_exporter --collector.qdisk.device-exclude=lo --collector.qdisc.device-exclude=docker0\n// after\nnode_exporter --collector.qdisc.device-exclude=docker0","handlingStrategy":"validation","validationCode":"func validateQdiscExcludeFlags(oldExclude, newExclude string) error {\n\tif oldExclude != \"\" && newExclude != \"\" {\n\t\treturn fmt.Errorf(\"set only one of --collector.qdisk.device-exclude (deprecated) or --collector.qdisc.device-exclude\")\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":["Replace deprecated qdisk flags everywhere before upgrading","Use a single source of truth for exporter flags","Test exporter startup in CI with the exact production flag set"],"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"}