prometheus/node_exporter · error

collector.qdisc.device-include and…

Error message

collector.qdisc.device-include and collector.qdisc.device-exclude are mutaly exclusive

What it means

NewQdiscStatCollector rejects a configuration where both --collector.qdisc.device-include and --collector.qdisc.device-exclude are set: the qdisc collector supports either an allowlist or a denylist, not both at once. The message contains an upstream typo ('mutaly exclusive').

Solutions

  1. Keep only device-include (allowlist semantics) or only device-exclude (denylist semantics)
  2. Express the combined intent as a single include regex or a single exclude regex
  3. Restart node_exporter with only one of the two flags

Example fix

// before
node_exporter --collector.qdisc.device-include='eth[0-9]+' --collector.qdisc.device-exclude=eth9
// after
node_exporter --collector.qdisc.device-include='eth[0-8]'
Defensive patterns

Strategy: validation

Validate before calling

func validateQdiscFilterMode(include, exclude string) error {
	if include != "" && exclude != "" {
		return fmt.Errorf("--collector.qdisc.device-include and --collector.qdisc.device-exclude are mutually exclusive; choose one filter mode")
	}
	return nil
}

Try / catch

c, err := NewQdiscStatCollector(logger)
if err != nil {
	logger.Error("qdisc collector disabled", "err", err)
}

Prevention

When it happens

Trigger: Starting node_exporter with both --collector.qdisc.device-include=<v> and --collector.qdisc.device-exclude=<v> non-empty, after the deprecated-flag checks passed.

Common situations: Operator tries to allowlist most devices and additionally exclude a few in one invocation; args composed from multiple config sources accumulate both flags.

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


AI-assisted analysis of prometheus/node_exporter@17ddd77c59 (2026-09-07). Data as JSON: /api/errors/b74b7fb5fa7eb4a5. Report an issue: GitHub.

Appendix: source

Thrown at collector/qdisc_linux.go:75

		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(
			prometheus.BuildFQName(namespace, "qdisc", "bytes_total"),
			"Number of bytes sent.",
			[]string{"device", "kind"}, nil,
		), prometheus.CounterValue},
		packets: typedDesc{prometheus.NewDesc(
			prometheus.BuildFQName(namespace, "qdisc", "packets_total"),
			"Number of packets sent.",
			[]string{"device", "kind"}, nil,
		), prometheus.CounterValue},
		drops: typedDesc{prometheus.NewDesc(
			prometheus.BuildFQName(namespace, "qdisc", "drops_total"),
			"Number of packets dropped.",
			[]string{"device", "kind"}, nil,
		), prometheus.CounterValue},

View on GitHub (pinned to 17ddd77c59)