Raygun Application Performance Monitoring
Ruby Profiler for Raygun Application Performance Monitoring.
Distributed as a precompiled native gem.
Contact us to support other platforms.
Supported Ruby versions
The profiler only supports CRuby, also known as Matz's Ruby Interpreter (MRI).
Contact us to support other Ruby versions.
The Profiler needs to be able to access the Raygun Agent over UDP.
The Dockerized Agent is supported on all Ruby profiler platforms. We recommend this deployment model if your production infrastructure already depends on Docker.
Also a great way to explore on your Mac.
RAYGUN_AGENT_TOKEN needs to be supplied as an argument and is available under “Application Settings” within the Raygun Application Performance Monitoring UI
To launch Raygun Agent using docker
docker pull raygunowner/raygun-apm docker run -v raygun-agent:/usr/share/Raygun -e "RAYGUN_AGENT_TOKEN=<token>" -p 2790:2790 -p 2788:2788 -p 2799:2799/udp -it raygunowner/raygun-apm:latest
Ruby on Rails
For Rails support see documentation of the railgun-apm-rails gem.
Include the gem in your Gemfile
bundle to install the gem.
Alternatively install using rubygems
gem install raygun-apm.
Multiple applications, one Agent
Set the `PROTON_API_KEY` environment variable to your API key, which is available under “Application Settings” within the Raygun Application Performance Monitoring UI.
Standalone ruby script / custom framework
For standalone scripts, context start-end needs to be marked specifically and optionally extended events can be called.
#!/usr/bin/env ruby require 'raygun/apm' class Hello def rdoc sleep 0.5 end end tracer = ::::. tracer.udp_sink! tracer.start_trace Hello.new.rdoc tracer.end_trace tracer.process_ended
Extended events can be sent where appropiate
HTTP incoming event
event = ::::::HttpIn.new event[:pid] = Process.pid event[:tid] = 0 event[:timestamp] = tracer.now event[:url] = 'https://google.com/' event[:verb] = 'GET' event[:status] = 200 event[:duration] = 1000 tracer.emit(event)
event = ::::::Sql.new event[:pid] = Process.pid event[:tid] = 0 event[:timestamp] = tracer.now event[:provider] = 'postgres' event[:host] = 'localhost' event[:database] = 'rails' event[:query] = 'SELECT * from FOO;' event[:duration] = 1000 tracer.emit(event)