Adding allowed_device flag for diskstats Collector#2348
Adding allowed_device flag for diskstats Collector#2348rushilenekar20 wants to merge 12 commits intoprometheus:masterfrom
Conversation
|
Makes sense but what about renaming the netdev filter to devFilter or something and use it here as well? https://github.com/prometheus/node_exporter/blob/master/collector/netdev_filter.go |
3ebf74e to
1cd2a5c
Compare
I have commited one change . I tried to solve this current problem using netdev_filter.go . By renaming of netdev_filter to devFilter , i don't know what will be the consequences to another collector which are using netdev filter . |
Signed-off-by: Vitaly Zhuravlev <zhuravlev.vitaly@gmail.com>
collector/diskstats_linux.go
Outdated
There was a problem hiding this comment.
Let's get this consistent with the netdev flags. So similar like there, we should:
- rename this to device-include
- add new flag device-exclude
- Prefix the description of collector.diskstats.ignored-devices with "DEPRECATED: Use collector.diskstats.device-exclude" and add .Hidden() before String()
- Support excluding by setting either device-exclude but warn if people use the now deprecated flag
Basically: https://github.com/prometheus/node_exporter/blob/master/collector/netdev_common.go#L33-L77
Yeah you need to rename it in the other collectors but that should be straight forward. |
Signed-off-by: Rushikesh Lenekar <Rushikesh.Lenekar@veritas.com>
1cd2a5c to
ec9f168
Compare
Add darwin dashboard
Signed-off-by: prombot <prometheus-team@googlegroups.com>
Synchronize common files from prometheus/prometheus
Signed-off-by: prombot <prometheus-team@googlegroups.com>
Synchronize common files from prometheus/prometheus
|
Hey @SuperQ , We need this flag . Could you help me for this PR ? |
|
Looks like this needs a rebase. |
|
Also the tests are failing: |
|
I split out the netDevFilter out into a separate PR to simplify this change. |
Signed-off-by: Rushikesh Lenekar <Rushikesh.Lenekar@veritas.com>
|
It looks like you've incorrectly rebased your branch, bringing in additional unrelated commits. Please fix up your commit history. |
|
Hey @SuperQ @discordianfish , I have tried a lot to rebase and fix commit history of this branch but i failed to do so after following right steps. what should we do ? |
This reverts commit 3624c9b.
|
Closing in favor of #2417 |
Hey ,
I am suggesting a flag for diskstats collector named as --collector.diskstats.allowed-devices=""
Problem : Requirement for only allowed-devices flag in diskstats collector.
Description :
There is " ignored-devices " flag for diskstats collector which ignores stats of devices .
But in our organisation we faced a problem where Operating System create some devices at runtime whose names are unknown to us . So we were unable to ignored those devices .
As negetive lookahead is not supported in Go language because it conflicts with the O(n)-time guarantees of the library.so, we were unable to ignored those devices.
I suggest to have a flag for only allowed-devices for diskstats collector .
Here are some screenshots of the solution for this problem
there are multiple device sda , dm , sr0 .Lets assume sda and sr0 devices were unknown to us and they are created at runtime and we dont want to show metrics of those devices . we only want to show metrics for dm devices.
2)allowed-device flag

only dm devices are allowed