Module: Datadog::Tracing::Transport::HTTP::Statistics::InstanceMethods

Defined in:
lib/datadog/tracing/transport/http/statistics.rb

Overview

Instance methods for HTTP statistics

Instance Method Summary collapse

Instance Method Details

#metrics_for_response(response) ⇒ Object

Decorate metrics for HTTP responses



19
20
21
22
23
24
25
26
27
28
# File 'lib/datadog/tracing/transport/http/statistics.rb', line 19

def metrics_for_response(response)
  super.tap do |metrics|
    # Add status code tag to api.responses metric
    if metrics.key?(:api_responses)
      (metrics[:api_responses].options[:tags] ||= []).tap do |tags|
        tags << metrics_tag_value(response.code)
      end
    end
  end
end