NAME
OpenTelemetry::Trace::Span::Status - The status of an OpenTelemetry span
SYNOPSIS
use OpenTelemetry::Trace::Span::Status;
my $ok = OpenTelemetry::Trace::Span::Status->ok;
my $unset = OpenTelemetry::Trace::Span::Status->unset;
my $error = OpenTelemetry::Trace::Span::Status->error(
description => 'Something went boom',
);
DESCRIPTION
This module provides a class that represents the status of a OpenTelemetry::Trace::Span. The status is represented by an internal code, and can be either Unset, which is the default value; Ok, to represent the status of an operation that is deemed to have completed successfully; or Error, to represent an operation that did not complete successfully. Error statuses can have a description string attached to them, to further explain the source of the error, but setting a description on a non-error status will issue a warning and the set description will be ignored.
Although not mandatory, libraries marking the status of a span as "error" are expected to provide a description of the reason, which should be publicly documented.
METHODS
ok
$status = OpenTelemetry::Trace::Span::Status->ok;
Creates a new status object with its code set to Ok. Any additional parameters will be passed to the default constructor.
unset
$status = OpenTelemetry::Trace::Span::Status->unset;
Creates a new status object with its code not set. Any additional parameters will be passed to the default constructor.
error
$status = OpenTelemetry::Trace::Span::Status->error(
description => $description // '',
);
Creates a new status object with its code set to Error. Any additional parameters will be passed to the default constructor.
is_ok
$bool = $status->is_ok;
Returns a true value if this instance represents an Ok status.
unset
$bool = $status->is_unset;
Returns a true value if this instance represents an Unset status.
error
$bool = $status->is_error;
Returns a true value if this instance represents an Error status.
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.