Class: OpenTelemetry::SDK::Logs::LogRecord
- Inherits:
-
Logs::LogRecord
- Object
- Logs::LogRecord
- OpenTelemetry::SDK::Logs::LogRecord
- Defined in:
- lib/opentelemetry/sdk/logs/log_record.rb
Overview
Implementation of OpenTelemetry::Logs::LogRecord that records log events.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#body ⇒ Object
Returns the value of attribute body.
-
#event_name ⇒ Object
Returns the value of attribute event_name.
-
#instrumentation_scope ⇒ Object
Returns the value of attribute instrumentation_scope.
-
#observed_timestamp ⇒ Object
Returns the value of attribute observed_timestamp.
-
#resource ⇒ Object
Returns the value of attribute resource.
-
#severity_number ⇒ Object
Returns the value of attribute severity_number.
-
#severity_text ⇒ Object
Returns the value of attribute severity_text.
-
#span_id ⇒ Object
Returns the value of attribute span_id.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#trace_flags ⇒ Object
Returns the value of attribute trace_flags.
-
#trace_id ⇒ Object
Returns the value of attribute trace_id.
Instance Method Summary collapse
-
#initialize(timestamp: nil, observed_timestamp: nil, severity_text: nil, severity_number: nil, body: nil, attributes: nil, event_name: nil, trace_id: nil, span_id: nil, trace_flags: nil, resource: nil, instrumentation_scope: nil, log_record_limits: nil) ⇒ LogRecord
constructor
Creates a new LogRecord.
- #to_log_record_data ⇒ Object
Constructor Details
#initialize(timestamp: nil, observed_timestamp: nil, severity_text: nil, severity_number: nil, body: nil, attributes: nil, event_name: nil, trace_id: nil, span_id: nil, trace_flags: nil, resource: nil, instrumentation_scope: nil, log_record_limits: nil) ⇒ LogRecord
Creates a new OpenTelemetry::SDK::Logs::LogRecord.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 65 def initialize( timestamp: nil, observed_timestamp: nil, severity_text: nil, severity_number: nil, body: nil, attributes: nil, event_name: nil, trace_id: nil, span_id: nil, trace_flags: nil, resource: nil, instrumentation_scope: nil, log_record_limits: nil ) = = || || Time.now @severity_text = severity_text @severity_number = severity_number @body = body @event_name = event_name @trace_id = trace_id @span_id = span_id @trace_flags = trace_flags @resource = resource @instrumentation_scope = instrumentation_scope @log_record_limits = log_record_limits || LogRecordLimits::DEFAULT @dropped_attributes_count = 0 self.attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
28 29 30 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 28 def attributes @attributes end |
#body ⇒ Object
Returns the value of attribute body.
16 17 18 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 16 def body @body end |
#event_name ⇒ Object
Returns the value of attribute event_name.
16 17 18 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 16 def event_name @event_name end |
#instrumentation_scope ⇒ Object
Returns the value of attribute instrumentation_scope.
16 17 18 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 16 def instrumentation_scope @instrumentation_scope end |
#observed_timestamp ⇒ Object
Returns the value of attribute observed_timestamp.
16 17 18 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 16 def end |
#resource ⇒ Object
Returns the value of attribute resource.
16 17 18 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 16 def resource @resource end |
#severity_number ⇒ Object
Returns the value of attribute severity_number.
16 17 18 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 16 def severity_number @severity_number end |
#severity_text ⇒ Object
Returns the value of attribute severity_text.
16 17 18 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 16 def severity_text @severity_text end |
#span_id ⇒ Object
Returns the value of attribute span_id.
16 17 18 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 16 def span_id @span_id end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
16 17 18 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 16 def end |
#trace_flags ⇒ Object
Returns the value of attribute trace_flags.
16 17 18 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 16 def trace_flags @trace_flags end |
#trace_id ⇒ Object
Returns the value of attribute trace_id.
16 17 18 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 16 def trace_id @trace_id end |
Instance Method Details
#to_log_record_data ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/opentelemetry/sdk/logs/log_record.rb', line 106 def to_log_record_data LogRecordData.new( to_integer_nanoseconds(), to_integer_nanoseconds(), @severity_text, @severity_number, @body, @attributes, @event_name, @trace_id, @span_id, @trace_flags, @resource, @instrumentation_scope, @dropped_attributes_count ) end |