Thread specific summary counters#19
Open
kerolasa wants to merge 4 commits intoletsencrypt:mainfrom
Open
Conversation
Fixes following staticcheck warning.
$ staticcheck ./unbound_exporter.go
unbound_exporter.go:279:22: should use raw string (`...`) with
regexp.MustCompile to avoid having to escape twice (S1007)
Per thread metrics can be unnecessarily detailed in environments where there are lots of unbound instances, and prometheus server memory is short in supply.
Fattouche
reviewed
Sep 10, 2020
| return err | ||
| } | ||
|
|
||
| if !threads && strings.HasPrefix(matches[0], "thread") { |
There was a problem hiding this comment.
Can you guarantee that matches actually has this length?
Contributor
Author
There was a problem hiding this comment.
I think I can. There is matches != nil check before ParseFloat(), so there should always be at least first entry. Assuming the first entry tells thread all of the expressions have three fields. That should make both the matches[1] assignment and matches[1:] reference safe.
Fattouche
approved these changes
Sep 14, 2020
Member
|
Gotcha, here's the old (default) behavior: and behavior with the new flag |
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.
This pull request has three minor changes that are so trivial they hopefully do not need much discussion.
Main purpose of the change set is to add
-threads=falsecommand-line option support, that will make the thread specific exports to be summary counters. Level of detail is just too much in cases such as a company I work for, where we have lots of threads and lots of installations. That leads to prometheus server to reserve a lot of memory to keep track of these metrics, that are always summarised when visualised. Notice that the default per thread counting is kept as-is, new summary output is only for people who really want to merge the metrics.