OpenTracing::Role::Scope - Role for OpenTracing implementations.
package OpenTracing::Implementation::MyBackendService::Scope; use Moo; with 'OpenTracing::Role::Scope' sub close => { ... } 1;
This Moo::Role provides the consuming class with most, if not all, of the methods being described in OpenTracing::Interface::Scope.
Moo::Role
The following methods from OpenTracing::Interface have been implemented. See their documentation for more details.
close
Mark the end of the active period for the current thread and Scope, updating the ScopeManager::active() in the process.
ScopeManager::active()
See "close" in OpenTracing::Interface::Scope.
get_span
Returns the Span that's been scoped by this Scope
Span
Scope
See "get_span" in OpenTracing::Interface::Scope.
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.
==head1 ATTRIBUTES
span
A Span type.
finish_span_on_close
A Bool type.
See start_active_span.
start_active_span
closed
A Bool type, that keeps the state of this scope, so one can not close a scope more than once, and unintentially would call the code in the on_close closure.
on_close
Maybe a CodeRef that will gets executed when close gets called. Itss only parameter, is the Scope invocant itself.
Before this code reference gets called, its span may recieve a finish call, depending wether or not finish_span_on_close has been set or not.
finish
Its usefulnes currently is for dealing with scope and a ScopeManager.
ScopeManager
Type constraints for checking Interfaces
A role that defines the Scope interface
Theo van Hoesel <tvanhoesel@perceptyx.com>
'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.
cpanm
cpanm OpenTracing::Role
CPAN shell
perl -MCPAN -e shell install OpenTracing::Role
For more information on module installation, please visit the detailed CPAN module installation guide.