Grafana Cloud


otelcol.receiver.loki receives Loki log entries, converts them to the OpenTelemetry logs format, and forwards them to other otelcol.* components.

Multiple otelcol.receiver.loki components can be specified by giving them different labels.


otelcol.receiver.loki "LABEL" {
  output {
    logs = [...]


otelcol.receiver.loki doesn’t support any arguments and is configured fully through inner blocks.


The following blocks are supported inside the definition of otelcol.receiver.loki:

outputoutputConfigures where to send converted telemetry data.yes

output block

The output block configures a set of components to forward resulting telemetry data to.

The following arguments are supported:

logslist(otelcol.Consumer)List of consumers to send logs to.[]no
metricslist(otelcol.Consumer)List of consumers to send metrics to.[]no
traceslist(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.

Exported fields

The following fields are exported and can be referenced by other components:

receiverLogsReceiverA value that other components can use to send Loki logs to.

Component health

otelcol.receiver.loki is only reported as unhealthy if given an invalid configuration.

Debug information

otelcol.receiver.loki does not expose any component-specific debug information.


This example uses the otelcol.receiver.loki component as a bridge between the Loki and OpenTelemetry ecosystems. The component exposes a receiver which the loki.source.file component uses to send Loki log entries to. The logs are converted to the OTLP format before they are forwarded to the otelcol.exporter.otlp component to be sent to an OTLP-capable endpoint:

loki.source.file "default" {
  targets = [
    {__path__ = "/tmp/foo.txt", "loki.format" = "logfmt"},
    {__path__ = "/tmp/bar.txt", "loki.format" = "json"},
  forward_to = [otelcol.receiver.loki.default.receiver]

otelcol.receiver.loki "default" {
  output {
    logs = [otelcol.exporter.otlp.default.input]

otelcol.exporter.otlp "default" {
  client {
    endpoint = env("OTLP_ENDPOINT")

Compatible components

otelcol.receiver.loki can accept arguments from the following components:

otelcol.receiver.loki has exports that can be consumed by the following components:


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.