-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Blacklist systemd scope units #534
Conversation
Blacklist `scope` units from systemd collector by default. These units are created with unique IDs programatically[0]. This leads to huge cardinality problems. [0]: https://www.freedesktop.org/software/systemd/man/systemd.scope.html
38c9829
to
5f43211
Compare
@@ -27,7 +27,7 @@ import ( | |||
|
|||
var ( | |||
unitWhitelist = flag.String("collector.systemd.unit-whitelist", ".+", "Regexp of systemd units to whitelist. Units must both match whitelist and not match blacklist to be included.") | |||
unitBlacklist = flag.String("collector.systemd.unit-blacklist", "", "Regexp of systemd units to blacklist. Units must both match whitelist and not match blacklist to be included.") | |||
unitBlacklist = flag.String("collector.systemd.unit-blacklist", ".+\\.scope", "Regexp of systemd units to blacklist. Units must both match whitelist and not match blacklist to be included.") |
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 guess I'd be explicit and anchor the regexp.
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.
The code applies an anchor to the regexp already, do we need to do it here as well?
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.
We generally have anchored regexes everywhere in Prometheus, and the existing one above also assumes that. I'd be for leaving it as is...
Not too familiar with systemd; Any chances people actually want these unit metrics and this change would break it for them? But beside that, LGTM. |
@discordianfish Well, it blew up GitLab's Prometheus server big time, so I think even if someone wants them, it's not good practice. But I think we are generally still ok with breaking things like this in Node Exporter, as long as it's not 1.x yet. |
@juliusv Right, breaking is okay - we just need to be aware and mention it in the changelog. Agree that we need to merge it either way. |
Definitely. This should be listed as a |
Oh, my bad, I didn't know we anchor in the code already. Sorry for the
noise.
:+1:
…On Thu, Mar 23, 2017, 10:09 Julius Volz ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In collector/systemd_linux.go
<#534 (comment)>
:
> @@ -27,7 +27,7 @@ import (
var (
unitWhitelist = flag.String("collector.systemd.unit-whitelist", ".+", "Regexp of systemd units to whitelist. Units must both match whitelist and not match blacklist to be included.")
- unitBlacklist = flag.String("collector.systemd.unit-blacklist", "", "Regexp of systemd units to blacklist. Units must both match whitelist and not match blacklist to be included.")
+ unitBlacklist = flag.String("collector.systemd.unit-blacklist", ".+\\.scope", "Regexp of systemd units to blacklist. Units must both match whitelist and not match blacklist to be included.")
We generally have anchored regexes everywhere in Prometheus, and the
existing one above also assumes that. I'd be for leaving it as is...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#534 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAANaAtEOhT6vorcCwH1EYCJdcV5lR-4ks5rom7MgaJpZM4MmtgS>
.
|
Signed-off-by: taherk <tkkathana@gmail.com>
Blacklist
scope
units from systemd collector by default.These units are created with unique IDs programatically0. This leads to
huge cardinality problems.