lib/new_relic/agent/transaction/segment.rb in newrelic_rpm-6.7.0.359 vs lib/new_relic/agent/transaction/segment.rb in newrelic_rpm-6.8.0.360
- old
+ new
@@ -2,22 +2,28 @@
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
require 'new_relic/agent/transaction/abstract_segment'
require 'new_relic/agent/span_event_primitive'
+require 'new_relic/agent/attributes'
module NewRelic
module Agent
class Transaction
class Segment < AbstractSegment
# unscoped_metrics can be nil, a string, or array. we do this to save
# object allocations. if allocations weren't important then we would
# initialize it as an array that would be empty, have one item, or many items.
- attr_reader :unscoped_metrics
+ attr_reader :unscoped_metrics, :attributes
def initialize name=nil, unscoped_metrics=nil, start_time=nil
@unscoped_metrics = unscoped_metrics
+ @attributes = Attributes.new(NewRelic::Agent.instance.attribute_filter)
super name, start_time
+ end
+
+ def add_custom_attributes(p)
+ attributes.merge_custom_attributes(p)
end
private
def record_metrics