NAME

OpenTelemetry::SDK::Exporter::Console - An OpenTelemetry span exporter that prints to the console

SYNOPSIS

BEGIN { $ENV{OTEL_TRACES_EXPORTER} = 'console' }
use OpenTelemetry::SDK;

# Exported spans will be printed to the console

# Or set it manually
OpenTelemetry->tracer_provider->add_span_processor(
    OpenTelemetry::SDK::Trace::Span::Processor::Simple->new(
        OpenTelemetry::SDK::Exporter::Console->new
    ),
);

DESCRIPTION

This module provide a span exporter that prints exported spans to the console. It is unlikely this will be used in production environments, but it may be useful during development.

METHODS

This class implements the OpenTelemetry::Exporter role. Please consult that module's documentation for details on the behaviours it provides.

new

$exporter = OpenTelemetry::SDK::Exporter::Console->new(
    handle => $handle // *STDERR,
);

Create a new exporter. Takes an optional handle parameter which will be used as the target for printing. By default, this will be set to standard error.

SEE ALSO

OpenTelemetry::Exporter
OpenTelemetry::SDK
OpenTelemetry::SDK::Trace::Span::Processor::Simple

COPYRIGHT AND LICENSE

This software is copyright (c) 2023 by José Joaquín Atria.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.