alloy
alloy copied to clipboard
Add `conditions` support to `otelcol.processor.transform` from upstream OpenTelemetry `transformprocessor`
Request
Alloy's otelcol.processor.transform
component is currently missing support for conditions
from the upstream transformprocessor
Example of conditions in transform processor:
transform:
error_mode: ignore
metric_statements:
- context: metric
conditions:
- type == METRIC_DATA_TYPE_SUM
statements:
- set(description, "Sum")
What the equivalent should look like in Alloy:
otelcol.processor.transform "example" {
error_mode = "ignore"
metric_statements {
context = "metric"
conditions = [
`type == METRIC_DATA_TYPE_SUM`,
]
statements = [
`set(description, "Sum")`,
]
}
output {
metrics = [...]
}
}
Use case
If a block of statements has a common set of conditions, it would be useful to skip processing of that entire block of statements, rather than have to copy/paste that condition onto every statement.
In some cases where a block contains many transforms that only apply in certain conditions, it could improve transform processing time by reducing the number of operations.