1
0
Fork 0

Adding upstream version 1.34.4.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-24 07:26:29 +02:00
parent e393c3af3f
commit 4978089aab
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
4963 changed files with 677545 additions and 0 deletions

View file

@ -0,0 +1,2 @@
metric value=420
metric value_min=4200,value_max=4200

View file

@ -0,0 +1 @@
metric value=42.0

View 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

View file

@ -0,0 +1,2 @@
metric value=420
metric value_min=420,value_max=420

View file

@ -0,0 +1 @@
metric value=42.0

View 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

View 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

View file

@ -0,0 +1 @@
old_metric_from_mock,mood=good value=23i 1689253834000000000

View 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"

View 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

View file

@ -0,0 +1 @@
old_metric_from_mock,mood=good value=23i 1689253834000000000

View 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

View 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

View file

@ -0,0 +1 @@
old_metric_from_mock,mood=good value=23i 1689253834000000000

View 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

View 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

View file

@ -0,0 +1 @@
old_metric_from_mock,mood=good value=23i 1689253834000000000

View 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
'''