Ruby Profiler for Raygun Application Performance Monitoring.
Distributed as a precompiled native gem.
-
x86-mingw32
-
x64-mingw32
-
x86-linux
-
x86_64-linux
-
universal-darwin
Contact us to support other platforms.
The profiler only supports CRuby, also known as Matz’s Ruby Interpreter (MRI).
-
2.5.x
-
2.6.x
-
2.7.x
-
3.0.x
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.
The 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
The Linux version can be installed either using systemd or via terminal
On windows the agent can be installed either via MSI installer or on .NET core
For Rails support see documentation of the railgun-apm-rails gem.
Include the gem in your Gemfile
gem 'raygun-apm'
Run bundle to install the gem.
Alternatively install using rubygems gem install raygun-apm.
Set the PROTON_API_KEY environment variable to your API key, which is available under “Application Settings” within the Raygun Application Performance Monitoring UI.
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 = Raygun::Apm::Tracer.new 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 = Raygun::Apm::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)
SQL query
event = Raygun::Apm::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)