NAME

OpenTracing::Span - represents an operation or parent operation

DESCRIPTION

The reference definition for a span is a good starting point for understanding these:

https://opentracing.io/docs/overview/spans/

new

Instantiates a new span. Rarely called directly - you'd want to let the OpenTracing::Tracer take care of this for you.

Takes the following named parameters:

  • parent - an OpenTracing::Span for a parent instance (optional)

  • parent_id - the span ID for the parent (optional)

  • trace_id - the current trace ID (optional)

  • operation_name - what to use for this span name

trace_id

The trace ID for this span. Multiple spans are grouped under a single trace.

id

The span ID. This should be unique.

parent_id

Parent span ID. 0 if there isn't one.

flags

Any flags relating to this span.

start_time

Exact time this span started, in microseconds.

start_time

Exact time this span finished, in microseconds.

Returns undef if the span is not yet finished.

duration

Total duration of this span, including any nested spans.

operation_name

The operation that this span represents.

tags

The tags relating to this span.

tag_list

A list of tags as OpenTracing::Tag instances.

logs

The arrayref of log entries for this span, as OpenTracing::Log instances.

log_list

A list of log entries for this span, as OpenTracing::Log instances.

log

Records a single log message.

tag

Applies key/value tags to this span.

The semantic conventions may be of interest here.

Example usage:

 $span->tag(
  'http.status_code' => 200,
  'http.url' => 'https://localhost/xxx',
  'http.method' => 'GET'
 );

tracer

Returns the OpenTracing::Tracer for this span.

is_finished

Returns true if this span is finished (has a "finish_time"), otherwise false.

finish

Mark this span as finished (populating the "finish_time" field).

AUTHOR

Tom Molesworth <TEAM@cpan.org>

LICENSE

Copyright Tom Molesworth 2018-2020. Licensed under the same terms as Perl itself.