This is documentation for the next version of Grafana Alloy Documentation. For the latest stable release, go to the latest version.
otelcol.receiver.awsecscontainermetrics
Community: This component is developed, maintained, and supported by the Alloy user community. Grafana doesn’t offer commercial support for this component. To enable and use community components, you must set the
--feature.community-components.enabledflag totrue.
EXPERIMENTAL: This is an experimental component. Experimental components are subject to frequent breaking changes, and may be removed with no equivalent replacement. To enable and use an experimental component, you must set the
stability.levelflag toexperimental.
otelcol.receiver.awsecscontainermetrics reads AWS ECS task- and container-level metadata, and resource usage metrics such as CPU, memory, network, and disk, and forwards them to other otelcol.* components.
Note
otelcol.receiver.awsecscontainermetricsis a wrapper over the upstream OpenTelemetry Collectorawsecscontainermetricsreceiver. Bug reports or feature requests will be redirected to the upstream repository, if necessary.
This receiver supports ECS Fargate and ECS on EC2. It uses ECS Task Metadata Endpoint V4 which is automatically available within the task’s containers. Therefore, you should run the Alloy collector using this receiver as a sidecar within the task you want to monitor. Refer to the upstream awsecscontainermetrics receiver documentation for more details.
You can specify multiple otelcol.receiver.awsecscontainermetrics components by giving them different labels.
Usage
otelcol.receiver.awsecscontainermetrics "<LABEL>" {
output {
metrics = [...]
}
}Arguments
You can use the following arguments with otelcol.receiver.awsecscontainermetrics:
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
collection_interval | duration | How frequently to collect and emit metrics. | “20s” | no |
Blocks
You can use the following blocks with otelcol.receiver.awsecscontainermetrics:
| Block | Description | Required |
|---|---|---|
output | Configures where to send received telemetry data. | yes |
debug_metrics | Configures the metrics that this component generates to monitor its state. | no |
output
RequiredThe 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.
debug_metrics
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 |
disable_high_cardinality_metrics is the 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_metricsonly applies tootelcol.exporter.*andotelcol.receiver.*components.
Exported fields
otelcol.receiver.awsecscontainermetrics doesn’t export any fields.
Component health
otelcol.receiver.awsecscontainermetrics is only reported as unhealthy if given an invalid configuration.
Debug information
otelcol.receiver.awsecscontainermetrics doesn’t expose any component-specific debug information.
Example
The following example collects eight task-level metrics from the 52 metrics available in an ECS task and forwards them to a filter processor.
otelcol.receiver.awsecscontainermetrics "default" {
collection_interval = "60s"
output {
metrics = [otelcol.processor.filter.default.input]
}
}
otelcol.processor.filter "default" {
error_mode = "ignore"
metrics {
metric = [
string.join([
`metric.name != "ecs.task.memory.reserved"`,
`metric.name != "ecs.task.memory.utilized"`,
`metric.name != "ecs.task.cpu.reserved"`,
`metric.name != "ecs.task.cpu.utilized"`,
`metric.name != "ecs.task.network.rate.rx"`,
`metric.name != "ecs.task.network.rate.tx"`,
`metric.name != "ecs.task.storage.read_bytes"`,
`metric.name != "ecs.task.storage.write_bytes"`,
], " and "),
]
}
output {
metrics = [otelcol.exporter.otlp.default.input]
}
}
otelcol.exporter.otlp "default" {
client {
endpoint = env("<OTLP_ENDPOINT>")
}
}Compatible components
otelcol.receiver.awsecscontainermetrics can accept arguments from the following components:
- Components that export 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.



