=encoding UTF-8

=head1 NAME

OpenTelemetry::Propagator::TraceContext - Propagate context using the W3C TraceContext format

=head1 SYNOPSIS

    use OpenTelemetry::Trace;
    use OpenTelemetry::Propagator::TraceContext;

    my $propagator = OpenTelemetry::Propagator::TraceContext;

    # Inject TraceContext data from the context to a carrier
    my $carrier = {};
    $propagator->inject( $carrier, $context );

    # Extract TraceContext data from a carrier to the context
    my $new_context = $propagator->extract( $carrier, $context );

    # The TraceContext data will be in the span in the context
    my $span = OpenTelemetry::Trace->span_from_context($new_context);


=head1 DESCRIPTION

This package defines a propagator class that can interact with the context
(which can be either an implicit or explicit instance of
L<OpenTelemetry::Context>) and inject or extract data using the
L<W3C TraceContext format|https://w3c.github.io/trace-context>.

It implements the propagator interface defined in
L<OpenTelemetry::Propagator>.

=head1 METHODS

=head2 inject

    $propagator = $propagator->inject(
        $carrier,
        $context // OpenTelemetry::Context->current,
        $setter  // OpenTelemetry::Propagator::TextMap::SETTER,
    )

=head2 extract

    $new_context = $propagator->extract(
        $carrier,
        $context // OpenTelemetry::Context->current,
        $getter  // OpenTelemetry::Propagator::TextMap::GETTER,
    )

=head2 keys

    @keys = $propagator->keys

=head1 SEE ALSO

=over

=item L<OpenTelemetry::Context>

=item L<OpenTelemetry::Propagator>

=item L<W3C TraceContext format|https://w3c.github.io/trace-context>

=item L<OpenTelemetry::TraceContext::W3C>

A different distribution written to deal with W3C's tracecontext data,
earlier than this distribution or its related L<OpenTelemetry::SDK>

=back

=head1 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.
