OpenTracing::Role::Span - Role for OpenTracing implementations.
This is a Role for OpenTracing implenetations that are compliant with the OpenTracing::Interface.
With the exception of calls to get_context() (which are always allowed), finish() must be the last call made to any span instance, and to do otherwise leads to undefined behavior (but not returning an exception).
The following methods from OpenTracing::Interface have been implemented. See their documentation for more details.
Yields the SpanContext for this Span. Note that the return value of get_context() is still valid after a call to finish(), as is a call to get_context() after a call to finish().
See "get_context" in OpenTracing::Interface::Span.
Changes the operation name.
See "overwrite_operation_name" in OpenTracing::Interface::Span.
Sets the end timestamp and finalizes Span state.
See "finish" in OpenTracing::Interface::Span.
Adds a tag to the span.
See "add_tag" in OpenTracing::Interface::Span.
Adds multiple tags to the span at the same time
See "add_tags" in OpenTracing::Interface::Span.
This will return a Hash of key/value pairs.
See "get_tags" in OpenTracing::Interface::Span.
Adds a log record to the span.
See "log_data" in OpenTracing::Interface::Span.
Sets a key:value pair on this Span and its SpanContext that also propagates to descendants of this Span.
See "add_baggage_item" in OpenTracing::Interface::Span.
Sets multiple baggage_items at once.
See "add_baggage_items" in OpenTracing::Interface::Span.
Returns either the corresponding baggage value, or undef when such a value was missing.
See "get_baggage_item" in OpenTracing::Interface::Span.
See "get_baggage_items" in OpenTracing::Interface::Span.
Never use any of attributes or methods below in any integration!
Only methods mentioned in the Public OpenTracing::Interface are safe to be used in any integration or when instrumenting applications.
A required Str Type value, for the operation name.
See get_operation_name and overwrite_operation_name.
A read-only PositiveOrZeroNum floatingpoint that defaults to the number of seconds since epoch.
A PositiveOrZeroNum floatingpoint that can only be set by calling finish.
See finish and has_finished.
An optional HashRef of Values that defaults to an empty hash reference.
See add_tag, add_tags, get_tag, and get_tags.
A required read-only SpanContext type.
Although a read-only, it will get swapped for a clone_with result when trying to add any baggage_item, since SpanContext is inmutable.
See get_context, add_baggage_item, and add_baggage_items.
A optional Span or SpanContext.
Note: this may not be the correct design and this attribute may disapear.
Maybe a CodeRef that will gets executed when finish gets called. Its only parameter, is the Span invocant itself.
Its usefulnes currently is for dealing with c<span> inside Tracer.
These methods are just for the convenience building an implementation, and are not part of the OpenTracing Interface..
The accessor for the operatation_name
The state wether or not finish has been called or not.
The identifier of the Span itself, through its span context.
The identifier of the parent Span
The time (in seconds) between start and finish. This will croak when either start_time or finish_time has not been set yet.
A helper method to make it explicit that the time is in floating point, and not the usual integer number of seconds since epoch.
Type constraints for checking Interfaces
A role that defines the Span interface
Theo van Hoesel <firstname.lastname@example.org>
'OpenTracing API for Perl' is Copyright (C) 2019 .. 2020, Perceptyx Inc
This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.
This library is distributed in the hope that it will be useful, but it is provided "as is" and without any express or implied warranties.
For details, see the full text of the license in the file LICENSE.
To install OpenTracing::Role, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.