Menu
Grafana Cloud

otelcol.exporter.logging

Warning

The OpenTelemetry Collector logging exporter is deprecated. It will be removed from the upstream Collector repository in September 2024. otelcol.exporter.logging may also be removed in a future Alloy version. Use otelcol.exporter.debug instead.

otelcol.exporter.logging accepts telemetry data from other otelcol components and writes them to the console.

This component writes logs at the info level. The logging config block must be configured to write logs at the info level.

Note

otelcol.exporter.logging is a wrapper over the upstream OpenTelemetry Collector logging exporter. Bug reports or feature requests will be redirected to the upstream repository, if necessary.

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

Usage

alloy
otelcol.exporter.logging "LABEL" { }

Arguments

otelcol.exporter.logging 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".

Blocks

The following blocks are supported inside the definition of otelcol.exporter.logging:

HierarchyBlockDescriptionRequired
debug_metricsdebug_metricsConfigures the metrics that this component generates to monitor its state.no

The > symbol indicates deeper levels of nesting. For example, client > tls refers to a tls block defined inside a client block.

debug_metrics block

The debug_metrics block configures the metrics that this component generates to monitor its state.

The following arguments are supported:

NameTypeDescriptionDefaultRequired
disable_high_cardinality_metricsbooleanWhether to disable certain high cardinality metrics.trueno
levelstringControls the level of detail for metrics emitted by the wrapped collector."detailed"no

disable_high_cardinality_metrics is the Grafana Alloy equivalent to the telemetry.disableHighCardinalityMetrics feature gate in the OpenTelemetry Collector. It removes attributes that could cause high cardinality metrics. For example, attributes with IP addresses and port numbers in metrics about HTTP and gRPC connections are removed.

Note

If configured, disable_high_cardinality_metrics only applies to otelcol.exporter.* and otelcol.receiver.* components.

level is the Alloy equivalent to the telemetry.metrics.level feature gate in the OpenTelemetry Collector. Possible values are "none", "basic", "normal" and "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.logging is only reported as unhealthy if given an invalid configuration.

Debug information

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

Example

This example receives OTLP metrics, logs, and traces and writes them to the console:

alloy
otelcol.receiver.otlp "default" {
    grpc {}
    http {}

    output {
        metrics = [otelcol.exporter.logging.default.input]
        logs    = [otelcol.exporter.logging.default.input]
        traces  = [otelcol.exporter.logging.default.input]
    }
}

otelcol.exporter.logging "default" {}

Compatible components

otelcol.exporter.logging 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.