module

Tracing

Constants

DEFAULT_BUFFERED_LINES_LIMIT = 128000
DEFAULT_MAX_LEVEL = LevelFilter.info
VERSION = "0.5.1"

Class methods

child_span(parent_id : Core::Span::Id, level : Level, name : String, **fields) : Span

Create a new span as a child of the given parent span ID.

Source
create_default_writer
Source
debug(name : String, **fields) : Nil

Level shorthand: dispatch an event at DEBUG level.

Source
error(name : String, **fields) : Nil

Level shorthand: dispatch an event at ERROR level.

Source
event(level : Level, name : String, *, target : String | Nil = nil, **fields) : Nil

Dispatch an event with the current subscriber.

Usage: Tracing.event(Level::INFO, "my_event", key: "value")

Source
fmt_layer
Source
info(name : String, **fields) : Nil

Level shorthand: dispatch an event at INFO level.

Source
instrument(name : String, **fields, & : -> T) : T forall T

Wrap a block in a span context.

Ported from upstream #[instrument] attribute.

Usage: Tracing.instrument("my_func", arg: value) do # work happens inside span "my_func" end

Source
span(level : Level, name : String, *, target : String | Nil = nil, **fields) : Span

Create a new span with the current subscriber.

Usage: span = Tracing.span(Level::INFO, "my_span", answer: 42) span.in_scope { do_work }

Source
trace(name : String, **fields) : Nil

Level shorthand: dispatch an event at TRACE level.

Source
warn(name : String, **fields) : Nil

Level shorthand: dispatch an event at WARN level.

Source

Nested types