-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Adding allowed_device flag for diskstats Collector #2348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 <[email protected]>
collector/diskstats_linux.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Yeah you need to rename it in the other collectors but that should be straight forward. |
Signed-off-by: Rushikesh Lenekar <[email protected]>
1cd2a5c to
ec9f168
Compare
discordianfish
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Add darwin dashboard
Signed-off-by: prombot <[email protected]>
Synchronize common files from prometheus/prometheus
Signed-off-by: prombot <[email protected]>
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 <[email protected]>
|
It looks like you've incorrectly rebased your branch, bringing in additional unrelated commits. Please fix up your commit history. |
SuperQ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've merged #2378, please rebase and fix up the commit history on this change.
SuperQ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've merged #2378, please rebase and fix up the commit history on this change.
|
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