Ruby APM Setup
Traces | Metrics | App Logs | Custom Logs | Profiling |
---|---|---|---|---|
- | - | - |
Prerequisites
- To monitor APM data on dashboard, Middleware Host agent needs to be installed, You can refer this demo project to refer use cases of APM.
- Ruby version >= 3.0.2
- Check Ruby version
ruby --version
- Check Ruby version
Ruby APM Setup
Add required gem packages
gem 'opentelemetry-sdk'
gem 'opentelemetry-exporter-otlp'
gem 'opentelemetry-instrumentation-all'
gem 'pyroscope'
gem 'middleware_apm', '~> 1.0.0'
Add code as mentioned below at the initialization of your application
require 'middleware/ruby_gem'
Middleware::RubyGem.init
Run your application
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:9320 \
OTEL_SERVICE_NAME="<Your Service Name>" \
OTEL_RESOURCE_ATTRIBUTES=project.name="<Your Project Name>" \
MW_API_KEY=<Your API Key> \
<YOUR COMMAND>