Experimental
otelcol.processor.interval
EXPERIMENTAL: This is an experimental component. Experimental components are subject to frequent breaking changes, and may be removed with no equivalent replacement. The
stability.level
flag must be set toexperimental
to use the component.
otelcol.processor.interval
aggregates metrics and periodically forwards the latest values to the next component in the pipeline.
The processor supports aggregating the following metric types:
- Monotonically increasing, cumulative sums
- Monotonically increasing, cumulative histograms
- Monotonically increasing, cumulative exponential histograms
- Gauges
- Summaries
The following metric types will not be aggregated and will instead be passed, unchanged, to the next component in the pipeline:
- All delta metrics
- Non-monotonically increasing sums
Note
Aggregating data over an interval is an inherently lossy process. You lose precision for monotonically increasing cumulative sums, histograms, and exponential histograms, but you don’t lose overall data. You can lose data when you aggregate non-monotonically increasing sums, gauges, and summaries. For example, a value can increase and decrease to the original value, and you can lose this change in the aggregation. In most cases, this type of data loss is OK. However, you can change the configuration so that these changed values pass through and are not aggregated.
Warning
After exporting, any internal state is cleared. If no new metrics come in, the next interval will export nothing.
Note
otelcol.processor.interval
is a wrapper over the upstream OpenTelemetry Collectorinterval
processor. Bug reports or feature requests will be redirected to the upstream repository, if necessary.
Usage
otelcol.processor.interval "LABEL" {
output {
metrics = [...]
}
}
Arguments
otelcol.processor.interval
supports the following arguments:
Name | Type | Description | Default | Required |
---|---|---|---|---|
interval | duration | The interval in the processor should export the aggregated metrics. | "60s" | no |
Blocks
The following blocks are supported inside the definition of otelcol.processor.interval
:
Hierarchy | Block | Description | Required |
---|---|---|---|
output | output | Configures where to send received telemetry data. | yes |
passthrough | passthrough | Configure metric types to be passed through instead of aggregated. | no |
debug_metrics | debug_metrics | Configures the metrics that this component generates to monitor its state. | no |
output block
The output
block configures a set of components to forward resulting telemetry data to.
The following arguments are supported:
Name | Type | Description | Default | Required |
---|---|---|---|---|
logs | list(otelcol.Consumer) | List of consumers to send logs to. | [] | no |
metrics | list(otelcol.Consumer) | List of consumers to send metrics to. | [] | no |
traces | list(otelcol.Consumer) | List of consumers to send traces to. | [] | no |
You must specify the output
block, but all its arguments are optional.
By default, telemetry data is dropped.
Configure the metrics
, logs
, and traces
arguments accordingly to send telemetry data to other components.
passthrough block
The passthrough
block configures which metric types should be passed through instead of being aggregated.
The following attributes are supported:
Name | Type | Description | Default | Required |
---|---|---|---|---|
gauge | bool | Determines whether gauge metrics should be passed through as they are or aggregated. | false | no |
summary | bool | Determines whether summary metrics should be passed through as they are or aggregated. | false | no |
debug_metrics block
The debug_metrics
block configures the metrics that this component generates to monitor its state.
The following arguments are supported:
Name | Type | Description | Default | Required |
---|---|---|---|---|
disable_high_cardinality_metrics | boolean | Whether to disable certain high cardinality metrics. | true | no |
level | string | Controls the level of detail for metrics emitted by the wrapped collector. | "detailed" | no |
disable_high_cardinality_metrics
is the Grafana Alloy equivalent to the telemetry.disableHighCardinalityMetrics
feature gate in the OpenTelemetry Collector.
It removes attributes that could cause high cardinality metrics.
For example, attributes with IP addresses and port numbers in metrics about HTTP and gRPC connections are removed.
Note
If configured,disable_high_cardinality_metrics
only applies tootelcol.exporter.*
andotelcol.receiver.*
components.
level
is the Alloy equivalent to the telemetry.metrics.level
feature gate in the OpenTelemetry Collector.
Possible values are "none"
, "basic"
, "normal"
and "detailed"
.
Exported fields
The following fields are exported and can be referenced by other components:
Name | Type | Description |
---|---|---|
input | otelcol.Consumer | A value that other components can use to send telemetry data to. |
input
accepts otelcol.Consumer
data for metrics.
Component health
otelcol.processor.interval
is only reported as unhealthy if given an invalid configuration.
Debug information
otelcol.processor.interval
does not expose any component-specific debug information.
Example
This example receives OTLP metrics and aggregates them for 30s before sending to the next exporter.
otelcol.receiver.otlp "default" {
grpc { ... }
http { ... }
output {
metrics = [otelcol.processor.interval.default.input]
}
}
otelcol.processor.interval "default" {
interval = "30s"
output {
metrics = [otelcol.exporter.otlphttp.grafana_cloud.input]
}
}
otelcol.exporter.otlphttp "grafana_cloud" {
client {
endpoint = "https://otlp-gateway-prod-gb-south-0.grafana.net/otlp"
auth = otelcol.auth.basic.grafana_cloud.handler
}
}
otelcol.auth.basic "grafana_cloud" {
username = env("GRAFANA_CLOUD_USERNAME")
password = env("GRAFANA_CLOUD_API_KEY")
}
Timestamp | Metric Name | Aggregation Temporarility | Attributes | Value |
---|---|---|---|---|
0 | test_metric | Cumulative | labelA: foo | 4.0 |
2 | test_metric | Cumulative | labelA: bar | 3.1 |
4 | other_metric | Delta | fruitType: orange | 77.4 |
6 | test_metric | Cumulative | labelA: foo | 8.2 |
8 | test_metric | Cumulative | labelA: foo | 12.8 |
10 | test_metric | Cumulative | labelA: bar | 6.4 |
The processor immediately passes the following metric to the next processor in the chain because it is a Delta metric.
Timestamp | Metric Name | Aggregation Temporarility | Attributes | Value |
---|---|---|---|---|
4 | other_metric | Delta | fruitType: orange | 77.4 |
At the next interval
(15s by default), the processor passed the following metrics to the next processor in the chain.
Timestamp | Metric Name | Aggregation Temporarility | Attributes | Value |
---|---|---|---|---|
8 | test_metric | Cumulative | labelA: foo | 12.8 |
10 | test_metric | Cumulative | labelA: bar | 6.4 |
Compatible components
otelcol.processor.interval
can accept arguments from the following components:
- Components that export OpenTelemetry
otelcol.Consumer
otelcol.processor.interval
has exports that can be consumed by the following components:
- Components that consume OpenTelemetry
otelcol.Consumer
Note
Connecting some components may not be sensible or components may require further configuration to make the connection work correctly. Refer to the linked documentation for more details.