=encoding utf8

=head1 NAME

OpenTelemetry::Integration::LWP::UserAgent - OpenTelemetry integration for LWP::UserAgent

=head1 SYNOPSIS

    use OpenTelemetry::Integration 'LWP::UserAgent';

    # Or pass options to the integration
    use OpenTelemetry::Integration 'LWP::UserAgent' => {
        request_headers  => [ ... ],
        response_headers => [ ... ],
    };

    LWP::UserAgent->new->get('https://metacpan.org');

=head1 DESCRIPTION

See L<OpenTelemetry::Integration> for more details.

Since this is a core module, it's included in the L<OpenTelemetry> core
distribution as well.

=head1 CONFIGURATION

=head2 request_headers

This integration can be configured to store specific request headers with
every generated span. In order to do so, set this key to an array reference
with the name of the request headers you want as strings.

The strings will be matched case-insensitively to the header names, and hyphens
and underscores will be treated indistinctly. Otherwise, names will be matched
literally.

Matching headers will be stored as span attributes under the
C<http.request.header> namespace, as described in
L<the semantic convention documentation|https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#http-request-and-response-headers>.

=head2 response_headers

This integration can be configured to store specific response headers with
every generated span. In order to do so, set this key to an array reference
with the name of the response headers you want as strings.

The strings will be matched case-insensitively to the header names, and hyphens
and underscores will be treated indistinctly. Otherwise, names will be matched
literally.

Matching headers will be stored as span attributes under the
C<http.response.header> namespace, as described in
L<the semantic convention documentation|https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#http-request-and-response-headers>.

=head1 COPYRIGHT

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.
