-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(agent): Add option to skip re-running processors after aggregato…
…rs (#14882)
- Loading branch information
Showing
10 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
metric value=420 | ||
metric value_min=4200,value_max=4200 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
metric value=42.0 |
22 changes: 22 additions & 0 deletions
22
agent/testcases/aggregators-rerun-processors/telegraf.conf
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Test for not skipping processors after running aggregators | ||
[agent] | ||
omit_hostname = true | ||
skip_processors_after_aggregators = false | ||
|
||
[[inputs.file]] | ||
files = ["testcases/aggregators-rerun-processors/input.influx"] | ||
data_format = "influx" | ||
|
||
[[processors.starlark]] | ||
source = ''' | ||
def apply(metric): | ||
for k, v in metric.fields.items(): | ||
if type(v) == "float": | ||
metric.fields[k] = v * 10 | ||
return metric | ||
''' | ||
|
||
[[aggregators.minmax]] | ||
period = "1s" | ||
drop_original = false | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
metric value=420 | ||
metric value_min=420,value_max=420 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
metric value=42.0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Test for skipping processors after running aggregators | ||
[agent] | ||
omit_hostname = true | ||
skip_processors_after_aggregators = true | ||
|
||
[[inputs.file]] | ||
files = ["testcases/aggregators-skip-processors/input.influx"] | ||
data_format = "influx" | ||
|
||
[[processors.starlark]] | ||
source = ''' | ||
def apply(metric): | ||
for k, v in metric.fields.items(): | ||
if type(v) == "float": | ||
metric.fields[k] = v * 10 | ||
return metric | ||
''' | ||
|
||
[[aggregators.minmax]] | ||
period = "1s" | ||
drop_original = false | ||
|
This file contains 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
This file contains 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