prometheus/node_exporter · error
--collector.qdisk.device-include and…
Error message
--collector.qdisk.device-include and --collector.qdisc.device-include are mutually exclusive
What it means
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.
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
Example fix
// before node_exporter --collector.qdisk.device-include=eth0 --collector.qdisc.device-include=eth1 // after node_exporter --collector.qdisc.device-include=eth1
Defensive patterns
Strategy: validation
Validate before calling
func validateQdiscFlags(oldInclude, newInclude string) error {
if oldInclude != "" && newInclude != "" {
return fmt.Errorf("set only one of --collector.qdisk.device-include (deprecated) or --collector.qdisc.device-include")
}
return nil
} Try / catch
c, err := NewQdiscStatCollector(logger)
if err != nil {
logger.Error("qdisc collector disabled", "err", err)
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.
Related errors
- --collector.qdisk.device-exclude and…
- collector.qdisc.device-include and…
- sysctl has only one value, but expected
- sysctl has keys but only defined in f lag
- --collector.diskstats.ignored-devices and…
AI-assisted analysis of prometheus/node_exporter@17ddd77c59 (2026-09-07).
Data as JSON: /api/errors/a69a0eb6564dbb16.
Report an issue: GitHub.
Appendix: source
Thrown at collector/qdisc_linux.go:61
collectorQdisc = kingpin.Flag("collector.qdisc.fixtures", "test fixtures to use for qdisc collector end-to-end testing").Default("").String()
collectorQdiscDeviceInclude = kingpin.Flag("collector.qdisc.device-include", "Regexp of qdisc devices to include (mutually exclusive to device-exclude).").String()
oldCollectorQdiskDeviceInclude = kingpin.Flag("collector.qdisk.device-include", "DEPRECATED: Use collector.qdisc.device-include").Hidden().String()
collectorQdiscDeviceExclude = kingpin.Flag("collector.qdisc.device-exclude", "Regexp of qdisc devices to exclude (mutually exclusive to device-include).").String()
oldCollectorQdiskDeviceExclude = kingpin.Flag("collector.qdisk.device-exclude", "DEPRECATED: Use collector.qdisc.device-exclude").Hidden().String()
)
func init() {
registerCollector("qdisc", defaultDisabled, NewQdiscStatCollector)
}
// NewQdiscStatCollector returns a new Collector exposing queuing discipline statistics.
func NewQdiscStatCollector(logger *slog.Logger) (Collector, error) {
if *oldCollectorQdiskDeviceInclude != "" {
if *collectorQdiscDeviceInclude == "" {
logger.Warn("--collector.qdisk.device-include is DEPRECATED and will be removed in 2.0.0, use --collector.qdisc.device-include")
*collectorQdiscDeviceInclude = *oldCollectorQdiskDeviceInclude
} else {
return nil, fmt.Errorf("--collector.qdisk.device-include and --collector.qdisc.device-include are mutually exclusive")
}
}
if *oldCollectorQdiskDeviceExclude != "" {
if *collectorQdiscDeviceExclude == "" {
logger.Warn("--collector.qdisk.device-exclude is DEPRECATED and will be removed in 2.0.0, use --collector.qdisc.device-exclude")
*collectorQdiscDeviceExclude = *oldCollectorQdiskDeviceExclude
} else {
return nil, fmt.Errorf("--collector.qdisk.device-exclude and --collector.qdisc.device-exclude are mutually exclusive")
}
}
if *collectorQdiscDeviceExclude != "" && *collectorQdiscDeviceInclude != "" {
return nil, fmt.Errorf("collector.qdisc.device-include and collector.qdisc.device-exclude are mutaly exclusive")
}
return &qdiscStatCollector{
bytes: typedDesc{prometheus.NewDesc(View on GitHub (pinned to 17ddd77c59)