-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Added new basicstats aggregator #2167
Added new basicstats aggregator #2167
Conversation
Looks good @toni-moreno, but for the stats I'd prefer if you used https://github.com/aaw/histosketch, which can also make approximate quantiles (and thus an approximate median). The algorithm used in that library is more or less the standard for creating these stats. |
there's also this: https://github.com/VividCortex/gohistogram |
Hi @sparrc I've written this plugin as a way to get "basic" stats ( indeed I only need count max , min and averages) I suggest to add this plugin as a way to get count/mean/stdev values as fast as possible. Is a good idea get more detailed statistic info but perhaps we could create a new plugin "fullstats" based in https://github.com/aaw/histosketch to get also quantiles and histograms. Can I maintain the basicstats plugin as it is now? Do you need any change? |
@toni-moreno I need to think about that one. My main concern is that there is a significant performance overhead of each aggregator plugin which needs to individually filter and inspect each field of each metric that passes through it. for that reason, it would be much more efficient to have a single plugin which had the capability to aggregate all of these statistics (albeit possibly with a small memory hit). |
Hi @sparrc. About performance , I agree on that point. But IMHO if you need only basic stats , count and mean by example ( for each field) , the "fullstats" plugin with quantiles could have a lot of overhead. User perhaps would prefer switch from a fullstats to a basicstats plugin with less cpu overhead. About the plugin behaviour itself . I'm working on add a flag "allow_send_zero_counters" , to send on each push the XXX_count=0 even if not added metrics for each measurement/tags values. Sometimes we need counter metrics even when the value is 0 . (for graphite output by example) If allow_send_zero_counters = true , the basicstats plugin will send zeroes only for registered measurement/tags pairs (and only for XXXX_count field) # Keep the aggregate basicstats of each metric passing through.
[[aggregators.basicstats]]
## General Aggregator Arguments:
## The period on which to flush & clear the aggregator.
period = "30s"
## If true, the original metric will be dropped by the
## aggregator and will not get sent to the output plugins.
drop_original = false
## if true zeroes will be sent for all registered measurement/tags pairs (and only for XXXX_count field)
allow_send_zero_counters = true Are you agree to set default value as true for this new flag? |
@toni-moreno please open a separate issue about that where we can discuss further |
### Configuration: | ||
|
||
```toml | ||
# Keep the aggregate min/max of each metric passing through. |
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.
this doc line needs to be updated
} | ||
|
||
func (m *BasicStats) Description() string { | ||
return "Keep the aggregate min/max of each metric passing through." |
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.
this needs to be updated
Hi @sparrc sorry I've seen now your request. |
@toni-moreno I'd love to get this into version 1.4, is there any more work that needs done before the next review? |
Hi @danielnelson 2 minor fixes where requested by @sparrc. But you can fix yourself if needed, I don't know when I could spend some time to do it. When are you planning to release 1.4 version? |
I am aiming to do the release towards the end of August or early September. (Initially the plan was to do it this month but there is not enough work completed and I think it will give us release fatigue to pace this quickly) If I can find the time I'll try to finish it up, but I'll post here again before starting any work. |
I'm wondering about the name of this aggregator. Should not it be named |
0f96138
to
b7e38b4
Compare
5e1c6a3
to
0ce8426
Compare
Hi @danielnelson I've finally updated the plugin and also rebased !! I hope you can merge ASAP to enjoy it on next releases!. Thank you very much |
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.
Looks great, all I could see were a couple typos.
- field1_min | ||
- field1_mean | ||
- field1_s2 (variance) | ||
- field1_stdev (standar deviation) |
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.
typo in standard
min float64 | ||
max float64 | ||
mean float64 | ||
M2 float64 //intermemedia value for variance/stdev |
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.
typo
max float64 | ||
mean float64 | ||
M2 float64 //intermemedia value for variance/stdev | ||
//stdev float64 |
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.
remove
@danielnelson fixed! |
Thanks @toni-moreno, this will be in 1.5! |
Hi @danielnelson, any thoughts on my question regarding naming? |
I think it's okay, we have other plugins like procstat, filestat, sqlserver, and hddtemp. |
|
Required for all PRs:
Description
BasicStats Aggregator Plugin
The BasicStats aggregator plugin give us count,max,min,mean,s2(variance), stdev for a set of values,
emitting the aggregate every
period
seconds.Configuration:
Measurements & Fields:
Tags:
No tags are applied by this aggregator.
Example Output: