Monitor YouTube API requests with Instrumentation
masterYt uses ActiveSupport::Notifications to allow monitoring of HTTP requests made to YouTube. You can subscribe to the request.yt event to track quota usage, request duration, or audit trails.
Payload available in the event:
request_uri: The full URI of the request.method: The HTTP method (e.g.,:get).response: TheNet::HTTPresponse object.duration: The time taken for the request.
ActiveSupport::Notifications.subscribe 'request.yt' do |*args|
event = ActiveSupport::Notifications::Event.new(*args)
puts event.payload[:request_uri]
puts event.payload[:method]
puts event.duration
end