The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

OpenTelemetry::SDK::Trace::SpanLimits - A class that governs the configuration of spans

SYNOPSIS

...

DESCRIPTION

This module provides a class that encapsulates the configuration of limits for span attributes, events, and links. It can be configured either via environment variables as described in "CONFIGURATION" in OpenTelemetry::SDK.

METHODS

new

$limits = OpenTelemetry::SDK::Trace::SpanLimits->new;

Constructs a new OpenTelemetry::SDK::Trace::SpanLimits instance. The constructor takes no arguments, but it will read the following environment variables as described in "CONFIGURATION" in OpenTelemetry::SDK and in the description of the accessors below.

attribute_count_limit

$number = $limits->attribute_count_limit;

Returns the maximum number of attributes allowed for a span. This value comes from OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, or OTEL_ATTRIBUTE_COUNT_LIMIT if that is not set.

If not defined, this limit will default to 128. Otherwise, the value must be a positive integer. If set to a value that does not meet this requirement, a warning will be logged and the default value will be used instead.

event_attribute_count_limit

$number = $limits->event_attribute_count_limit;

Returns the maximum number of attributes allowed for events in a span. This value comes from OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT, or OTEL_ATTRIBUTE_COUNT_LIMIT if that is not set.

If not defined, this limit will default to 128. Otherwise, the value must be a positive integer. If set to a value that does not meet this requirement, a warning will be logged and the default value will be used instead.

$number = $limits->link_attribute_count_limit;

Returns the maximum number of attributes allowed for links in a span. This value comes from OTEL_LINK_ATTRIBUTE_COUNT_LIMIT, or OTEL_ATTRIBUTE_COUNT_LIMIT if that is not set.

If not defined, this limit will default to 128. Otherwise, the value must be a positive integer. If set to a value that does not meet this requirement, a warning will be logged and the default value will be used instead.

attribute_length_limit

$number = $limits->attribute_length_limit;

Returns the maximum length for the values of an attribute in a span. This value comes from OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, or OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT if that is not set.

This limit might be undefined, in which case no limit will be set. If a limit is set, however, it must be at least 32. If set to a value lower than this a warning will be logged and the value will be ignored.

event_attribute_length_limit

$number = $limits->event_attribute_length_limit;

Returns the maximum length for the values of an event attribute in a span. This value comes from OTEL_EVENT_ATTRIBUTE_VALUE_LENGTH_LIMIT, or OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT if that is not set.

This limit might be undefined, in which case no limit will be set. If a limit is set, however, it must be at least 32. If set to a value lower than this a warning will be logged and the value will be ignored.

$number = $limits->link_attribute_length_limit;

Returns the maximum length for the values of a link attribute in a span. This value comes from OTEL_LINK_ATTRIBUTE_VALUE_LENGTH_LIMIT, or OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT if that is not set.

This limit might be undefined, in which case no limit will be set. If a limit is set, however, it must be at least 32. If set to a value lower than this a warning will be logged and the value will be ignored.

event_count_limit

$number = $limits->event_count_limit;

Returns the maximum number of events in a span. This value comes from OTEL_SPAN_EVENT_COUNT_LIMIT.

If not defined, this limit will default to 128. Otherwise, the value must be a positive integer. If set to a value that does not meet this requirement, a warning will be logged and the default value will be used instead.

$number = $limits->link_count_limit;

Returns the maximum number of links in a span. This value comes from OTEL_SPAN_LINK_COUNT_LIMIT.

If not defined, this limit will default to 128. Otherwise, the value must be a positive integer. If set to a value that does not meet this requirement, a warning will be logged and the default value will be used instead.

SEE ALSO

OpenTelemetry::SDK

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.