Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/send-data/alloy/reference/components/prometheus/prometheus.echo.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/send-data/alloy/reference/components/prometheus/prometheus.echo/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
prometheus.echo
The prometheus.echo component receives Prometheus metrics and writes them to stdout in Prometheus exposition format.
This component is useful for debugging and testing the flow of metrics through a pipeline.
You can place prometheus.echo at any stage in your pipeline to inspect the metrics passing through it.
You can specify multiple prometheus.echo components by giving them different labels.
Usage
prometheus.echo "<LABEL>" {
}Arguments
You can use the following arguments with prometheus.echo:
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
format | string | The output format for metrics. Must be text or openmetrics. | text | no |
The format argument controls how the component encodes metrics when written to stdout:
text- Uses the Prometheus text exposition format. This is the default.openmetrics- Uses the OpenMetrics text format.
If you set any other value, the component logs a warning each time it writes metrics and uses the text format.
Blocks
The prometheus.echo component doesn’t support any blocks.
You can configure this component with arguments.
Exported fields
The following fields are exported and can be referenced by other components:
| Name | Type | Description |
|---|---|---|
receiver | MetricsReceiver | A value that other components can use to send metrics to. |
Component health
prometheus.echo is only reported as unhealthy if its configuration can’t be evaluated, for example because an argument has the wrong type.
In those cases, exported fields retain their last healthy values.
An unrecognized format value doesn’t make the component unhealthy. The component uses the text format instead.
Debug information
prometheus.echo doesn’t expose any component-specific debug information.
Debug metrics
prometheus.echo doesn’t expose any component-specific debug metrics.
Example
This example creates a metrics generation and inspection pipeline:
prometheus.exporter.unix "default" {
}
prometheus.scrape "demo" {
targets = prometheus.exporter.unix.default.targets
forward_to = [prometheus.echo.debug.receiver]
}
prometheus.echo "debug" {
format = "text"
}In this example:
- The
prometheus.exporter.unixcomponent exposes system metrics. - The
prometheus.scrapecomponent scrapes those metrics. - The
prometheus.echocomponent receives the scraped metrics and writes them tostdoutin Prometheus text format.
When you run this configuration, the component writes metrics to stdout, which is useful to:
- Debug metric collection issues
- Verify metric labels and values
- Test metric transformations
- Understand the structure of metrics in your pipeline
Example with OpenMetrics format
prometheus.scrape "demo" {
targets = [
{"__address__" = "localhost:9090"},
]
forward_to = [prometheus.echo.debug.receiver]
}
prometheus.echo "debug" {
format = "openmetrics"
}This example outputs metrics using the OpenMetrics format instead of the traditional Prometheus text format.
Compatible components
prometheus.echo has exports that can be consumed by the following components:
- Components that consume Prometheus
MetricsReceiver
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.
Was this page helpful?
Related resources from Grafana Labs


