struct
Logit::SpanEvent
- Logit::SpanEvent
- Struct
- Value
- Object
Overview
Represents an event that occurred during a span's lifetime.
Span events are intermediate logs attached to a span, similar to OpenTelemetry's Span Events. They capture significant moments during a span's execution without creating separate spans.
Example
span.add_event("cache.hit", key: "user:123")
span.add_event("db.query.started", table: "users")
span.add_event("db.query.completed", rows: 42)
Defined in:
logit/tracing/span.crConstructors
Instance Method Summary
-
#attributes : Event::Attributes
Structured attributes for this event.
-
#name : String
Name of this event (e.g., "cache.hit", "db.query.started").
-
#timestamp : Time
When this event occurred.
-
#to_json(json : JSON::Builder) : Nil
Serialize to JSON