collector/slabinfo: index duplicate slab entries - #3784
Open
machismo0311 wants to merge 1 commit into
Open
Conversation
|
Everything else looks good, including the |
|
/workflow-approve |
/proc/slabinfo can list the same slab name more than once, for example one cache per device instance. Labelling only by slab name therefore produces duplicate label sets, causing the registry to reject the scrape. Add an index label carrying each entry's position among entries sharing the same slab name. This preserves one series per kernel cache and keeps each entry's own counts and geometry. The label name matches the existing ordinal index convention used by other collectors. The ordinal follows /proc/slabinfo ordering and is not a stable identity. It is assigned after filtering so excluded slabs do not consume an index. Fixes prometheus#3506 Signed-off-by: Kyle Mason <kyle@kylemason.org>
machismo0311
force-pushed
the
fix/slabinfo-duplicate-index
branch
from
August 6, 2026 12:48
39d28bc to
0b94860
Compare
Author
|
Fixed, thanks. The test file now uses the year-less header; |
|
/workflow-approve |
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.
Fixes #3506.
/proc/slabinfomay contain repeated slab names, for example one cache perdevice instance. The collector currently labels series only by slab name, so
duplicates produce identical label sets and cause
Gather()to fail for theentire scrape.
This change adds an
indexlabel, following the direction agreed in the issue,so every cache keeps its own series, counts, and geometry.
Notes for review:
indexis assigned after the include/exclude filter, so an excluded slab doesnot leave a gap in the ordinals.
disappears, subsequent indices can shift.
caches share
object_size, so the exporter does not choose a representativevalue.
covering duplicate names, distinct names, differing geometry, and the
filter/index interaction.
added.
Validated with:
gofmtgo vet ./...go test -short ./...golangci-lintusing the repository-pinned version