Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add dynamic badge to configuration options #760

Merged
merged 1 commit into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 48 additions & 15 deletions docs/configuration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,46 @@ endif::[]
== Configuration

There are several ways to configure how Elastic APM behaves.

The recommended way to configure Elastic APM is to create a file
`config/elastic_apm.yml` and specify options in there:
The recommended way is to specify options in a `config/elastic_apm.yml` file:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still the recommend way?


[source,yaml]
----
server_url: 'http://localhost:8200'
secret_token: <%= ENV["VERY_SECRET_TOKEN"] %>
----

Some options can be set with `ENV` variables.
When using this method, strings are split by comma, e.g.,
`ELASTIC_APM_SANITIZE_FIELD_NAMES="a,b" # => [/a/, /b/]`.

[float]
[[configuration-precedence]]
=== Configuration precedence

Options are applied in the following order (last one wins):

1. Defaults
2. Arguments to `ElasticAPM.start` / `Config.new`
3. Config file eg. `config/elastic_apm.yml`
3. Config file, e.g., `config/elastic_apm.yml`
4. Environment variables
5. {apm-app-ref}/agent-configuration.html[Central configuration]
(supported options are marked with <<dynamic-configuration, image:./images/dynamic-config.svg[] >>)

[float]
[[dynamic-configuration]]
=== Dynamic configuration

Configuration options marked with the image:./images/dynamic-config.svg[] badge can be changed at runtime
when set from a supported source.

The Agent supports {apm-app-ref}/agent-configuration.html[Central configuration],
which allows you to fine-tune certain configurations via the APM app.
This feature is enabled in the Agent by default, with <<config-central-config>>.

[float]
=== Ruby on Rails

When using Rails it's also possible to specify options inside
When using Rails, it's possible to specify options inside
`config/application.rb`:

[source,ruby]
Expand All @@ -40,7 +59,7 @@ config.elastic_apm.service_name = 'MyApp'
[float]
=== Sinatra and Rack

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

[source,ruby]
Expand All @@ -52,7 +71,7 @@ ElasticAPM.start(
)
----

Alternatively, you can use the `ElasticAPM::Sinatra.start` API.
Alternatively, you can use the `ElasticAPM::Sinatra.start` API:

[source,ruby]
----
Expand All @@ -68,7 +87,7 @@ See <<getting-started-rack>>.
[float]
=== Grape and Rack

When using APM with Grape and Rack (without Rails), you can configure it when starting
When using Grape and Rack (without Rails), you can configure when starting
the agent:

[source,ruby]
Expand All @@ -85,12 +104,6 @@ See <<getting-started-rack>>.
[float]
=== Options

Some options can be set with `ENV` variables and all of them may be set in
your source code.

When setting values for lists using `ENV` variables, strings are split by comma
eg `ELASTIC_APM_SANITIZE_FIELD_NAMES="a,b" # => [/a/, /b/]`.

[float]
[[config-config-file]]
==== `config_file`
Expand Down Expand Up @@ -192,6 +205,9 @@ went wrong.
[float]
[[config-api-request-size]]
==== `api_request_size`

<<dynamic-configuration, image:./images/dynamic-config.svg[] >>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These badges are also links to the <> section


|============
| Environment | `Config` key | Default
| `ELASTIC_APM_API_REQUEST_SIZE` | `api_request_size` | `"750kb"`
Expand All @@ -205,6 +221,9 @@ It has to be provided in *<<config-format-size, size format>>*.
[float]
[[config-api-request-time]]
==== `api_request_time`

<<dynamic-configuration, image:./images/dynamic-config.svg[] >>

|============
| Environment | `Config` key | Default
| `ELASTIC_APM_API_REQUEST_TIME` | `api_request_time` | `"10s"`
Expand Down Expand Up @@ -233,6 +252,9 @@ NOTE: This feature requires APM Server and Kibana >= 7.3.
[float]
[[config-capture-body]]
==== `capture_body`

<<dynamic-configuration, image:./images/dynamic-config.svg[] >>

|============
| Environment | `Config` key | Default | Example |
| `ELASTIC_APM_CAPTURE_BODY` | `capture_body` | `"off"` | `"all"`
Expand All @@ -253,6 +275,9 @@ If your service handles data like this, we advise to only enable this feature wi
[float]
[[config-capture-headers]]
==== `capture_headers`

<<dynamic-configuration, image:./images/dynamic-config.svg[] >>

|============
| Environment | `Config` key | Default
| `ELASTIC_APM_CAPTURE_HEADERS` | `capture_headers` | `true`
Expand All @@ -278,7 +303,7 @@ Whether or not to attach `ENV` from Rack to transactions and errors.
| `ELASTIC_APM_CENTRAL_CONFIG` | `central_config` | `true`
|============

Enable {apm-app-ref}/agent-configuration.html[APM Agent Configuration via Kibana].
Enables {apm-app-ref}/agent-configuration.html[APM Agent Configuration via Kibana].
If set to `true`, the client will poll the APM Server regularly for new agent configuration.

Usually APM Server determines how often to poll, but if not the default interval is 5 minutes.
Expand Down Expand Up @@ -514,6 +539,8 @@ Elastic APM can instrument your Rake tasks but given that they are used for a mu
[[config-log-level]]
==== `log_level`

<<dynamic-configuration, image:./images/dynamic-config.svg[] >>

[options="header"]
|============
| Environment | `Config` key | Default
Expand Down Expand Up @@ -694,6 +721,8 @@ storage use in your Elasticsearch cluster.
[[config-span-frames-min-duration-ms]]
==== `span_frames_min_duration`

<<dynamic-configuration, image:./images/dynamic-config.svg[] >>

|============
| Environment | `Config` key | Default
| `ELASTIC_APM_SPAN_FRAMES_MIN_DURATION` | `span_frames_min_duration` | `"5ms"`
Expand Down Expand Up @@ -737,6 +766,8 @@ The maximum number of stack trace lines per span/error.
[[config-transaction-max-spans]]
==== `transaction_max_spans`

<<dynamic-configuration, image:./images/dynamic-config.svg[] >>

|============
| Environment | `Config` key | Default
| `ELASTIC_APM_TRANSACTION_MAX_SPANS` | `transaction_max_spans` | `500`
Expand All @@ -752,6 +783,8 @@ too much work for such edge cases.
[[config-transaction-sample-rate]]
==== `transaction_sample_rate`

<<dynamic-configuration, image:./images/dynamic-config.svg[] >>

|============
| Environment | `Config` key | Default
| `ELASTIC_APM_TRANSACTION_SAMPLE_RATE` | `transaction_sample_rate` | `1.0`
Expand Down
1 change: 1 addition & 0 deletions docs/images/dynamic-config.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.