Class: OpenTelemetry::SDK::Trace::Event
- Inherits:
-
Object
- Object
- OpenTelemetry::SDK::Trace::Event
- Defined in:
- lib/opentelemetry/sdk/trace/event.rb
Overview
A text annotation with a set of attributes and a timestamp.
Instance Attribute Summary collapse
-
#attributes ⇒ Hash{String => String, Numeric, Boolean, Array<String, Numeric, Boolean>}
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::SDK::Trace::Event.
40 41 42 43 44 |
# File 'lib/opentelemetry/sdk/trace/event.rb', line 40 def initialize(name:, attributes: nil, timestamp: nil) @name = name @attributes = attributes.freeze || EMPTY_ATTRIBUTES @timestamp = || Time.now end |
Instance Attribute Details
#attributes ⇒ Hash{String => String, Numeric, Boolean, Array<String, Numeric, Boolean>} (readonly)
Returns the frozen attributes for this event
24 25 26 |
# File 'lib/opentelemetry/sdk/trace/event.rb', line 24 def attributes @attributes end |
#name ⇒ String (readonly)
Returns the name of this event
19 20 21 |
# File 'lib/opentelemetry/sdk/trace/event.rb', line 19 def name @name end |
#timestamp ⇒ Time (readonly)
Returns the timestamp for this event
29 30 31 |
# File 'lib/opentelemetry/sdk/trace/event.rb', line 29 def @timestamp end |