elastic-apm 4.7.3 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/.exclude.yml +21 -82
  3. data/.ci/.framework.yml +1 -4
  4. data/.ci/.ruby.yml +1 -1
  5. data/.ci/updatecli/values.d/apm-data-spec.yml +1 -0
  6. data/.ci/updatecli/values.d/apm-gherkin.yml +1 -0
  7. data/.ci/updatecli/values.d/apm-json-specs.yml +1 -0
  8. data/.ci/updatecli/values.d/scm.yml +10 -0
  9. data/.ci/updatecli/values.d/update-compose.yml +3 -0
  10. data/.github/PULL_REQUEST_TEMPLATE.md +2 -2
  11. data/.github/dependabot.yml +24 -19
  12. data/.github/workflows/README.md +1 -2
  13. data/.github/workflows/addToProject.yml +16 -2
  14. data/.github/workflows/ci.yml +6 -6
  15. data/.github/workflows/docs-build.yml +19 -0
  16. data/.github/workflows/docs-cleanup.yml +14 -0
  17. data/.github/workflows/github-commands-comment.yml +38 -0
  18. data/.github/workflows/microbenchmark.yml +7 -24
  19. data/.github/workflows/release.yml +39 -24
  20. data/.github/workflows/run-matrix.yml +21 -12
  21. data/.github/workflows/test-reporter.yml +4 -3
  22. data/.github/workflows/updatecli.yml +45 -13
  23. data/Gemfile +13 -0
  24. data/bin/dev +2 -2
  25. data/docs/docset.yml +9 -0
  26. data/docs/reference/advanced-topics.md +12 -0
  27. data/docs/reference/api-reference.md +422 -0
  28. data/docs/reference/configuration.md +734 -0
  29. data/docs/{context.asciidoc → reference/context.md} +21 -21
  30. data/docs/reference/custom-instrumentation.md +72 -0
  31. data/docs/{getting-started-rack.asciidoc → reference/getting-started-rack.md} +20 -29
  32. data/docs/reference/getting-started-rails.md +27 -0
  33. data/docs/reference/graphql.md +21 -0
  34. data/docs/reference/index.md +24 -0
  35. data/docs/{logs.asciidoc → reference/logs.md} +38 -56
  36. data/docs/reference/metrics.md +199 -0
  37. data/docs/reference/opentracing-api.md +70 -0
  38. data/docs/reference/performance-tuning.md +71 -0
  39. data/docs/reference/set-up-apm-ruby-agent.md +16 -0
  40. data/docs/reference/supported-technologies.md +128 -0
  41. data/docs/reference/toc.yml +22 -0
  42. data/docs/reference/upgrading.md +19 -0
  43. data/docs/release-notes/index.md +166 -0
  44. data/docs/release-notes/known-issues.md +24 -0
  45. data/docs/release-notes/toc.yml +3 -0
  46. data/lib/elastic_apm/context_builder.rb +5 -2
  47. data/lib/elastic_apm/spies/sidekiq.rb +2 -1
  48. data/lib/elastic_apm/stacktrace_builder.rb +3 -3
  49. data/lib/elastic_apm/version.rb +1 -1
  50. data/updatecli-compose.yaml +23 -0
  51. metadata +37 -36
  52. data/.ci/snapshoty.yml +0 -33
  53. data/.ci/updatecli/updatecli.d/update-gherkin-specs.yml +0 -84
  54. data/.ci/updatecli/updatecli.d/update-json-specs.yml +0 -84
  55. data/.ci/updatecli/updatecli.d/update-specs.yml +0 -86
  56. data/.ci/updatecli/values.yml +0 -14
  57. data/.github/workflows/coverage-reporter.yml +0 -34
  58. data/.github/workflows/opentelemetry.yml +0 -22
  59. data/.github/workflows/snapshoty.yml +0 -35
  60. data/CHANGELOG.asciidoc +0 -990
  61. data/docs/advanced.asciidoc +0 -14
  62. data/docs/api.asciidoc +0 -487
  63. data/docs/configuration.asciidoc +0 -889
  64. data/docs/custom-instrumentation.asciidoc +0 -80
  65. data/docs/debugging.asciidoc +0 -44
  66. data/docs/getting-started-rails.asciidoc +0 -30
  67. data/docs/graphql.asciidoc +0 -23
  68. data/docs/index.asciidoc +0 -38
  69. data/docs/introduction.asciidoc +0 -36
  70. data/docs/metrics.asciidoc +0 -235
  71. data/docs/opentracing.asciidoc +0 -94
  72. data/docs/performance-tuning.asciidoc +0 -106
  73. data/docs/redirects.asciidoc +0 -9
  74. data/docs/release-notes.asciidoc +0 -15
  75. data/docs/set-up.asciidoc +0 -19
  76. data/docs/supported-technologies.asciidoc +0 -157
  77. data/docs/upgrading.asciidoc +0 -18
  78. /data/docs/{images → reference/images}/dynamic-config.svg +0 -0
@@ -1,889 +0,0 @@
1
- ifdef::env-github[]
2
- NOTE: For the best reading experience,
3
- please view this documentation at
4
- https://www.elastic.co/guide/en/apm/agent/ruby/current/introduction.html[elastic.co].
5
- endif::[]
6
-
7
- [[configuration]]
8
- == Configuration
9
-
10
- There are several ways to configure how Elastic APM behaves.
11
- We recommend using a `config/elastic_apm.yml` file:
12
-
13
- [source,yaml]
14
- ----
15
- server_url: 'http://localhost:8200'
16
- secret_token: <%= ENV["VERY_SECRET_TOKEN"] %>
17
- ----
18
-
19
- Some options can be set with `ENV` variables.
20
- When using this method, strings are split by comma, e.g.,
21
- `ELASTIC_APM_SANITIZE_FIELD_NAMES="a,b" # => [/a/, /b/]`.
22
-
23
- [float]
24
- [[configuration-precedence]]
25
- === Configuration precedence
26
-
27
- Options are applied in the following order (last one wins):
28
-
29
- 1. Defaults
30
- 2. Arguments to `ElasticAPM.start` / `Config.new`
31
- 3. Config file, e.g., `config/elastic_apm.yml`
32
- 4. Environment variables
33
- 5. {apm-app-ref}/agent-configuration.html[Central configuration]
34
- (supported options are marked with <<dynamic-configuration, image:./images/dynamic-config.svg[] >>)
35
-
36
- [float]
37
- [[dynamic-configuration]]
38
- === Dynamic configuration
39
-
40
- Configuration options marked with the image:./images/dynamic-config.svg[] badge can be changed at runtime
41
- when set from a supported source.
42
-
43
- The Agent supports {apm-app-ref}/agent-configuration.html[Central configuration],
44
- which allows you to fine-tune certain configurations via the APM app.
45
- This feature is enabled in the Agent by default, with <<config-central-config>>.
46
-
47
- [float]
48
- === Ruby on Rails
49
-
50
- When using Rails, it's possible to specify options inside
51
- `config/application.rb`:
52
-
53
- [source,ruby]
54
- ----
55
- # config/application.rb
56
- config.elastic_apm.service_name = 'MyApp'
57
- ----
58
-
59
- [float]
60
- === Sinatra and Rack
61
-
62
- When using Sinatra and Rack, you can configure when starting
63
- the agent:
64
-
65
- [source,ruby]
66
- ----
67
- # config.ru or similar
68
- ElasticAPM.start(
69
- app: MyApp,
70
- service_name: 'SomeOtherName'
71
- )
72
- ----
73
-
74
- Alternatively, use the `ElasticAPM::Sinatra.start` API:
75
-
76
- [source,ruby]
77
- ----
78
- # config.ru or similar
79
- ElasticAPM::Sinatra.start(
80
- MyApp,
81
- service_name: 'SomeOtherName'
82
- )
83
- ----
84
-
85
- See <<getting-started-rack>>.
86
-
87
- [float]
88
- === Grape and Rack
89
-
90
- When using Grape and Rack (without Rails), configure when starting
91
- the agent:
92
-
93
- [source,ruby]
94
- ----
95
- # config.ru or similar
96
- ElasticAPM::Grape.start(
97
- MyApp,
98
- service_name: 'SomeOtherName'
99
- )
100
- ----
101
-
102
- See <<getting-started-rack>>.
103
-
104
- [float]
105
- === Options
106
-
107
- [float]
108
- [[config-config-file]]
109
- ==== `config_file`
110
-
111
- [options="header"]
112
- |============
113
- | Environment | `Config` key | Default
114
- | `ELASTIC_APM_CONFIG_FILE` | `config_file` | `config/elastic_apm.yml`
115
- |============
116
-
117
- The path to the configuration YAML-file.
118
- Elastic APM will load config options from this if the file exists.
119
- The file will be evaluated as ERB, so you can include `ENV` variables like in
120
- your `database.yml`, eg:
121
-
122
- [source,ruby]
123
- ----
124
- secret_token: <%= ENV['VERY_SECRET_TOKEN'] %>
125
- ----
126
-
127
- [float]
128
- [[config-server-url]]
129
- ==== `server_url`
130
-
131
- [options="header"]
132
- |============
133
- | Environment | `Config` key | Default
134
- | `ELASTIC_APM_SERVER_URL` | `server_url` | `'http://localhost:8200'`
135
- |============
136
-
137
- The URL for your APM Server.
138
- The URL must be fully qualified, including protocol (`http` or `https`)
139
- and port.
140
-
141
- [float]
142
- [[config-secret-token]]
143
- ==== `secret_token`
144
-
145
- [options="header"]
146
- |============
147
- | Environment | `Config` key | Default | Example
148
- | `ELASTIC_APM_SECRET_TOKEN` | `secret_token` | `nil` | A random string
149
- |============
150
-
151
- This string is used to ensure that only your agents can send data to your APM server.
152
- Both the agents and the APM server have to be configured with the same secret token.
153
- Here's an example that generates a secure secret token:
154
-
155
- [source,bash]
156
- ----
157
- ruby -r securerandom -e 'print SecureRandom.uuid'
158
- ----
159
-
160
- WARNING: Secret tokens only provide any real security if your APM server uses TLS.
161
-
162
- [float]
163
- [[config-api-key]]
164
- ==== `api_key`
165
-
166
- [options="header"]
167
- |============
168
- | Environment | `Config` key | Default | Example
169
- | `ELASTIC_APM_API_KEY` | `api_key` | `nil` | A base64-encoded string
170
- |============
171
-
172
- This base64-encoded string is used to ensure that only your agents can send data to your APM server.
173
- The API key must be created using the {apm-guide-ref}/api-key.html[APM server command-line tool].
174
-
175
- WARNING: API keys only provide any real security if your APM server uses TLS.
176
-
177
- [float]
178
- [[config-api-buffer-size]]
179
- ==== `api_buffer_size`
180
- |============
181
- | Environment | `Config` key | Default
182
- | `ELASTIC_APM_API_BUFFER_SIZE` | `api_buffer_size` | `256`
183
- |============
184
-
185
- The maximum amount of objects kept in queue before sending to APM Server.
186
-
187
- If you hit the limit, consider increasing the agent's <<config-pool-size,worker pool size>>.
188
- If you don't, the agent may have trouble connecting to APM Server.
189
- The <<config-log-path,logs>> should tell you what went wrong.
190
-
191
- [float]
192
- [[config-api-request-size]]
193
- ==== `api_request_size`
194
-
195
- <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
196
-
197
- |============
198
- | Environment | `Config` key | Default
199
- | `ELASTIC_APM_API_REQUEST_SIZE` | `api_request_size` | `"750kb"`
200
- |============
201
-
202
- The maximum amount of bytes sent over one request to APM Server. The agent will open a new request when this limit is reached.
203
-
204
- This must be provided in *<<config-format-size, size format>>*.
205
-
206
- [float]
207
- [[config-api-request-time]]
208
- ==== `api_request_time`
209
-
210
- <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
211
-
212
- |============
213
- | Environment | `Config` key | Default
214
- | `ELASTIC_APM_API_REQUEST_TIME` | `api_request_time` | `"10s"`
215
- |============
216
-
217
- The maximum duration of a single streaming request to APM Server before opening
218
- a new one.
219
-
220
- The APM Server has its own limit of 30 seconds before it will close requests.
221
- This must be provided in *<<config-format-duration, duration format>>*.
222
-
223
- [float]
224
- [[config-breakdown-metrics]]
225
- ==== `breakdown-metrics`
226
- |============
227
- | Environment | `Config` key | Default
228
- | `ELASTIC_APM_BREAKDOWN_METRICS` | `breakdown_metrics` | `true`
229
- |============
230
-
231
- Enable or disable the tracking and collection of breakdown metrics.
232
- Setting this to `False` disables the tracking of breakdown metrics, which can reduce the overhead of the agent.
233
-
234
- NOTE: This feature requires APM Server and Kibana >= 7.3.
235
-
236
- [float]
237
- [[config-capture-body]]
238
- ==== `capture_body`
239
-
240
- <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
241
-
242
- |============
243
- | Environment | `Config` key | Default | Example
244
- | `ELASTIC_APM_CAPTURE_BODY` | `capture_body` | `"off"` | `"all"`
245
- |============
246
-
247
- The Ruby agent can optionally capture the request body (e.g. `POST` variables or JSON data) for transactions that are HTTP requests.
248
-
249
- Possible values: `"errors"`, `"transactions"`, `"all"`, `"off"`.
250
-
251
- If the request has a body and this setting is disabled, the body will be shown as `[SKIPPED]`.
252
-
253
- WARNING: Request bodies often contain sensitive values like passwords and credit card numbers.
254
- We try to strip sensitive looking data from form bodies but don't touch text bodies like JSON.
255
- If your service handles data like this, we advise to only enable this feature with care.
256
-
257
-
258
- [float]
259
- [[config-capture-headers]]
260
- ==== `capture_headers`
261
-
262
- <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
263
-
264
- |============
265
- | Environment | `Config` key | Default
266
- | `ELASTIC_APM_CAPTURE_HEADERS` | `capture_headers` | `true`
267
- |============
268
-
269
- This indicates whether or not to attach the request headers to transactions and errors.
270
-
271
- [float]
272
- [[config-capture-elasticsearch-queries]]
273
- ==== `capture_elasticsearch_queries`
274
- |============
275
- | Environment | `Config` key | Default
276
- | `ELASTIC_APM_CAPTURE_ELASTICSEARCH_QUERIES` | `capture_elasticsearch_queries` | `false`
277
- |============
278
-
279
- This indicates whether or not to capture the body from requests in Elasticsearch.
280
-
281
- [float]
282
- [[config-capture-env]]
283
- ==== `capture_env`
284
- |============
285
- | Environment | `Config` key | Default
286
- | `ELASTIC_APM_CAPTURE_ENV` | `capture_env` | `true`
287
- |============
288
-
289
- This indicates whether or not to attach `ENV` from Rack to transactions and errors.
290
-
291
- [float]
292
- [[config-central-config]]
293
- ==== `central_config`
294
- |============
295
- | Environment | `Config` key | Default
296
- | `ELASTIC_APM_CENTRAL_CONFIG` | `central_config` | `true`
297
- |============
298
-
299
- This enables {apm-app-ref}/agent-configuration.html[APM Agent Configuration via Kibana].
300
- If set to `true`, the client will poll the APM Server regularly for new agent configuration.
301
-
302
- Usually APM Server determines how often to poll, but if not, set the default interval is 5 minutes.
303
-
304
- NOTE: This feature requires APM Server v7.3 or later.
305
- See {kibana-ref}/agent-configuration.html[APM Agent central configuration] for more information.
306
-
307
- [float]
308
- [[config-cloud-provider]]
309
- ==== `cloud_provider`
310
- |============
311
- | Environment | `Config` key | Default
312
- | `ELASTIC_APM_CLOUD_PROVIDER` | `cloud_provider` | `"auto"`
313
- |============
314
-
315
- Specify the cloud provider for metadata collection.
316
- This defaults to `"auto"`, which means the agent uses trial and
317
- error to collect metadata from all supported cloud providers.
318
-
319
- Valid options are `"auto"`, `"aws"`, `"gcp"`, `"azure"`, and `"none"`.
320
- If set to `"none"`, no cloud metadata will be collected.
321
- If set to any of `"aws"`, `"gcp"`, or `"azure"`,
322
- attempts to collect metadata will only be performed from the chosen provider.
323
-
324
- [float]
325
- [[config-disable_metrics]]
326
- ==== `disable_metrics`
327
- |============
328
- | Environment | `Config` key | Default | Example
329
- | `ELASTIC_APM_DISABLE_METRICS` | `disable_metrics` | [] | `"*.cpu.*,system.memory.total"`
330
- |============
331
-
332
- A comma-separated list of dotted metrics names that should not be sent to the APM Server.
333
- You can use `*` to match multiple metrics.
334
- Matching is not case sensitive.
335
-
336
- [float]
337
- [[config-disable-send]]
338
- ==== `disable_send`
339
- |============
340
- | Environment | `Config` key | Default
341
- | `ELASTIC_APM_DISABLE_SEND` | `disable_send` | `false`
342
- |============
343
-
344
- This disables sending payloads to APM Server.
345
-
346
- [float]
347
- [[config-disable-start-message]]
348
- ==== `disable_start_message`
349
- |============
350
- | Environment | `Config` key | Default
351
- | `ELASTIC_APM_DISABLE_START_MESSAGE` | `disable_start_message` | `false`
352
- |============
353
-
354
- This disables the agents startup message announcing itself.
355
-
356
- [float]
357
- [[config-disabled-instrumentations]]
358
- ==== `disable_instrumentations`
359
-
360
- [options="header"]
361
- |============
362
- | Environment | `Config` key | Default
363
- | `ELASTIC_APM_DISABLE_INSTRUMENTATIONS` | `disable_instrumentations` | `['json']`
364
- |============
365
-
366
- Elastic APM automatically instruments select third-party libraries.
367
- Use this option to disable any of these.
368
-
369
- Get an array of enabled instrumentations with `ElasticAPM.agent.config.enabled_instrumentations`.
370
-
371
- [float]
372
- [[config-enabled]]
373
- ==== `enabled`
374
- [options="header"]
375
- |============
376
- | Environment | `Config` key | Default
377
- | `ELASTIC_APM_ENABLED` | `enabled` | `true`
378
- |============
379
-
380
- Indicates whether or not to start the agent.
381
- If `enabled` is `false`, `ElasticAPM.start` will do nothing and all calls to the root API will return `nil`.
382
-
383
- [float]
384
- [[config-environment]]
385
- ==== `environment`
386
-
387
- [options="header"]
388
- |============
389
- | Environment | `Config` key | Default | Example
390
- | `ELASTIC_APM_ENVIRONMENT` | `environment` | From `ENV` | `"production"`
391
- |============
392
-
393
- The name of the environment this service is deployed in,
394
- e.g. "production" or "staging".
395
-
396
- Environments allow you to easily filter data on a global level in the APM app.
397
- Be consistent when naming environments across agents.
398
- See {apm-app-ref}/filters.html#environment-selector[environment selector] in the APM app for more information.
399
-
400
- Defaults to `ENV['RAILS_ENV'] || ENV['RACK_ENV']`.
401
-
402
- NOTE: This feature is fully supported in the APM app in Kibana versions >= 7.2.
403
- You must use the query bar to filter for a specific environment in versions prior to 7.2.
404
-
405
- [float]
406
- [[config-filter-exception-types]]
407
- ==== `filter_exception_types`
408
- |============
409
- | Environment | `Config` key | Default | Example
410
- | N/A | `filter_exception_types` | `[]` | `[MyApp::Errors::IgnoredError]`
411
- |============
412
-
413
- Use this to filter error tracking for specific error constants.
414
-
415
- [float]
416
- [[config-framework-name]]
417
- ==== `framework_name`
418
- [options="header"]
419
- |============
420
- | Environment | `Config` key | Default
421
- | `ELASTIC_APM_FRAMEWORK_NAME` | `framework_name` | Depending on framework
422
- |============
423
-
424
- The name of the used framework.
425
- For Rails or Sinatra, this defaults to `Ruby on Rails` and `Sinatra` respectively,
426
- otherwise defaults to `nil`.
427
-
428
- [float]
429
- [[config-framework-version]]
430
- ==== `framework_version`
431
- [options="header"]
432
- |============
433
- | Environment | `Config` key | Default
434
- | `ELASTIC_APM_FRAMEWORK_VERSION` | `framework_version` | Depending on framework
435
- |============
436
-
437
- The version number of the used framework.
438
- For Ruby on Rails and Sinatra, this defaults to the used version of the framework,
439
- otherwise, the default is `nil`.
440
-
441
- [float]
442
- [[config-global-labels]]
443
- ==== `global_labels`
444
-
445
- [options="header"]
446
- |============
447
- | Environment | `Config` key | Default | Example
448
- | `ELASTIC_APM_GLOBAL_LABELS` | `global_labels` | `nil` | `dept=engineering,rack=number8`
449
- |============
450
-
451
- Labels added to all events, with the format key=value[,key=value[,...]].
452
-
453
- NOTE: This option requires APM Server 7.2 or greater, and will have no effect when using older
454
- server versions.
455
-
456
- [float]
457
- [[config-hostname]]
458
- ==== `hostname`
459
-
460
- [options="header"]
461
- |============
462
- | Environment | `Config` key | Default | Example
463
- | `ELASTIC_APM_HOSTNAME` | `hostname` | `hostname` | `app-server01.example.com`
464
- |============
465
-
466
- The host name to use when sending error and transaction data to the APM server.
467
-
468
- [float]
469
- [[config-custom-ignore-url-patterns]]
470
- ==== `ignore_url_patterns`
471
- [options="header"]
472
- |============
473
- | Environment | `Config` key | Default | Example
474
- | `ELASTIC_APM_IGNORE_URL_PATTERNS` | `ignore_url_patterns` | `[]` | `['^/ping', %r{^/admin}]`
475
- |============
476
-
477
- Use this option to ignore certain URL patterns such as healthchecks or admin sections.
478
-
479
- _Ignoring_ in this context means _don't wrap in a <<api-transaction,Transaction>>_.
480
- Errors will still be reported.
481
-
482
- Use a comma separated string when setting this option via `ENV`.
483
- Eg. `ELASTIC_APM_IGNORE_URL_PATTERNS="a,b" # => [/a/, /b/]`
484
-
485
- [float]
486
- [[config-instrument]]
487
- ==== `instrument`
488
- [options="header"]
489
- |============
490
- | Environment | `Config` key | Default | Example
491
- | `ELASTIC_APM_INSTRUMENT` | `instrument` | `true` | `0`
492
- |============
493
-
494
- Use this option to ignore certain URL patterns such as healthchecks or admin sections.
495
-
496
- [float]
497
- [[config-instrumented-rake-tasks]]
498
- ==== `instrumented_rake_tasks`
499
-
500
- [options="header"]
501
- |============
502
- | Environment | `Config` key | Default | Example
503
- | `ELASTIC_APM_INSTRUMENTED_RAKE_TASKS` | `instrumented_rake_tasks` | `[]` | `['my_task']`
504
- |============
505
-
506
- Elastic APM can instrument your Rake tasks. This is an opt-in field, as they are used are for a multitude of things.
507
-
508
- [float]
509
- [[config-log-ecs-formatting]]
510
- ==== `log_ecs_reformatting`
511
-
512
- [options="header"]
513
- |============
514
- | Environment | `Config` key | Default
515
- | `ELASTIC_APM_LOG_ECS_REFORMATTING` | `log_ecs_reformatting` | `off`
516
- |============
517
-
518
- This is an experimental option that configures the agent to use the logger from the `ecs-logging` gem. The two
519
- valid options are `off` and `override`.
520
-
521
- Setting this option to `override` will set the agent logger to a `EcsLogging::Logger` instance and all logged output
522
- will be in ECS-compatible json.
523
-
524
- The `ecs-logging` gem must be installed before the agent is started. If `log_ecs_reformatting` is set to `override`,
525
- the agent will attempt to require the gem and if it cannot be loaded, it will fall back to using the standard Ruby
526
- `::Logger` and log the load error.
527
-
528
- Note that if you're using Rails, the agent will ignore this option and use the Rails logger. If you want to use a
529
- `EcsLogging::Logger` when using Rails, set the agent's logger config option explicitly to a `EcsLogging::Logger`
530
- instance.
531
-
532
- [float]
533
- [[config-log-level]]
534
- ==== `log_level`
535
-
536
- <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
537
-
538
- [options="header"]
539
- |============
540
- | Environment | `Config` key | Default
541
- | `ELASTIC_APM_LOG_LEVEL` | `log_level` | `Logger::INFO # => 1`
542
- |============
543
-
544
- By default Elastic APM logs to `stdout` or uses `Rails.log` when used with Rails.
545
-
546
- [float]
547
- [[config-log-path]]
548
- ==== `log_path`
549
-
550
- [options="header"]
551
- |============
552
- | Environment | `Config` key | Default | Example
553
- | `ELASTIC_APM_LOG_PATH` | `log_path` | `nil` | `log/elastic_apm.log`
554
- |============
555
-
556
- A path to a log file.
557
-
558
- By default Elastic APM logs to `stdout` or uses `Rails.log` when used with Rails.
559
-
560
- If `log_path` is specified, this will override `Rails.log` to point to that path instead.
561
-
562
- This should support both absolute and relative paths. Please be sure the directory exists.
563
-
564
- [float]
565
- [[config-logger]]
566
- ==== `logger`
567
-
568
- [options="header"]
569
- |============
570
- | Environment | `Config` key | Default | Example
571
- | N/A | `logger` | Depends | `Logger.new('path/to_file.log')`
572
- |============
573
-
574
- By default Elastic APM logs to `stdout` or uses `Rails.log` when used with Rails.
575
-
576
- Use this to provide another logger. This is expected to have the same API as Ruby's built-in `Logger`.
577
-
578
- [float]
579
- [[config-metrics-interval]]
580
- ==== `metrics_interval`
581
-
582
- [options="header"]
583
- |============
584
- | Environment | `Config` key | Default
585
- | `ELASTIC_APM_METRICS_INTERVAL` | `metrics_interval` | `'30s'`
586
- |============
587
-
588
- Specify the interval for reporting metrics to APM Server.
589
- The interval should be in seconds,
590
- or include a time suffix.
591
-
592
- To disable metrics reporting,
593
- set the interval to `0`.
594
-
595
- [float]
596
- [[config-pool-size]]
597
- ==== `pool_size`
598
-
599
- [options="header"]
600
- |============
601
- | Environment | `Config` key | Default | Example
602
- | `ELASTIC_APM_POOL_SIZE` | `pool_size` | `1` | `2`
603
- |============
604
-
605
- Elastic APM uses a thread pool to send its data to APM Server.
606
-
607
- This makes sure the agent doesn't block the main thread any more than necessary.
608
-
609
- If you have high load and get warnings about the buffer being full, increasing
610
- the worker pool size might help.
611
-
612
- [float]
613
- [[config-proxy-address]]
614
- ==== `proxy_address`
615
-
616
- [options="header"]
617
- |============
618
- | Environment | `Config` key | Default | Example
619
- | `ELASTIC_APM_PROXY_ADDRESS` | `proxy_address` | `nil` | `"example.com"`
620
- |============
621
-
622
- An address to use as a proxy for the HTTP client.
623
-
624
- Options available are:
625
-
626
- - `proxy_address`
627
- - `proxy_headers`
628
- - `proxy_password`
629
- - `proxy_port`
630
- - `proxy_username`
631
-
632
- There are also `ENV` version of these following the same pattern of putting `ELASTIC_APM_` in front.
633
-
634
- See https://github.com/httprb/http/wiki/Proxy-Support[Http.rb's docs].
635
-
636
- [float]
637
- [[config-recording]]
638
- ==== `recording`
639
-
640
- <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
641
-
642
- [options="header"]
643
- |============
644
- | Environment | `Config` key | Default
645
- | `ELASTIC_APM_RECORDING` | `recording` | `true`
646
- |============
647
-
648
- Enable or disable the recording of events.
649
- If set to `false`, then the agent does not create or send any events to the Elastic APM server,
650
- and instrumentation overhead is minimized. The agent continues to poll the server for configuration changes
651
- when this option is false.
652
-
653
- [float]
654
- [[config-sanitize-field-names]]
655
- ==== `sanitize_field_names`
656
-
657
- [options="header"]
658
- |============
659
- | Environment | `Config` key | Default | Example
660
- | `ELASTIC_APM_SANITIZE_FIELD_NAMES` | `sanitize_field_names` | `"password,passwd,pwd,secret,*key,*token*,*session*,*credit*,*card*,*auth*,set-cookie"` | `Auth*tion,abc*,*xyz`
661
- |============
662
-
663
- Sometimes it is necessary to sanitize the data sent to Elastic APM to remove sensitive values.
664
-
665
- Configure a list of wildcard patterns of field names which should be sanitized. These apply to HTTP headers and bodies, if they're being captured.
666
-
667
- Supports the wildcard `*`, which matches zero or more characters.
668
- Examples: `/foo/*/bar/*/baz*`, `*foo*`.
669
- Matching is case insensitive.
670
-
671
- [float]
672
- [[config-service-name]]
673
- ==== `service_name`
674
-
675
- [options="header"]
676
- |============
677
- | Environment | `Config` key | Default | Example
678
- | `ELASTIC_APM_SERVICE_NAME` | `service_name` | App's name | `MyApp`
679
- |============
680
-
681
- The name of your service. This is used to group the errors and transactions of your service and is
682
- the primary filter in the Elastic APM user interface.
683
-
684
- If you're using Ruby on Rails this will default to your app's name.
685
- If you're using Sinatra it will default to the name of your app's class.
686
-
687
- NOTE: The service name must conform to this regular expression: `^[a-zA-Z0-9 _-]+$`.
688
- In other words, it must only contain characters from the ASCII
689
- alphabet, numbers, dashes, underscores, and spaces.
690
-
691
- [float]
692
- [[config-service-node-name]]
693
- ==== `service_node_name`
694
-
695
- [options="header"]
696
- |============
697
- | Environment | `Config` key | Default | Example
698
- | `ELASTIC_APM_SERVICE_NODE_NAME` | `service_node_name` | `nil` | `"my-app-1"`
699
- |============
700
-
701
- The name of the given service node. This is optional, and if omitted, the APM
702
- Server will fall back on `system.container.id` if available, and
703
- `host.name` if necessary.
704
-
705
- This option allows you to set the node name manually to ensure it's unique and meaningful.
706
-
707
- [float]
708
- [[config-service-version]]
709
- ==== `service_version`
710
- [options="header"]
711
- |============
712
- | Environment | `Config` key | Default | Example
713
- | `ELASTIC_APM_SERVICE_VERSION` | `service_version` | `git` sha | A string indicating the version of the deployed service
714
- |============
715
-
716
- The deployed version of your service.
717
- This defaults to `git rev-parse --verify HEAD`.
718
-
719
- [float]
720
- [[config-source-lines-error-app-frames]]
721
- ==== `source_lines_error_app_frames`
722
- [float]
723
- [[config-source-lines-error-library-frames]]
724
- ==== `source_lines_error_library_frames`
725
- [float]
726
- [[config-source-lines-span-app-frames]]
727
- ==== `source_lines_span_app_frames`
728
- [float]
729
- [[config-source-lines-span-library-frames]]
730
- ==== `source_lines_span_library_frames`
731
-
732
- |============
733
- | Environment | `Config` key | Default
734
- | `ELASTIC_APM_SOURCE_LINES_ERROR_APP_FRAMES` | `source_lines_error_app_frames` | `5`
735
- | `ELASTIC_APM_SOURCE_LINES_ERROR_LIBRARY_FRAMES` | `source_lines_error_library_frames` | `5`
736
- | `ELASTIC_APM_SOURCE_LINES_SPAN_APP_FRAMES` | `source_lines_span_app_frames` | `0`
737
- | `ELASTIC_APM_SOURCE_LINES_SPAN_LIBRARY_FRAMES` | `source_lines_span_library_frames` | `0`
738
- |============
739
-
740
- By default, the APM agent collects source code snippets for errors.
741
- Use the above settings to modify how many lines of source code are collected.
742
-
743
- We differ between errors and spans, as well as library frames and app frames.
744
-
745
- WARNING: Especially for spans, collecting source code can have a large impact on
746
- storage use in your Elasticsearch cluster.
747
-
748
- [float]
749
- [[config-span-frames-min-duration-ms]]
750
- ==== `span_frames_min_duration`
751
-
752
- <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
753
-
754
- |============
755
- | Environment | `Config` key | Default
756
- | `ELASTIC_APM_SPAN_FRAMES_MIN_DURATION` | `span_frames_min_duration` | `"5ms"`
757
- |============
758
-
759
- Use this to disable stack trace frame collection for spans with a duration shorter
760
- than or equal to the given amount of milleseconds.
761
-
762
- The default is `"5ms"`.
763
-
764
- Set it to `-1` to collect stack traces for all spans.
765
- Set it to `0` to disable stack trace collection for all spans.
766
-
767
- It has to be provided in *<<config-format-duration, duration format>>*.
768
-
769
- [float]
770
- [[config-ssl-ca-cert]]
771
- ==== `server_ca_cert_file`
772
-
773
- [options="header"]
774
- |============
775
- | Environment | `Config` key | Default | Example
776
- | `ELASTIC_APM_SERVER_CA_CERT_FILE` | `server_ca_cert_file` | `nil` | `'/path/to/ca.pem'`
777
- |============
778
-
779
- The path to a custom CA certificate for connecting to APM Server.
780
-
781
- [float]
782
- [[config-stack-trace-limit]]
783
- ==== `stack_trace_limit`
784
-
785
- [options="header"]
786
- |============
787
- | Environment | `Config` key | Default
788
- | `ELASTIC_APM_STACK_TRACE_LIMIT` | `stack_trace_limit` | `999999`
789
- |============
790
-
791
- The maximum number of stack trace lines per span/error.
792
-
793
- [float]
794
- [[config-transaction-max-spans]]
795
- ==== `transaction_max_spans`
796
-
797
- <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
798
-
799
- |============
800
- | Environment | `Config` key | Default
801
- | `ELASTIC_APM_TRANSACTION_MAX_SPANS` | `transaction_max_spans` | `500`
802
- |============
803
-
804
- Limits the amount of spans that are recorded per transaction.
805
- This is helpful in cases where a transaction creates a very high amount of spans
806
- (e.g. thousands of SQL queries).
807
- Setting an upper limit will prevent overloading the agent and the APM server with
808
- too much work for such edge cases.
809
-
810
- [float]
811
- [[config-transaction-sample-rate]]
812
- ==== `transaction_sample_rate`
813
-
814
- <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
815
-
816
- |============
817
- | Environment | `Config` key | Default
818
- | `ELASTIC_APM_TRANSACTION_SAMPLE_RATE` | `transaction_sample_rate` | `1.0`
819
- |============
820
-
821
- By default, the agent will sample every transaction (e.g. request to your service).
822
- To reduce overhead and storage requirements, you can set the sample rate to a value
823
- between `0.0` and `1.0`.
824
- We still record overall time and the result for unsampled transactions, but no
825
- context information, tags, or spans.
826
- The sample rate will be rounded to 4 digits of precision.
827
-
828
- [float]
829
- [[config-verify-server-cert]]
830
- ==== `verify_server_cert`
831
- |============
832
- | Environment | `Config` key | Default
833
- | `ELASTIC_APM_VERIFY_SERVER_CERT` | `verify_server_cert` | `true`
834
- |============
835
-
836
- By default, the agent verifies the SSL certificate if you use an HTTPS connection to
837
- the APM server.
838
- Verification can be disabled by changing this setting to `false`.
839
-
840
- [float]
841
- [[config-formats]]
842
- === Configuration formats
843
-
844
- Some options require a unit, either duration or size.
845
- These need to be provided in a specific format.
846
-
847
- [float]
848
- [[config-format-duration]]
849
- ==== Duration format
850
-
851
- The _duration_ format is used for options like timeouts.
852
- The unit is provided as suffix directly after the number, without any separation by whitespace.
853
-
854
- *Example*: `"5ms"`
855
-
856
- *Supported units*
857
-
858
- * `ms` (milliseconds)
859
- * `s` (seconds)
860
- * `m` (minutes)
861
-
862
- [float]
863
- [[config-format-size]]
864
- ==== Size format
865
-
866
- The _size_ format is used for options like maximum buffer sizes.
867
- The unit is provided as suffix directly after the number, without any separation by whitespace.
868
-
869
-
870
- *Example*: `10kb`
871
-
872
- *Supported units*:
873
-
874
- * `b` (bytes)
875
- * `kb` (kilobytes)
876
- * `mb` (megabytes)
877
- * `gb` (gigabytes)
878
-
879
- NOTE: We use the power-of-two sizing convention, e.g. `1 kilobyte == 1024 bytes`.
880
-
881
- [float]
882
- [[special-configuration]]
883
- === Special configuration
884
-
885
- Elastic APM patches `Kernel#require` to auto-detect and instrument supported third-party libraries. It does so with the utmost care but in rare cases, it can conflict with some libraries.
886
-
887
- To get around this patch, set the environment variable `ELASTIC_APM_SKIP_REQUIRE_PATCH` to `"1"`.
888
-
889
- The agent might need some additional tweaking to make sure the third-party libraries are picked up and instrumented. Make sure you require the agent _after_ you require your other dependencies.