Caution
Grafana Agent has reached End-of-Life (EOL) on November 1, 2025. Agent is no longer receiving vendor support and will no longer receive security or bug fixes. Current users of Agent Static mode, Agent Flow mode, and Agent Operator should proceed with migrating to Grafana Alloy. If you have already migrated to Alloy, no further action is required. Read more about why we recommend migrating to Grafana Alloy.
Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
otelcol.receiver.prometheus
BETA: This is a beta component. Beta components are subject to breaking changes, and may be replaced with equivalent functionality that cover the same use case.
otelcol.receiver.prometheus receives Prometheus metrics, converts them to the
OpenTelemetry metrics format, and forwards them to other otelcol.*
components.
Multiple otelcol.receiver.prometheus components can be specified by giving them
different labels.
Usage
otelcol.receiver.prometheus "LABEL" {
output {
metrics = [...]
}
}Arguments
otelcol.receiver.prometheus doesn’t support any arguments and is configured fully
through inner blocks.
Blocks
The following blocks are supported inside the definition of
otelcol.receiver.prometheus:
output block
The output block configures a set of components to forward resulting telemetry data to.
The following arguments are supported:
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.
Exported fields
The following fields are exported and can be referenced by other components:
Component health
otelcol.receiver.prometheus is only reported as unhealthy if given an invalid
configuration.
Debug information
otelcol.receiver.prometheus does not expose any component-specific debug
information.
Example
This example uses the otelcol.receiver.prometheus component as a bridge
between the Prometheus and OpenTelemetry ecosystems. The component exposes a
receiver which the prometheus.scrape component uses to send Prometheus metric
data to. The metrics are converted to the OTLP format before they are forwarded
to the otelcol.exporter.otlp component to be sent to an OTLP-capable
endpoint:
prometheus.scrape "default" {
// Collect metrics from Grafana Agent's default HTTP listen address.
targets = [{"__address__" = "127.0.0.1:12345"}]
forward_to = [otelcol.receiver.prometheus.default.receiver]
}
otelcol.receiver.prometheus "default" {
output {
metrics = [otelcol.exporter.otlp.default.input]
}
}
otelcol.exporter.otlp "default" {
client {
endpoint = env("OTLP_ENDPOINT")
}
}


