Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6d9a4fc
add echo
iamrajiv Aug 2, 2025
f2347b7
add test
iamrajiv Aug 2, 2025
a253d8e
add changelog
iamrajiv Aug 2, 2025
1e44b4e
use prometheus expfmt encoder
iamrajiv Aug 4, 2025
df366c9
add doc
iamrajiv Oct 7, 2025
ad2d3a7
Update docs/sources/reference/components/prometheus/prometheus.echo.md
iamrajiv Oct 8, 2025
1622764
Update docs/sources/reference/components/prometheus/prometheus.echo.md
iamrajiv Oct 8, 2025
9d0b21e
Update docs/sources/reference/components/prometheus/prometheus.echo.md
iamrajiv Oct 8, 2025
9a983e7
Update docs/sources/reference/components/prometheus/prometheus.echo.md
iamrajiv Oct 8, 2025
db423cb
Update docs/sources/reference/components/prometheus/prometheus.echo.md
iamrajiv Oct 8, 2025
5e42d55
Update docs/sources/reference/components/prometheus/prometheus.echo.md
iamrajiv Oct 8, 2025
a3d0388
Update docs/sources/reference/components/prometheus/prometheus.echo.md
iamrajiv Oct 8, 2025
f1b5fed
Fix build issues
dehaansa Dec 8, 2025
53d52d3
Appease linter and regenerate things
dehaansa Dec 9, 2025
42a04f4
update to go v1.25.5 (#5027)
kalleep Dec 9, 2025
f86c8b2
Introduce Shared YAML Dependency File To Manage Replace Directives (#…
blewis12 Dec 9, 2025
e9ab344
fix: add StoreBuilder to mimir.alerts.kubernetes eventProcessor (#5010)
synthe102 Dec 9, 2025
e1f5704
Add changelog for PR 5002 (#5042)
dehaansa Dec 9, 2025
390d445
Fix missing release note for v1.12 (#5043)
thampiotr Dec 9, 2025
bd52fba
remove labelstore from prometheus interceptor (#4890)
kgeckhart Dec 9, 2025
c6b36d0
Fix handling of multiplexed long lines in Docker logs (#4713)
axd1x8a Dec 9, 2025
c38d836
update changelog
dehaansa Dec 10, 2025
c48fc0d
add cloud-provider labels to target metrics (#4942)
matthewnolf Dec 10, 2025
3941a47
stop storage and wal after test (#5056)
kalleep Dec 10, 2025
21d3b2b
Merge branch 'main' into ins
dehaansa Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/blank.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ body:
- otelcol.receiver.vcenter
- otelcol.receiver.zipkin
- otelcol.storage.file
- prometheus.echo
- prometheus.enrich
- prometheus.exporter.apache
- prometheus.exporter.azure
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ body:
- otelcol.receiver.vcenter
- otelcol.receiver.zipkin
- otelcol.storage.file
- prometheus.echo
- prometheus.enrich
- prometheus.exporter.apache
- prometheus.exporter.azure
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ body:
- otelcol.receiver.vcenter
- otelcol.receiver.zipkin
- otelcol.storage.file
- prometheus.echo
- prometheus.enrich
- prometheus.exporter.apache
- prometheus.exporter.azure
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ body:
- otelcol.receiver.vcenter
- otelcol.receiver.zipkin
- otelcol.storage.file
- prometheus.echo
- prometheus.enrich
- prometheus.exporter.apache
- prometheus.exporter.azure
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/proposal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ body:
- otelcol.receiver.vcenter
- otelcol.receiver.zipkin
- otelcol.storage.file
- prometheus.echo
- prometheus.enrich
- prometheus.exporter.apache
- prometheus.exporter.azure
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Main (unreleased)

- Add htpasswd file based authentication for `otelcol.auth.basic` (@pkarakal)

- Add `prometheus.echo` component for local inspection of Prometheus metrics. The component writes received metrics to stdout in Prometheus exposition format, enabling easier debugging and testing of metrics flow. (@iamrajiv)

### Enhancements

- update promtail converter to use `file_match` block for `loki.source.file` instead of going through `local.file_match`. (@kalleep)
Expand Down
1 change: 1 addition & 0 deletions docs/sources/reference/compatibility/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ The following components, grouped by namespace, _export_ Prometheus `MetricsRece
{{< /collapse >}}

{{< collapse title="prometheus" >}}
- [prometheus.echo](../components/prometheus/prometheus.echo)
- [prometheus.enrich](../components/prometheus/prometheus.enrich)
- [prometheus.relabel](../components/prometheus/prometheus.relabel)
- [prometheus.remote_write](../components/prometheus/prometheus.remote_write)
Expand Down
122 changes: 122 additions & 0 deletions docs/sources/reference/components/prometheus/prometheus.echo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
canonical: https://grafana.com/docs/alloy/latest/reference/components/prometheus/prometheus.echo/
description: Learn about prometheus.echo
labels:
stage: general-availability
products:
- oss
title: prometheus.echo
---

# `prometheus.echo`

The `prometheus.echo` component receives Prometheus metrics and writes them to stdout in Prometheus exposition format.
Comment thread
clayton-cornell marked this conversation as resolved.
This component is useful for debugging and testing the flow of metrics through a pipeline, allowing you to see exactly what metrics are being received at a particular point in your configuration.

## Usage

```alloy
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 metrics are encoded when written to stdout:

* `text` - Uses the Prometheus text exposition format (default).
* `openmetrics` - Uses the OpenMetrics 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 given an invalid configuration.
In those cases, exported fields retain their last healthy values.

## 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:

```alloy
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:

1. The `prometheus.exporter.unix` component exposes system metrics.
1. The `prometheus.scrape` component scrapes those metrics.
1. The `prometheus.echo` component receives the scraped metrics and writes them to stdout in Prometheus text format.

When you run this configuration, you'll see the metrics being written 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

```alloy
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.

<!-- START GENERATED COMPATIBLE COMPONENTS -->

## Compatible components

`prometheus.echo` has exports that can be consumed by the following components:

- Components that consume [Prometheus `MetricsReceiver`](../../../compatibility/#prometheus-metricsreceiver-consumers)

{{< admonition type="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.
{{< /admonition >}}

<!-- END GENERATED COMPATIBLE COMPONENTS -->
1 change: 1 addition & 0 deletions internal/component/all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ import (
_ "github.com/grafana/alloy/internal/component/otelcol/receiver/vcenter" // Import otelcol.receiver.vcenter
_ "github.com/grafana/alloy/internal/component/otelcol/receiver/zipkin" // Import otelcol.receiver.zipkin
_ "github.com/grafana/alloy/internal/component/otelcol/storage/file" // Import otelcol.storage.file
_ "github.com/grafana/alloy/internal/component/prometheus/echo" // Import prometheus.echo
_ "github.com/grafana/alloy/internal/component/prometheus/enrich" // Import prometheus.enrich
_ "github.com/grafana/alloy/internal/component/prometheus/exporter/apache" // Import prometheus.exporter.apache
_ "github.com/grafana/alloy/internal/component/prometheus/exporter/azure" // Import prometheus.exporter.azure
Expand Down
Loading
Loading