Sha256: 523ced7bbef12efe93964a1e0f55fcdc7d959e4f3905ca6fccf51181138c0a50
Contents?: true
Size: 669 Bytes
Versions: 28
Compression:
Stored size: 669 Bytes
Contents
# frozen_string_literal: true module Honeycomb # Stores the current span and trace context class Context def current_trace return if current_span.nil? current_span.trace end def current_span spans.last end def current_span=(span) spans << span end def span_sent(span) spans.last != span && raise(ArgumentError, "Incorrect span sent") spans.pop end private def spans storage["spans"] ||= [] end def storage Thread.current[thread_key] ||= {} end def thread_key @thread_key ||= ["honeycomb", self.class.name, object_id].join("-") end end end
Version data entries
28 entries across 28 versions & 1 rubygems