class OpenTelemetry::API::Span

Overview

A Span represents a single measured timespan, and all data associated with that measurement. A Span may nest other Span instances.

Included Modules

Defined in:

api/span.cr
api/span/kind.cr

Constant Summary

MATCH = /(?<span_id>[A-Fa-f0-9]{16})/

Constructors

Instance Method Summary

Instance methods inherited from module OpenTelemetry::Sendable

size size, to_json(json : JSON::Builder)
to_json
to_json
, to_protobuf to_protobuf

Instance methods inherited from class OpenTelemetry::API::AbstractSpan

[](key) [], []=(key, value) []=, add_event(name, attributes : Hash(String, AnyAttribute) = {} of String => AnyAttribute)
add_event(name = "", &blk : Event -> )
add_event
, attributes : Hash(String, AnyAttribute) attributes, attributes=(attributes : Hash(String, AnyAttribute)) attributes=, can_export? can_export?, children : Array(Span) children, children=(children : Array(Span)) children=, context : SpanContext context, context=(context : SpanContext) context=, events : Array(Event) events, events=(events : Array(Event)) events=, finish : Time::Span | Nil finish, finish=(finish : Time::Span | Nil) finish=, get_attribute(key) get_attribute, id id, is_recording : Bool is_recording, is_recording=(is_recording : Bool) is_recording=, kind : Kind kind, kind=(kind : Kind) kind=, name : String name, name=(name : String) name=, parent : Span | Nil parent, parent=(parent : Span | Nil) parent=, recording? recording?, set_attribute(key, value) set_attribute, span_id span_id, start : Time::Span start, start=(start : Time::Span) start=, status : Status status, status=(status : Status) status=, to_json(json : JSON::Builder)
to_json
to_json
, to_protobuf to_protobuf, wall_finish : Time | Nil wall_finish, wall_finish=(wall_finish : Time | Nil) wall_finish=, wall_start : Time wall_start, wall_start=(wall_start : Time) wall_start=

Constructor methods inherited from class OpenTelemetry::API::AbstractSpan

new(name = "") new

Class methods inherited from class OpenTelemetry::API::AbstractSpan

build(name = "", &) build, validate_id(id : Slice(UInt8))
validate_id(id : Slice)
validate_id

Instance methods inherited from module OpenTelemetry::Sendable

size size, to_json(json : JSON::Builder)
to_json
to_json
, to_protobuf to_protobuf

Constructor Detail

def self.new(name : String = "") #

[View source]

Instance Method Detail

def [](key) #

[View source]
def []=(key, value) #

[View source]
def add_event(name, attributes : Hash(String, AnyAttribute) = {} of String => AnyAttribute) #

[View source]
def add_event(name = "", & : Event -> ) #

[View source]
def attributes : Hash(String, AnyAttribute) #
Description copied from class OpenTelemetry::API::AbstractSpan

This is probably a property


[View source]
def attributes=(attributes : Hash(String, AnyAttribute)) #

[View source]
def can_export? #

[View source]
def children : Array(Span) #
Description copied from class OpenTelemetry::API::AbstractSpan

This is probably a property


[View source]
def children=(children : Array(Span)) #

[View source]
def client! #

[View source]
def consumer! #

[View source]
def context : SpanContext #
Description copied from class OpenTelemetry::API::AbstractSpan

This is probably a property


[View source]
def context=(context : SpanContext) #

[View source]
def events : Array(Event) #
Description copied from class OpenTelemetry::API::AbstractSpan

This is probably a property


[View source]
def events=(events : Array(Event)) #

[View source]
def finish : Time::Span | Nil #
Description copied from class OpenTelemetry::API::AbstractSpan

This is probably a property


[View source]
def finish=(finish : Time::Span | Nil) #

[View source]
def get_attribute(key) #

[View source]
def id #

[View source]
def internal! #

[View source]
def is_recording : Bool #

ameba:disable Style/QueryBoolMethods


[View source]
def is_recording=(is_recording : Bool) #

ameba:disable Style/QueryBoolMethods


[View source]
def kind : Kind #
Description copied from class OpenTelemetry::API::AbstractSpan

This is probably a property


[View source]
def kind=(kind : Kind) #

[View source]
def name : String #
Description copied from class OpenTelemetry::API::AbstractSpan

This is probably a property


[View source]
def name=(name : String) #

[View source]
def parent : Span | Nil #
Description copied from class OpenTelemetry::API::AbstractSpan

This is probably a property


[View source]
def parent=(parent : Span | Nil) #

[View source]
def producer! #

[View source]
def recording? #

[View source]
def server! #

[View source]
def set_attribute(key, value) #

[View source]
def span_id #

[View source]
def start : Time::Span #
Description copied from class OpenTelemetry::API::AbstractSpan

This is probably a property


[View source]
def start=(start : Time::Span) #

[View source]
def status : Status #
Description copied from class OpenTelemetry::API::AbstractSpan

This is probably a property


[View source]
def status=(status : Status) #

[View source]
def to_json(json : JSON::Builder) #

[View source]
def to_json #

[View source]
def to_protobuf #

Return the Protobuf object for the Span.


[View source]
def wall_finish : Time | Nil #
Description copied from class OpenTelemetry::API::AbstractSpan

This is probably a property


[View source]
def wall_finish=(wall_finish : Time | Nil) #

[View source]
def wall_start : Time #
Description copied from class OpenTelemetry::API::AbstractSpan

This is probably a property


[View source]
def wall_start=(wall_start : Time) #

[View source]