Class: BaselineRedRpm::Tracing::Collector
- Inherits:
-
Object
- Object
- BaselineRedRpm::Tracing::Collector
- Defined in:
- lib/baseline_red_rpm/tracing/collector.rb
Instance Attribute Summary collapse
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
Instance Method Summary collapse
-
#initialize(local_endpoint) ⇒ Collector
constructor
A new instance of Collector.
- #retrieve ⇒ Object
- #send_span(span, end_time) ⇒ Object
Constructor Details
Instance Attribute Details
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
6 7 8 |
# File 'lib/baseline_red_rpm/tracing/collector.rb', line 6 def buffer @buffer end |
Instance Method Details
#retrieve ⇒ Object
13 14 15 |
# File 'lib/baseline_red_rpm/tracing/collector.rb', line 13 def retrieve @buffer.retrieve end |
#send_span(span, end_time) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/baseline_red_rpm/tracing/collector.rb', line 17 def send_span(span, end_time) duration = end_time - span.start_time @buffer << { "traceId" => span.context.trace_id, "id" => span.context.span_id, "parentId" => span.context.parent_id, "name" => span.operation_name, "timestamp" => span.start_time, "duration" => duration * 1_000, "logEntries" => span.log_entries, "tags" => span. } end |