Sha256: 33bdc0aaf395f32d6b39c2232c2a43600cf27cec65cc2326dffd0f40a833a9af
Contents?: true
Size: 1.03 KB
Versions: 14
Compression:
Stored size: 1.03 KB
Contents
# frozen_string_literal: true require "forwardable" require "securerandom" require "honeycomb/span" require "honeycomb/propagation" require "honeycomb/rollup_fields" module Honeycomb # Represents a Honeycomb trace, which groups spans together class Trace include PropagationParser include RollupFields extend Forwardable def_delegators :@root_span, :send attr_reader :id, :fields, :root_span def initialize(builder:, context:, serialized_trace: nil, **options) trace_id, parent_span_id, trace_fields, dataset = parse serialized_trace dataset && builder.dataset = dataset @id = trace_id || SecureRandom.uuid @fields = trace_fields || {} @root_span = Span.new(trace: self, parent_id: parent_span_id, is_root: true, builder: builder, context: context, **options) end def add_field(key, value) @fields[key] = value end end end
Version data entries
14 entries across 14 versions & 1 rubygems