This page describes the available configurations for the Atatus Ruby Agent.

Configurations

You can set following configurations in the Ruby agent.

Option Description Type
license_key APM License Key of your account. string
app_name Name of your ruby project/app. string
service_version Application version to identify release of your app. string
environment Environments allow you to easily filter data on your APM app. string
capture_body Capture request body in traces. string
hostname Default hostname is machine name. You can override it by this option.. string
enabled enable/disable the agent. boolean

In Rails

Create a file config/atatus.yml and set your configuration in Rails.

copy
icon/buttons/copy
license_key: "lic_apm_xxxxxxx"

app_name: "Ruby App"

service_version: "1.2.0"

environment: "production"

capture_body: "all"

hostname: "web1.example.com"

enabled: true

In Sinatra

Set your configuration to config.ru file.

copy
icon/buttons/copy
Atatus.start(
    license_key: "lic_apm_6e49699e38c8498f9a29a05b1adc0182",

    app_name: "Ruby App",

    service_version: "1.2.0",

    environment: "production",

    capture_body: "all",

    hostname: "web1.example.com",

    enabled: true
)

Setting app version

If you use an version to identify releases of your app, you can send it to Atatus. It is highly recommended to set service_version.

In Rails

Create a file config/atatus.yml and set your configuration in Rails.

copy
icon/buttons/copy
# In config/atatus.yml
license_key: "lic_apm_xxxxxxx"
app_name: "Ruby App"

service_version: "1.2.0"

# In Environment
export ATATUS_SERVICE_VERSION=1.2.0

In Sinatra

Set your configuration to config.ru file.

copy
icon/buttons/copy
# In config.ru
Atatus.start(
    license_key: "lic_apm_6e49699e38c8498f9a29a05b1adc0182",
    app_name: "Ruby App",

    service_version: "1.2.0"
)

# In Environment
export ATATUS_SERVICE_VERSION="1.2.0"

Setting environment

If you are tracking multiple environments with a single APM project, then you can set a environment as follows.

In Rails

Create a file config/atatus.yml and set your configuration in Rails.

copy
icon/buttons/copy
# In config/atatus.yml
license_key: "lic_apm_xxxxxxx"
app_name: "Ruby App"

environment: "production"

# In Environment
export ATATUS_ENVIRONMENT="production"

In Sinatra

Set your configuration to config.ru file.

copy
icon/buttons/copy
# In config.ru
Atatus.start(
    license_key: "lic_apm_6e49699e38c8498f9a29a05b1adc0182",
    app_name: "Ruby App",

    environment: "production",
)

# In Environment
export ATATUS_ENVIRONMENT="production"

Enable Capture Body

This capture body option is disabled by default. If you want to see the request body in traces, you can enable this option in startup options. The body will be captured only in follwing content-types: application/x-www-form-urlencoded, text/*, application/json, application/xml.

In Rails

Create a file config/atatus.yml and set your configuration in Rails.

copy
icon/buttons/copy
# In config/atatus.yml
license_key: "lic_apm_xxxxxxx"
app_name: "Ruby App"

capture_body: "all"

# In Environment
export ATATUS_CAPTURE_BODY="all"

In Sinatra

Set your configuration to config.ru file.

copy
icon/buttons/copy
# In config.ru
Atatus.start(
    license_key: "lic_apm_6e49699e38c8498f9a29a05b1adc0182",
    app_name: "Ruby App",

    capture_body: "all",
)

# In Environment
export ATATUS_CAPTURE_BODY="all"

Configure a custom host name

By default, we will fetch the host name using Ruby, but you can override this as follows:

In Rails

Create a file config/atatus.yml and set your configuration in Rails.

copy
icon/buttons/copy
# In config/atatus.yml
license_key: "lic_apm_xxxxxxx"
app_name: "Ruby App"

hostname: "web1.example.com"

# In Environment
export ATATUS_HOSTNAME="web1.example.com"

In Sinatra

Set your configuration to config.ru file.

copy
icon/buttons/copy
# In config.ru
Atatus.start(
    license_key: "lic_apm_6e49699e38c8498f9a29a05b1adc0182",
    app_name: "Ruby App",

    hostname: "web1.example.com",
)

# In Environment
export ATATUS_HOSTNAME="web1.example.com"

Disable agent

Using this option, you can completely disable the agent, including instrumentation and remote config polling. You can set enabled option to false to disable agent.

In Rails

Create a file config/atatus.yml and set your configuration in Rails.

copy
icon/buttons/copy
# In config/atatus.yml
license_key: "lic_apm_xxxxxxx"
app_name: "Ruby App"

enabled: false

# In Environment
export ATATUS_ENABLED=false

In Sinatra

Set your configuration to config.ru file.

copy
icon/buttons/copy
# In config.ru
Atatus.start(
    license_key: "lic_apm_6e49699e38c8498f9a29a05b1adc0182",
    app_name: "Ruby App",

    enabled: false,
)

# In Environment
export ATATUS_ENABLED=false