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.

Experimental

otelcol.exporter.debug

otelcol.exporter.debug accepts telemetry data from other otelcol components and writes them to the console (stderr). You can control the verbosity of the logs.

Note

otelcol.exporter.debug is a wrapper over the upstream OpenTelemetry Collector debug exporter. If necessary, bug reports or feature requests are redirected to the upstream repository.

Multiple otelcol.exporter.debug components can be specified by giving them different labels.

Usage

Alloy
otelcol.exporter.debug "LABEL" { }

Arguments

otelcol.exporter.debug supports the following arguments:

NameTypeDescriptionDefaultRequired
verbositystringVerbosity of the generated logs."normal"no
sampling_initialintNumber of messages initially logged each second.2no
sampling_thereafterintSampling rate after the initial messages are logged.500no

The verbosity argument must be one of "basic", "normal", or "detailed".

Exported fields

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

NameTypeDescription
inputotelcol.ConsumerA value that other components can use to send telemetry data to.

input accepts otelcol.Consumer data for any telemetry signal (metrics, logs, or traces).

Component health

otelcol.exporter.debug is only reported as unhealthy if given an invalid configuration.

Debug information

otelcol.exporter.debug does not expose any component-specific debug information.

Example

This example scrapes Prometheus UNIX metrics and writes them to the console:

Alloy
prometheus.exporter.unix "default" { }

prometheus.scrape "default" {
    targets    = prometheus.exporter.unix.default.targets
    forward_to = [otelcol.receiver.prometheus.default.receiver]
}

otelcol.receiver.prometheus "default" {
    output {
        metrics = [otelcol.exporter.debug.default.input]
    }
}

otelcol.exporter.debug "default" {
    verbosity           = "detailed"
    sampling_initial    = 1
    sampling_thereafter = 1
}

Compatible components

otelcol.exporter.debug has exports that can be consumed by the following components:

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.