qdisc: add --collector.qdisc.include-child to expose non-root qdiscs - #3793
Open
2matzzz wants to merge 1 commit into
Open
qdisc: add --collector.qdisc.include-child to expose non-root qdiscs#37932matzzz wants to merge 1 commit into
2matzzz wants to merge 1 commit into
Conversation
The qdisc collector has only ever reported root qdiscs (since prometheus#580). That keeps per-device aggregations free of double counting, because packets traversing a child qdisc are also counted by its parents, but it makes classful setups blind: with e.g. an htb root and an fq leaf, the fq qdisc and its statistics are invisible. Add an opt-in flag, --collector.qdisc.include-child, that exposes every qdisc on a device. When enabled, all qdisc metrics gain 'parent' and 'handle' labels (in tc's major:minor notation, with "root" for the root parent) so that root and child qdiscs remain distinguishable and aggregations can filter on parent="root" to keep their old meaning. The default behavior and label set are unchanged. This addresses prometheus#3088; as suggested there, the tree is only exposed behind a dedicated flag. Assisted-by: Claude Code Signed-off-by: Yusuke Matsumoto <2matzzz@gmail.com>
2matzzz
marked this pull request as ready for review
August 20, 2026 13:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #3088.
The qdisc collector has only reported root qdiscs since its introduction (#580). As discussed in #3088, that keeps per-device aggregations free of double counting (packets traversing a child qdisc are also counted by its parents), but it leaves classful setups blind: with e.g. an
htbroot and anfqleaf, the leaf and its statistics are invisible.Following the suggestion in #3088 to gate this behind a dedicated flag,
--collector.qdisc.include-child(default off) exposes every qdisc on a device. When enabled, all qdisc metrics gainparentandhandlelabels in tc's major:minor notation (withrootfor the root parent), so root and child qdiscs stay distinguishable and existing aggregations can filter onparent="root"to keep their previous meaning. The default behavior and label set are unchanged.Tested against a live kernel with a nested, branching hierarchy (
htbroot ->htb->fq, plus a secondfqon another branch): without the flag only the root htb is reported, exactly as today; with the flag every qdisc appears withparent/handlematchingtc qdisc show, and the per-qdisc counters matchtc -s qdisc show.Note: this touches the same lines as #3792, so whichever lands second will need a trivial rebase. The two changes are otherwise independent.
cc @SuperQ @discordianfish