Adding upstream version 1.34.4.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
e393c3af3f
commit
4978089aab
4963 changed files with 677545 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
|||
metric value=420
|
||||
metric value_min=4200,value_max=4200
|
|
@ -0,0 +1 @@
|
|||
metric value=42.0
|
22
agent/testcases/aggregators-rerun-processors/telegraf.conf
Normal file
22
agent/testcases/aggregators-rerun-processors/telegraf.conf
Normal file
|
@ -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
|
||||
|
2
agent/testcases/aggregators-skip-processors/expected.out
Normal file
2
agent/testcases/aggregators-skip-processors/expected.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
metric value=420
|
||||
metric value_min=420,value_max=420
|
1
agent/testcases/aggregators-skip-processors/input.influx
Normal file
1
agent/testcases/aggregators-skip-processors/input.influx
Normal file
|
@ -0,0 +1 @@
|
|||
metric value=42.0
|
22
agent/testcases/aggregators-skip-processors/telegraf.conf
Normal file
22
agent/testcases/aggregators-skip-processors/telegraf.conf
Normal file
|
@ -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
|
||||
|
2
agent/testcases/processor-order-appearance/expected.out
Normal file
2
agent/testcases/processor-order-appearance/expected.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
new_metric_from_starlark,foo=bar baz=42i,timestamp="2023-07-13T12:53:54.197709713Z" 1689252834197709713
|
||||
old_metric_from_mock,mood=good value=23i,timestamp="2023-07-13T13:10:34Z" 1689253834000000000
|
1
agent/testcases/processor-order-appearance/input.influx
Normal file
1
agent/testcases/processor-order-appearance/input.influx
Normal file
|
@ -0,0 +1 @@
|
|||
old_metric_from_mock,mood=good value=23i 1689253834000000000
|
26
agent/testcases/processor-order-appearance/telegraf.conf
Normal file
26
agent/testcases/processor-order-appearance/telegraf.conf
Normal file
|
@ -0,0 +1,26 @@
|
|||
# Test for using the appearance order in the file for processor order
|
||||
[[inputs.file]]
|
||||
files = ["testcases/processor-order-appearance/input.influx"]
|
||||
data_format = "influx"
|
||||
|
||||
[[processors.starlark]]
|
||||
source = '''
|
||||
def apply(metric):
|
||||
metrics = []
|
||||
|
||||
m = Metric("new_metric_from_starlark")
|
||||
m.tags["foo"] = "bar"
|
||||
m.fields["baz"] = 42
|
||||
m.time = 1689252834197709713
|
||||
metrics.append(m)
|
||||
metrics.append(metric)
|
||||
|
||||
return metrics
|
||||
'''
|
||||
|
||||
[[processors.date]]
|
||||
field_key = "timestamp"
|
||||
date_format = "2006-01-02T15:04:05.999999999Z"
|
||||
timezone = "UTC"
|
||||
|
||||
|
2
agent/testcases/processor-order-explicit/expected.out
Normal file
2
agent/testcases/processor-order-explicit/expected.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
new_metric_from_starlark,foo=bar baz=42i,timestamp="2023-07-13T12:53:54.197709713Z" 1689252834197709713
|
||||
old_metric_from_mock,mood=good value=23i,timestamp="2023-07-13T13:10:34Z" 1689253834000000000
|
1
agent/testcases/processor-order-explicit/input.influx
Normal file
1
agent/testcases/processor-order-explicit/input.influx
Normal file
|
@ -0,0 +1 @@
|
|||
old_metric_from_mock,mood=good value=23i 1689253834000000000
|
27
agent/testcases/processor-order-explicit/telegraf.conf
Normal file
27
agent/testcases/processor-order-explicit/telegraf.conf
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Test for specifying an explicit processor order
|
||||
[[inputs.file]]
|
||||
files = ["testcases/processor-order-explicit/input.influx"]
|
||||
data_format = "influx"
|
||||
|
||||
|
||||
[[processors.date]]
|
||||
field_key = "timestamp"
|
||||
date_format = "2006-01-02T15:04:05.999999999Z"
|
||||
timezone = "UTC"
|
||||
order = 2
|
||||
|
||||
[[processors.starlark]]
|
||||
source = '''
|
||||
def apply(metric):
|
||||
metrics = []
|
||||
|
||||
m = Metric("new_metric_from_starlark")
|
||||
m.tags["foo"] = "bar"
|
||||
m.fields["baz"] = 42
|
||||
m.time = 1689252834197709713
|
||||
metrics.append(m)
|
||||
metrics.append(metric)
|
||||
|
||||
return metrics
|
||||
'''
|
||||
order = 1
|
2
agent/testcases/processor-order-mixed/expected.out
Normal file
2
agent/testcases/processor-order-mixed/expected.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
new_metric_from_starlark,foo=bar baz=42i,timestamp="2023-07-13T12:53:54.197709713Z" 1689252834197709713
|
||||
old_metric_from_mock,mood=good value=23i,timestamp="2023-07-13T13:10:34Z" 1689253834000000000
|
1
agent/testcases/processor-order-mixed/input.influx
Normal file
1
agent/testcases/processor-order-mixed/input.influx
Normal file
|
@ -0,0 +1 @@
|
|||
old_metric_from_mock,mood=good value=23i 1689253834000000000
|
25
agent/testcases/processor-order-mixed/telegraf.conf
Normal file
25
agent/testcases/processor-order-mixed/telegraf.conf
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Test for using the appearance order in the file for processor order
|
||||
[[inputs.file]]
|
||||
files = ["testcases/processor-order-appearance/input.influx"]
|
||||
data_format = "influx"
|
||||
|
||||
[[processors.starlark]]
|
||||
source = '''
|
||||
def apply(metric):
|
||||
metrics = []
|
||||
|
||||
m = Metric("new_metric_from_starlark")
|
||||
m.tags["foo"] = "bar"
|
||||
m.fields["baz"] = 42
|
||||
m.time = 1689252834197709713
|
||||
metrics.append(m)
|
||||
metrics.append(metric)
|
||||
|
||||
return metrics
|
||||
'''
|
||||
|
||||
[[processors.date]]
|
||||
field_key = "timestamp"
|
||||
date_format = "2006-01-02T15:04:05.999999999Z"
|
||||
timezone = "UTC"
|
||||
order = 1
|
2
agent/testcases/processor-order-no-starlark/expected.out
Normal file
2
agent/testcases/processor-order-no-starlark/expected.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
new_metric_from_starlark,foo=bar baz=42i 1689252834197709713
|
||||
old_metric_from_mock,mood=good value=23i,timestamp="2023-07-13T13:10:34Z" 1689253834000000000
|
1
agent/testcases/processor-order-no-starlark/input.influx
Normal file
1
agent/testcases/processor-order-no-starlark/input.influx
Normal file
|
@ -0,0 +1 @@
|
|||
old_metric_from_mock,mood=good value=23i 1689253834000000000
|
26
agent/testcases/processor-order-no-starlark/telegraf.conf
Normal file
26
agent/testcases/processor-order-no-starlark/telegraf.conf
Normal file
|
@ -0,0 +1,26 @@
|
|||
# Test for using the appearance order in the file for processor order.
|
||||
# This will not add the "timestamp" field as the starlark processor runs _after_
|
||||
# the date processor.
|
||||
[[inputs.file]]
|
||||
files = ["testcases/processor-order-no-starlark/input.influx"]
|
||||
data_format = "influx"
|
||||
|
||||
[[processors.date]]
|
||||
field_key = "timestamp"
|
||||
date_format = "2006-01-02T15:04:05.999999999Z"
|
||||
timezone = "UTC"
|
||||
|
||||
[[processors.starlark]]
|
||||
source = '''
|
||||
def apply(metric):
|
||||
metrics = []
|
||||
|
||||
m = Metric("new_metric_from_starlark")
|
||||
m.tags["foo"] = "bar"
|
||||
m.fields["baz"] = 42
|
||||
m.time = 1689252834197709713
|
||||
metrics.append(m)
|
||||
metrics.append(metric)
|
||||
|
||||
return metrics
|
||||
'''
|
Loading…
Add table
Add a link
Reference in a new issue