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

Defined in:
lib/ddtrace/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



16
17
18
19
20
21
22
23
24
25
# File 'lib/ddtrace/transport/http/statistics.rb', line 16

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 << "status_code:#{response.code}"
      end
    end
  end
end