Class: OpenTelemetry::Trace::Event
- Inherits:
-
Object
- Object
- OpenTelemetry::Trace::Event
- Defined in:
- lib/opentelemetry/trace/event.rb
Overview
A text annotation with a set of attributes and a timestamp.
Instance Attribute Summary collapse
-
#attributes ⇒ Hash<String, Object>
readonly
Returns the frozen attributes for this event.
-
#name ⇒ String
readonly
Returns the name of this event.
-
#timestamp ⇒ Time
readonly
Returns the timestamp for this event.
Instance Method Summary collapse
-
#initialize(name:, attributes: nil, timestamp: nil) ⇒ Event
constructor
Returns a new immutable Event.
Constructor Details
#initialize(name:, attributes: nil, timestamp: nil) ⇒ Event
Returns a new immutable OpenTelemetry::Trace::Event.
38 39 40 41 42 |
# File 'lib/opentelemetry/trace/event.rb', line 38 def initialize(name:, attributes: nil, timestamp: nil) @name = name @attributes = attributes.freeze || EMPTY_ATTRIBUTES @timestamp = || Time.now end |
Instance Attribute Details
#attributes ⇒ Hash<String, Object> (readonly)
Returns the frozen attributes for this event
23 24 25 |
# File 'lib/opentelemetry/trace/event.rb', line 23 def attributes @attributes end |
#name ⇒ String (readonly)
Returns the name of this event
18 19 20 |
# File 'lib/opentelemetry/trace/event.rb', line 18 def name @name end |
#timestamp ⇒ Time (readonly)
Returns the timestamp for this event
28 29 30 |
# File 'lib/opentelemetry/trace/event.rb', line 28 def @timestamp end |