lib/elastic_apm/error_builder.rb in elastic-apm-2.11.0 vs lib/elastic_apm/error_builder.rb in elastic-apm-2.12.0

- old
+ new

@@ -9,11 +9,11 @@ def build_exception(exception, context: nil, handled: true) error = Error.new context: context || Context.new error.exception = Error::Exception.new(exception, handled: handled) - Util.reverse_merge!(error.context.tags, @agent.config.default_tags) + Util.reverse_merge!(error.context.labels, @agent.config.default_labels) if exception.backtrace add_stacktrace error, :exception, exception.backtrace end @@ -47,11 +47,11 @@ error.exception.stacktrace = stacktrace when :log error.log.stacktrace = stacktrace end - error.culprit = stacktrace.frames.first.function + error.culprit = stacktrace.frames.first&.function end # rubocop:disable Metrics/MethodLength, Metrics/AbcSize def add_current_transaction_fields(error, transaction) return unless transaction @@ -64,10 +64,10 @@ error.trace_id = transaction.trace_id error.parent_id = ElasticAPM.current_span&.id || transaction.id return unless transaction.context - Util.reverse_merge!(error.context.tags, transaction.context.tags) + Util.reverse_merge!(error.context.labels, transaction.context.labels) Util.reverse_merge!(error.context.custom, transaction.context.custom) end # rubocop:enable Metrics/MethodLength, Metrics/AbcSize end end