Configurationedit

There are several ways to shape how Elastic APM behaves.

Railsedit

The recommended way to configure Elastic APM for Rails is to create a file config/elastic_apm.yml and specify options in there:

---
server_url: 'http://localhost:8200'
secret_token: 'very_very_secret'

Sinatra and Rackedit

When using APM with Sinatra and Rack, you should configure it when starting the agent:

ElasticAPM.start(
  server_url: 'http://localhost:8200',
  secret_token: 'very_very_secret'
)

See Getting started with Rack.

Note

This part of the documentation is still lacking. For full list of configuration options, see https://github.com/elastic/apm-agent-ruby/blob/master/lib/elastic_apm/config.rb.