influxdata / influxdata/kapacitor

[Feature Request] Add Parametrizable InfluxQLNode Functions for Templating

Open
#1,538 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

I would like add as parameter in the template parameter file the InfluxQL funcion to apply over a certaing windows time.

This is what I can do now.

````javascript

var Period=1m
var Every=1m
var Field = 'value'

stream
|window()
.period(Period)
.every(Every)
|sum(Field)
`````

this is what I would like to do, at least for certain basic statistics like :

• Last: Select the last point.
• Max: Select the maximum point.
• Mean: Compute the mean of the data.
• Median: Compute the median of the data
• Min: Select the minimum point.
• MovingAverage: Compute a moving average of the last window points. No points are emitted until the window is full. Parametro extra: num de puntos
• Percentile: Select a point at the given percentile. Parámetro Extra: percentil
• Spread: Compute the difference between min and max points.
• Stddev: Compute the standard deviation.
• Sum: Compute the sum of all values.

````javascript

var Period=1m
var Every=1m
var Field = 'value'
var Func = 'sum'
stream
|window()
.period(Period)
.every(Every)
|InfluxEval(Func,Field)
`````
or

````javascript

var Period=1m
var Every=1m
var Field = 'value'
var Func = 'sum'
stream
|window()
.period(Period)
.every(Every)
|$Func(Field)
`````

Or something equivalent:

There is any plans to implement this new feature?

Thank you very much!

Contributor guide

Open the contributing guide

Research direction

Review the template parameter file and the existing window()/sum() examples in the issue, then compare the proposed InfluxEval(Func, Field) and $Func(Field) entry points. Done means the supported basic statistics and any extra parameters are defined and usable through the chosen templating form, with behavior checked against the listed examples.

Written by the indexing model from the issue text.

Assessment

Domain
stream-processing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.