lib/httpx/adapters/datadog.rb in httpx-0.22.4 vs lib/httpx/adapters/datadog.rb in httpx-0.22.5
- old
+ new
@@ -156,12 +156,22 @@
configuration[:tracer].enabled
end
end
end
+ module RequestMethods
+ def __datadog_enable_trace!
+ return super if @__datadog_enable_trace
+
+ RequestTracer.new(self).call
+ @__datadog_enable_trace = true
+ end
+ end
+
module ConnectionMethods
def send(request)
- RequestTracer.new(request).call
+ request.__datadog_enable_trace!
+
super
end
end
end