Getting started with Rails
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is generally available and ready for production usage. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes. The Elastic APM Ruby agent enables you to trace the execution of operations in your Ruby applications, sending performance metrics and errors to the Elastic APM Server. Availability This functionality is generally available and ready for production usage. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless Observability
Generally available
Stack
Generally available
APM Agent Ruby
Generally available
Add the gem to your Gemfile:
gem 'elastic-apm'
Create a file config/elastic_apm.yml:
server_url: http://localhost:8200
secret_token: ''
Or if you prefer environment variables, skip the file and set ELASTIC_APM_SERVER_URL and ELASTIC_APM_SECRET_TOKEN in your local or server environment.
This automatically sets up error logging and performance tracking but of course there are knobs to turn if you’d like to. See Configuration.
To load the gem without starting the agent in a particular Rails environment,
set enabled to false.
For example, to start the agent only in production, use ERB in
config/elastic_apm.yml:
enabled: <%= Rails.env.production? %>
server_url: http://localhost:8200
secret_token: ''
You can also set ELASTIC_APM_ENABLED=false in an environment where the agent
should not start. The ElasticAPM API remains available when the agent is
disabled, but calls that collect data return nil.