-
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
Support Processor & Aggregator Plugins #1777
Conversation
788db33
to
eb04366
Compare
f843520
to
2b4cac5
Compare
42a5ea5
to
a809288
Compare
e468300
to
735a564
Compare
} | ||
return | ||
case m := <-r.metrics: | ||
if m.Time().Before(r.periodStart) || m.Time().After(r.periodEnd) { |
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 drops metrics at the beginning of each period.
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.
If you look at the <-periodT.C case I tried to make it so that each interval is overlapping by the "delay" amount. So for example:
:00
<- 1st period starts
:10
<- 2nd period starts
:10 + delay
<- 1st period ends
:20
<- 3rd period starts
:20 + delay
<- 2nd period ends
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.
But once a metric is read from the channel and dropped, it won't be available on the channel during the next period. Seems like points where end < t < end+delay
would have to either go into a buffer or back into the metric chan.
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.
end
is defined as: start + period + delay
(see 735a564#diff-65518ad6bfcfeef60e9881df019b20a8R116)
so a metric where end < t < end+delay
would always be accepted.
Maybe it's not very clear the way I've done it. Instead of defining end
to include the delay, I could make this if-statement include the delay.
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.
Ah, I see. I missed something in the code earlier. I thought the ticker was firing on period + delay
intervals.
allows for easier addition of a sliding window at a later time. Also makes `period` be a generic argument for all aggregator plugins.
👍 with changelog update |
@sparrc I didn't want to open a new issue for this cause it's just a simple question. If a processor wants to add a Tag to a metric, does it need to copy the whole metric? It seems like |
I think you'd need to, although it would probably be more efficient to add a passthru function to the underlying influxdb points object, which I believe has a some sort of AddTags method: https://github.com/influxdata/influxdb/blob/master/models/points.go |
Yup. That's what I ended up doing in my PR. Thanks.
|
Required for all PRs:
TODO:
drop_original
arg: Provide a way of dropping the original metric after it gets sent to the aggregator(s)delay
before each ticker fires.processors
andaggregators
in the telegraf auto-generated config file--processor-filter
and--aggregator-filter
command-line args.period
argument. Flush the aggregator period outside of the plugin itself.closes #1726