lib/garage/strategy/auth_server.rb in the_garage-2.3.3 vs lib/garage/strategy/auth_server.rb in the_garage-2.4.0

- old
+ new

@@ -1,9 +1,11 @@ require 'json' require 'net/http' require 'uri' +require 'garage/tracer' + module Garage module Strategy module AuthServer extend ActiveSupport::Concern @@ -69,11 +71,16 @@ end private def get - raw = http_client.get(path_with_query, header) - Response.new(raw) + Tracer.start do |tracer| + request_header = tracer.inject_trace_context(header) + tracer.record_http_request('GET', uri.to_s, request_header['User-Agent']) + raw = http_client.get(path_with_query, request_header) + tracer.record_http_response(raw.code.to_i, raw['Content-Length'] || 0) + Response.new(raw) + end end def header { 'Authorization' => @request.authorization,