@mojaloop/event-stream-processor 12.0.1

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 (52) hide show
  1. package/.circleci/config.yml +12 -0
  2. package/.editorconfig +18 -0
  3. package/.grype.yaml +37 -0
  4. package/.ncurc.yaml +7 -0
  5. package/.nvmrc +1 -0
  6. package/.nycrc.yml +19 -0
  7. package/CHANGELOG.md +89 -0
  8. package/CODEOWNERS +38 -0
  9. package/Dockerfile +49 -0
  10. package/LICENSE.md +9 -0
  11. package/README.md +178 -0
  12. package/audit-ci.jsonc +10 -0
  13. package/audit-resolve.json +21 -0
  14. package/config/default.json +133 -0
  15. package/config/policy-rollover-mojaloop.json +24 -0
  16. package/config/template-mojaloop.json +222 -0
  17. package/docker/configs/apm-server.docker.yml +1015 -0
  18. package/docker/docker-compose.yaml +170 -0
  19. package/docker/kafka-consume.sh +1 -0
  20. package/docker/kafka-produces-multi.sh +1 -0
  21. package/docker/kafka-produces-single.sh +1 -0
  22. package/docker/msg-example.single +1 -0
  23. package/docker/msg-examples.multi +8 -0
  24. package/package.json +124 -0
  25. package/sbom-v12.0.0-snapshot.25.csv +1233 -0
  26. package/src/index.js +44 -0
  27. package/src/lib/config.js +10 -0
  28. package/src/lib/efk/index.js +104 -0
  29. package/src/lib/healthCheck/subServiceHealth.js +85 -0
  30. package/src/lib/tracer/index.js +21 -0
  31. package/src/observables/apmTracerObservable.js +303 -0
  32. package/src/observables/elastic-logger.js +80 -0
  33. package/src/observables/fluentd-logger.js +20 -0
  34. package/src/observables/index.js +35 -0
  35. package/src/observables/testing_agents.-js +33 -0
  36. package/src/setup.js +128 -0
  37. package/src/templates/register.js +72 -0
  38. package/test/sample-data/messages.json +4327 -0
  39. package/test/unit/index.test.js +88 -0
  40. package/test/unit/lib/config.test.js +77 -0
  41. package/test/unit/lib/efk/index.test.js +187 -0
  42. package/test/unit/lib/healthCheck/subServiceHealth.test.js +119 -0
  43. package/test/unit/lib/tracer/index.test.js +59 -0
  44. package/test/unit/observables/apmTracerObservable.test.js +788 -0
  45. package/test/unit/observables/elastic-logger.test.js +187 -0
  46. package/test/unit/observables/fluentd-logger.test.js +101 -0
  47. package/test/unit/observables/index.test.js +47 -0
  48. package/test/unit/templates/register.test.js +66 -0
  49. package/test/util/scripts/docker-efk/docker-compose.yml +74 -0
  50. package/test/util/scripts/docker-efk/fluentd/Dockerfile +2 -0
  51. package/test/util/scripts/docker-efk/fluentd/conf/fluent.conf +18 -0
  52. package/test/util/scripts/docker-efk/misc/clients-td-agent.conf +14 -0
@@ -0,0 +1,1015 @@
1
+ ######################### APM Server Configuration #########################
2
+
3
+ ################################ APM Server ################################
4
+
5
+ apm-server:
6
+ # Defines the host and port the server is listening on. Use "unix:/path/to.sock" to listen on a unix domain socket.
7
+ host: "0.0.0.0:8200"
8
+
9
+ # Agent authorization configuration. If no methods are defined, all requests will be allowed.
10
+ #auth:
11
+ # Agent authorization using Elasticsearch API Keys.
12
+ #api_key:
13
+ #enabled: false
14
+ #
15
+ # Restrict how many unique API keys are allowed per minute. Should be set to at least the amount of different
16
+ # API keys configured in your monitored services. Every unique API key triggers one request to Elasticsearch.
17
+ #limit: 100
18
+
19
+ # Define a shared secret token for authorizing agents using the "Bearer" authorization method.
20
+ #secret_token:
21
+
22
+ # Allow anonymous access only for specified agents and/or services. This is primarily intended to allow
23
+ # limited access for untrusted agents, such as Real User Monitoring.
24
+ #anonymous:
25
+ # By default anonymous auth is automatically enabled when either auth.api_key or
26
+ # auth.secret_token is enabled, and RUM is enabled. Otherwise, anonymous auth is
27
+ # disabled by default.
28
+ #
29
+ # When anonymous auth is enabled, only agents matching allow_agent and services
30
+ # matching allow_service are allowed. See below for details on default values for
31
+ # allow_agent.
32
+ #enabled:
33
+
34
+ # Allow anonymous access only for specified agents.
35
+ #allow_agent: [rum-js, js-base]
36
+
37
+ # Allow anonymous access only for specified service names. By default, all service names are allowed.
38
+ #allow_service: []
39
+
40
+ # Rate-limit anonymous access by IP and number of events.
41
+ #rate_limit:
42
+ # Rate limiting is defined per unique client IP address, for a limited number of IP addresses.
43
+ # Sites with many concurrent clients should consider increasing this limit. Defaults to 1000.
44
+ #ip_limit: 1000
45
+
46
+ # Defines the maximum amount of events allowed per IP per second. Defaults to 300. The overall
47
+ # maximum event throughput for anonymous access is (event_limit * ip_limit).
48
+ #event_limit: 300
49
+
50
+ # Maximum permitted size in bytes of a request's header accepted by the server to be processed.
51
+ #max_header_size: 1048576
52
+
53
+ # Maximum amount of time to wait for the next incoming request before underlying connection is closed.
54
+ #idle_timeout: 45s
55
+
56
+ # Maximum permitted duration for reading an entire request.
57
+ #read_timeout: 30s
58
+
59
+ # Maximum permitted duration for writing a response.
60
+ #write_timeout: 30s
61
+
62
+ # Maximum duration before releasing resources when shutting down the server.
63
+ #shutdown_timeout: 5s
64
+
65
+ # Maximum permitted size in bytes of an event accepted by the server to be processed.
66
+ #max_event_size: 307200
67
+
68
+ # Maximum number of new connections to accept simultaneously (0 means unlimited).
69
+ #max_connections: 0
70
+
71
+ # Custom HTTP headers to add to all HTTP responses, e.g. for security policy compliance.
72
+ #response_headers:
73
+ # X-My-Header: Contents of the header
74
+
75
+ # If true (default), APM Server captures the IP of the instrumented service
76
+ # or the IP and User Agent of the real user (RUM requests).
77
+ #capture_personal_data: true
78
+
79
+ # If specified, APM Server will record this value in events which have no service environment
80
+ # defined, and add it to agent configuration queries to Kibana when none is specified in the
81
+ # request from the agent.
82
+ #default_service_environment:
83
+
84
+ # All events will be recorded in this data stream namespace when not managed by fleet.
85
+ # data_streams.namespace: default
86
+
87
+ # Enable APM Server Golang expvar support (https://golang.org/pkg/expvar/).
88
+ #expvar:
89
+ #enabled: false
90
+
91
+ # Url to expose expvar.
92
+ #url: "/debug/vars"
93
+
94
+
95
+ #---------------------------- APM Server - Secure Communication with Agents ----------------------------
96
+
97
+ # Enable secure communication between APM agents and the server. By default ssl is disabled.
98
+ #ssl:
99
+ #enabled: false
100
+
101
+ # Path to file containing the certificate for server authentication.
102
+ # Needs to be configured when ssl is enabled.
103
+ #certificate: ''
104
+
105
+ # Path to file containing server certificate key.
106
+ # Needs to be configured when ssl is enabled.
107
+ #key: ''
108
+
109
+ # Optional configuration options for ssl communication.
110
+
111
+ # Passphrase for decrypting the Certificate Key.
112
+ # It is recommended to use the provided keystore instead of entering the passphrase in plain text.
113
+ #key_passphrase: ''
114
+
115
+ # List of supported/valid protocol versions. By default TLS versions 1.1 up to 1.3 are enabled.
116
+ #supported_protocols: [TLSv1.1, TLSv1.2, TLSv1.3]
117
+
118
+ # Configure cipher suites to be used for SSL connections.
119
+ # Note that cipher suites are not configurable for TLS 1.3.
120
+ #cipher_suites: []
121
+
122
+ # Configure curve types for ECDHE based cipher suites.
123
+ #curve_types: []
124
+
125
+ #---------------------------- APM Server - RUM Real User Monitoring ----------------------------
126
+
127
+ # Enable Real User Monitoring (RUM) Support. By default RUM is disabled.
128
+ # RUM does not support token based authorization. Enabled RUM endpoints will not require any authorization
129
+ # token configured for other endpoints.
130
+ #rum:
131
+ #enabled: false
132
+
133
+ #-- General RUM settings
134
+
135
+ # A list of permitted origins for real user monitoring.
136
+ # User-agents will send an origin header that will be validated against this list.
137
+ # An origin is made of a protocol scheme, host and port, without the url path.
138
+ # Allowed origins in this setting can have * to match anything (eg.: http://*.example.com)
139
+ # If an item in the list is a single '*', everything will be allowed.
140
+ #allow_origins: ['*']
141
+
142
+ # A list of Access-Control-Allow-Headers to allow RUM requests, in addition to "Content-Type",
143
+ # "Content-Encoding", and "Accept"
144
+ #allow_headers: []
145
+
146
+ # Custom HTTP headers to add to RUM responses, e.g. for security policy compliance.
147
+ #response_headers:
148
+ # X-My-Header: Contents of the header
149
+
150
+ # Regexp to be matched against a stacktrace frame's `file_name` and `abs_path` attributes.
151
+ # If the regexp matches, the stacktrace frame is considered to be a library frame.
152
+ #library_pattern: "node_modules|bower_components|~"
153
+
154
+ # Regexp to be matched against a stacktrace frame's `file_name`.
155
+ # If the regexp matches, the stacktrace frame is not used for calculating error groups.
156
+ # The default pattern excludes stacktrace frames that have a filename starting with '/webpack'
157
+ #exclude_from_grouping: "^/webpack"
158
+
159
+ # If a source map has previously been uploaded, source mapping is automatically applied.
160
+ # to all error and transaction documents sent to the RUM endpoint.
161
+ #source_mapping:
162
+
163
+ # Sourcemapping is enabled by default.
164
+ #enabled: true
165
+
166
+ # Timeout for fetching source maps.
167
+ #timeout: 5s
168
+
169
+ # The `cache.expiration` determines how long a source map should be cached in memory.
170
+ # Note that values configured without a time unit will be interpreted as seconds.
171
+ #cache.expiration: 5m
172
+
173
+ # Source maps may be fetched from Elasticsearch by using the output.elasticsearch configuration,
174
+ # and running apm-server standalone.
175
+ #
176
+ # Note: fetching source maps from Elasticsearch is not supported if apm-server is being managed by
177
+ # Fleet. This configuration is only applicable to standalone apm-servers, for backwards compatibility
178
+ # with source maps stored in Elasticsearch by older versions of apm-server. New source maps must now
179
+ # be uploaded via Kibana, and `apm-server.kibana` configured in standalone apm-servers for fetching
180
+ # them.
181
+ #elasticsearch:
182
+ # Array of hosts to connect to.
183
+ # Scheme and port can be left out and will be set to the default (`http` and `9200`).
184
+ # In case you specify and additional path, the scheme is required: `http://localhost:9200/path`.
185
+ # IPv6 addresses should always be defined as: `https://[2001:db8::1]:9200`.
186
+ # hosts: ["localhost:9200"]
187
+
188
+ # Protocol - either `http` (default) or `https`.
189
+ #protocol: "https"
190
+
191
+ # Authentication credentials - either API key or username/password.
192
+ #api_key: "id:api_key"
193
+ #username: "elastic"
194
+ #password: "changeme"
195
+
196
+ # Index pattern in which to search for source maps, when fetching source maps from Elasticsearch.
197
+ #index_pattern: "apm-*-sourcemap*"
198
+
199
+ #---------------------------- APM Server - Agent Configuration ----------------------------
200
+
201
+ # When using APM agent configuration, information fetched from Kibana will be cached in memory for some time.
202
+ # Specify cache key expiration via this setting. Default is 30 seconds.
203
+ #agent.config.cache.expiration: 30s
204
+
205
+ #kibana:
206
+ # Enabled must be true to enable APM Agent configuration, and for fetching source maps uploaded through Kibana.
207
+ #enabled: false
208
+
209
+ # Scheme and port can be left out and will be set to the default (`http` and `5601`).
210
+ # In case you specify an additional path, the scheme is required: `http://localhost:5601/path`.
211
+ # IPv6 addresses should always be defined as: `https://[2001:db8::1]:5601`.
212
+ #host: "localhost:5601"
213
+
214
+ # Optional protocol and basic auth credentials.
215
+ #protocol: "https"
216
+ #username: "elastic"
217
+ #password: "changeme"
218
+
219
+ # Optional HTTP path.
220
+ #path: ""
221
+
222
+ # Enable custom SSL settings. Set to false to ignore custom SSL settings for secure communication.
223
+ #ssl.enabled: true
224
+
225
+ # Optional SSL configuration options. SSL is off by default, change the `protocol` option if you want to enable `https`.
226
+ #
227
+ # Control the verification of Kibana certificates. Valid values are:
228
+ # * full, which verifies that the provided certificate is signed by a trusted
229
+ # authority (CA) and also verifies that the server's hostname (or IP address)
230
+ # matches the names identified within the certificate.
231
+ # * strict, which verifies that the provided certificate is signed by a trusted
232
+ # authority (CA) and also verifies that the server's hostname (or IP address)
233
+ # matches the names identified within the certificate. If the Subject Alternative
234
+ # Name is empty, it returns an error.
235
+ # * certificate, which verifies that the provided certificate is signed by a
236
+ # trusted authority (CA), but does not perform any hostname verification.
237
+ # * none, which performs no verification of the server's certificate. This
238
+ # mode disables many of the security benefits of SSL/TLS and should only be used
239
+ # after very careful consideration. It is primarily intended as a temporary
240
+ # diagnostic mechanism when attempting to resolve TLS errors; its use in
241
+ # production environments is strongly discouraged.
242
+ #ssl.verification_mode: full
243
+
244
+ # List of supported/valid TLS versions. By default all TLS versions 1.0 up to
245
+ # 1.2 are enabled.
246
+ #ssl.supported_protocols: [TLSv1.0, TLSv1.1, TLSv1.2]
247
+
248
+ # List of root certificates for HTTPS server verifications.
249
+ #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
250
+
251
+ # Certificate for SSL client authentication.
252
+ #ssl.certificate: "/etc/pki/client/cert.pem"
253
+
254
+ # Client Certificate Key
255
+ #ssl.key: "/etc/pki/client/cert.key"
256
+
257
+ # Optional passphrase for decrypting the Certificate Key.
258
+ # It is recommended to use the provided keystore instead of entering the passphrase in plain text.
259
+ #ssl.key_passphrase: ''
260
+
261
+ # Configure cipher suites to be used for SSL connections.
262
+ #ssl.cipher_suites: []
263
+
264
+ # Configure curve types for ECDHE based cipher suites.
265
+ #ssl.curve_types: []
266
+
267
+ #================================= General =================================
268
+
269
+ # Data is buffered in a memory queue before it is published to the configured output.
270
+ # The memory queue will present all available events (up to the outputs
271
+ # bulk_max_size) to the output, the moment the output is ready to serve
272
+ # another batch of events.
273
+ #queue:
274
+ # Queue type by name (default 'mem').
275
+ #mem:
276
+ # Max number of events the queue can buffer.
277
+ #events: 4096
278
+
279
+ # Hints the minimum number of events stored in the queue,
280
+ # before providing a batch of events to the outputs.
281
+ # The default value is set to 2048.
282
+ # A value of 0 ensures events are immediately available
283
+ # to be sent to the outputs.
284
+ #flush.min_events: 2048
285
+
286
+ # Maximum duration after which events are available to the outputs,
287
+ # if the number of events stored in the queue is < `flush.min_events`.
288
+ #flush.timeout: 1s
289
+
290
+ # Sets the maximum number of CPUs that can be executing simultaneously. The
291
+ # default is the number of logical CPUs available in the system.
292
+ #max_procs:
293
+
294
+ #============================= Elastic Cloud =============================
295
+
296
+ # These settings simplify using APM Server with the Elastic Cloud (https://cloud.elastic.co/).
297
+
298
+ # The cloud.id setting overwrites the `output.elasticsearch.hosts` option.
299
+ # You can find the `cloud.id` in the Elastic Cloud web UI.
300
+ #cloud.id:
301
+
302
+ # The cloud.auth setting overwrites the `output.elasticsearch.username` and
303
+ # `output.elasticsearch.password` settings. The format is `<user>:<pass>`.
304
+ #cloud.auth:
305
+
306
+ #================================ Outputs =================================
307
+
308
+ # Configure the output to use when sending the data collected by apm-server.
309
+
310
+ #-------------------------- Elasticsearch output --------------------------
311
+ output.elasticsearch:
312
+ # Array of hosts to connect to.
313
+ # Scheme and port can be left out and will be set to the default (`http` and `9200`).
314
+ # In case you specify and additional path, the scheme is required: `http://localhost:9200/path`.
315
+ # IPv6 addresses should always be defined as: `https://[2001:db8::1]:9200`.
316
+ hosts: ["elasticsearch:9200"]
317
+
318
+ # Boolean flag to enable or disable the output module.
319
+ #enabled: true
320
+
321
+ # Set gzip compression level.
322
+ #compression_level: 0
323
+
324
+ # Protocol - either `http` (default) or `https`.
325
+ #protocol: "https"
326
+
327
+ # Authentication credentials - either API key or username/password.
328
+ #api_key: "id:api_key"
329
+ #username: "elastic"
330
+ #password: "changeme"
331
+
332
+ # Dictionary of HTTP parameters to pass within the url with index operations.
333
+ #parameters:
334
+ #param1: value1
335
+ #param2: value2
336
+
337
+ # Number of workers per Elasticsearch host.
338
+ #worker: 1
339
+
340
+ # Optional HTTP Path.
341
+ #path: "/elasticsearch"
342
+
343
+ # Custom HTTP headers to add to each request.
344
+ #headers:
345
+ # X-My-Header: Contents of the header
346
+
347
+ # Proxy server url.
348
+ #proxy_url: http://proxy:3128
349
+
350
+ # The number of times a particular Elasticsearch index operation is attempted. If
351
+ # the indexing operation doesn't succeed after this many retries, the events are
352
+ # dropped. The default is 3.
353
+ #max_retries: 3
354
+
355
+ # The maximum number of events to bulk in a single Elasticsearch bulk API index request.
356
+ # The default is 50.
357
+ #bulk_max_size: 50
358
+
359
+ # The number of seconds to wait before trying to reconnect to Elasticsearch
360
+ # after a network error. After waiting backoff.init seconds, apm-server
361
+ # tries to reconnect. If the attempt fails, the backoff timer is increased
362
+ # exponentially up to backoff.max. After a successful connection, the backoff
363
+ # timer is reset. The default is 1s.
364
+ #backoff.init: 1s
365
+
366
+ # The maximum number of seconds to wait before attempting to connect to
367
+ # Elasticsearch after a network error. The default is 60s.
368
+ #backoff.max: 60s
369
+
370
+ # Configure http request timeout before failing an request to Elasticsearch.
371
+ #timeout: 90
372
+
373
+ # Enable custom SSL settings. Set to false to ignore custom SSL settings for secure communication.
374
+ #ssl.enabled: true
375
+
376
+ # Optional SSL configuration options. SSL is off by default, change the `protocol` option if you want to enable `https`.
377
+ #
378
+ # Control the verification of Elasticsearch certificates. Valid values are:
379
+ # * full, which verifies that the provided certificate is signed by a trusted
380
+ # authority (CA) and also verifies that the server's hostname (or IP address)
381
+ # matches the names identified within the certificate.
382
+ # * strict, which verifies that the provided certificate is signed by a trusted
383
+ # authority (CA) and also verifies that the server's hostname (or IP address)
384
+ # matches the names identified within the certificate. If the Subject Alternative
385
+ # Name is empty, it returns an error.
386
+ # * certificate, which verifies that the provided certificate is signed by a
387
+ # trusted authority (CA), but does not perform any hostname verification.
388
+ # * none, which performs no verification of the server's certificate. This
389
+ # mode disables many of the security benefits of SSL/TLS and should only be used
390
+ # after very careful consideration. It is primarily intended as a temporary
391
+ # diagnostic mechanism when attempting to resolve TLS errors; its use in
392
+ # production environments is strongly discouraged.
393
+ #ssl.verification_mode: full
394
+
395
+ # List of supported/valid TLS versions. By default all TLS versions 1.0 up to
396
+ # 1.2 are enabled.
397
+ #ssl.supported_protocols: [TLSv1.0, TLSv1.1, TLSv1.2]
398
+
399
+ # List of root certificates for HTTPS server verifications.
400
+ #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
401
+
402
+ # Certificate for SSL client authentication.
403
+ #ssl.certificate: "/etc/pki/client/cert.pem"
404
+
405
+ # Client Certificate Key
406
+ #ssl.key: "/etc/pki/client/cert.key"
407
+
408
+ # Optional passphrase for decrypting the Certificate Key.
409
+ # It is recommended to use the provided keystore instead of entering the passphrase in plain text.
410
+ #ssl.key_passphrase: ''
411
+
412
+ # Configure cipher suites to be used for SSL connections.
413
+ #ssl.cipher_suites: []
414
+
415
+ # Configure curve types for ECDHE based cipher suites.
416
+ #ssl.curve_types: []
417
+
418
+ # Configure what types of renegotiation are supported. Valid options are
419
+ # never, once, and freely. Default is never.
420
+ #ssl.renegotiation: never
421
+
422
+ # Enable Kerberos support. Kerberos is automatically enabled if any Kerberos setting is set.
423
+ #kerberos.enabled: true
424
+
425
+ # Authentication type to use with Kerberos. Available options: keytab, password.
426
+ #kerberos.auth_type: password
427
+
428
+ # Path to the keytab file. It is used when auth_type is set to keytab.
429
+ #kerberos.keytab: /etc/elastic.keytab
430
+
431
+ # Path to the Kerberos configuration.
432
+ #kerberos.config_path: /etc/krb5.conf
433
+
434
+ # Name of the Kerberos user.
435
+ #kerberos.username: elastic
436
+
437
+ # Password of the Kerberos user. It is used when auth_type is set to password.
438
+ #kerberos.password: changeme
439
+
440
+ # Kerberos realm.
441
+ #kerberos.realm: ELASTIC
442
+
443
+
444
+ #----------------------------- Console output -----------------------------
445
+ #output.console:
446
+ # Boolean flag to enable or disable the output module.
447
+ #enabled: false
448
+
449
+ # Configure JSON encoding.
450
+ #codec.json:
451
+ # Pretty-print JSON event.
452
+ #pretty: false
453
+
454
+ # Configure escaping HTML symbols in strings.
455
+ #escape_html: false
456
+
457
+ #---------------------------- Logstash output -----------------------------
458
+ #output.logstash:
459
+ # Boolean flag to enable or disable the output module.
460
+ #enabled: false
461
+
462
+ # The Logstash hosts.
463
+ #hosts: ["localhost:5044"]
464
+
465
+ # Number of workers per Logstash host.
466
+ #worker: 1
467
+
468
+ # Set gzip compression level.
469
+ #compression_level: 3
470
+
471
+ # Configure escaping html symbols in strings.
472
+ #escape_html: true
473
+
474
+ # Optional maximum time to live for a connection to Logstash, after which the
475
+ # connection will be re-established. A value of `0s` (the default) will
476
+ # disable this feature.
477
+ #
478
+ # Not yet supported for async connections (i.e. with the "pipelining" option set).
479
+ #ttl: 30s
480
+
481
+ # Optional load balance the events between the Logstash hosts. Default is false.
482
+ #loadbalance: false
483
+
484
+ # Number of batches to be sent asynchronously to Logstash while processing
485
+ # new batches.
486
+ #pipelining: 2
487
+
488
+ # If enabled only a subset of events in a batch of events is transferred per
489
+ # group. The number of events to be sent increases up to `bulk_max_size`
490
+ # if no error is encountered.
491
+ #slow_start: false
492
+
493
+ # The number of seconds to wait before trying to reconnect to Logstash
494
+ # after a network error. After waiting backoff.init seconds, apm-server
495
+ # tries to reconnect. If the attempt fails, the backoff timer is increased
496
+ # exponentially up to backoff.max. After a successful connection, the backoff
497
+ # timer is reset. The default is 1s.
498
+ #backoff.init: 1s
499
+
500
+ # The maximum number of seconds to wait before attempting to connect to
501
+ # Logstash after a network error. The default is 60s.
502
+ #backoff.max: 60s
503
+
504
+ # Optional index name. The default index name is set to apm
505
+ # in all lowercase.
506
+ #index: 'apm'
507
+
508
+ # SOCKS5 proxy server URL
509
+ #proxy_url: socks5://user:password@socks5-server:2233
510
+
511
+ # Resolve names locally when using a proxy server. Defaults to false.
512
+ #proxy_use_local_resolver: false
513
+
514
+ # Enable SSL support. SSL is automatically enabled if any SSL setting is set.
515
+ #ssl.enabled: false
516
+
517
+ # Optional SSL configuration options. SSL is off by default.
518
+ #
519
+ # Control the verification of Logstash certificates. Valid values are:
520
+ # * full, which verifies that the provided certificate is signed by a trusted
521
+ # authority (CA) and also verifies that the server's hostname (or IP address)
522
+ # matches the names identified within the certificate.
523
+ # * strict, which verifies that the provided certificate is signed by a trusted
524
+ # authority (CA) and also verifies that the server's hostname (or IP address)
525
+ # matches the names identified within the certificate. If the Subject Alternative
526
+ # Name is empty, it returns an error.
527
+ # * certificate, which verifies that the provided certificate is signed by a
528
+ # trusted authority (CA), but does not perform any hostname verification.
529
+ # * none, which performs no verification of the server's certificate. This
530
+ # mode disables many of the security benefits of SSL/TLS and should only be used
531
+ # after very careful consideration. It is primarily intended as a temporary
532
+ # diagnostic mechanism when attempting to resolve TLS errors; its use in
533
+ # production environments is strongly discouraged.
534
+ #ssl.verification_mode: full
535
+
536
+ # List of supported/valid TLS versions. By default all TLS versions 1.0 up to
537
+ # 1.2 are enabled.
538
+ #ssl.supported_protocols: [TLSv1.0, TLSv1.1, TLSv1.2]
539
+
540
+ # List of root certificates for HTTPS server verifications.
541
+ #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
542
+
543
+ # Certificate for SSL client authentication.
544
+ #ssl.certificate: "/etc/pki/client/cert.pem"
545
+
546
+ # Client Certificate Key
547
+ #ssl.key: "/etc/pki/client/cert.key"
548
+
549
+ # Optional passphrase for decrypting the Certificate Key.
550
+ # It is recommended to use the provided keystore instead of entering the passphrase in plain text.
551
+ #ssl.key_passphrase: ''
552
+
553
+ # Configure cipher suites to be used for SSL connections.
554
+ #ssl.cipher_suites: []
555
+
556
+ # Configure curve types for ECDHE based cipher suites.
557
+ #ssl.curve_types: []
558
+
559
+ # Configure what types of renegotiation are supported. Valid options are
560
+ # never, once, and freely. Default is never.
561
+ #ssl.renegotiation: never
562
+
563
+ #------------------------------ Kafka output ------------------------------
564
+ #output.kafka:
565
+ # Boolean flag to enable or disable the output module.
566
+ #enabled: false
567
+
568
+ # The list of Kafka broker addresses from where to fetch the cluster metadata.
569
+ # The cluster metadata contain the actual Kafka brokers events are published
570
+ # to.
571
+ #hosts: ["localhost:9092"]
572
+
573
+ # The Kafka topic used for produced events. The setting can be a format string
574
+ # using any event field. To set the topic from document type use `%{[type]}`.
575
+ #topic: beats
576
+
577
+ # The Kafka event key setting. Use format string to create unique event key.
578
+ # By default no event key will be generated.
579
+ #key: ''
580
+
581
+ # The Kafka event partitioning strategy. Default hashing strategy is `hash`
582
+ # using the `output.kafka.key` setting or randomly distributes events if
583
+ # `output.kafka.key` is not configured.
584
+ #partition.hash:
585
+ # If enabled, events will only be published to partitions with reachable
586
+ # leaders. Default is false.
587
+ #reachable_only: false
588
+
589
+ # Configure alternative event field names used to compute the hash value.
590
+ # If empty `output.kafka.key` setting will be used.
591
+ # Default value is empty list.
592
+ #hash: []
593
+
594
+ # Authentication details. Password is required if username is set.
595
+ #username: ''
596
+ #password: ''
597
+
598
+ # Kafka version libbeat is assumed to run against. Defaults to the "1.0.0".
599
+ #version: '1.0.0'
600
+
601
+ # Configure JSON encoding.
602
+ #codec.json:
603
+ # Pretty print json event
604
+ #pretty: false
605
+
606
+ # Configure escaping html symbols in strings.
607
+ #escape_html: true
608
+
609
+ # Metadata update configuration. Metadata do contain leader information
610
+ # deciding which broker to use when publishing.
611
+ #metadata:
612
+ # Max metadata request retry attempts when cluster is in middle of leader
613
+ # election. Defaults to 3 retries.
614
+ #retry.max: 3
615
+
616
+ # Waiting time between retries during leader elections. Default is 250ms.
617
+ #retry.backoff: 250ms
618
+
619
+ # Refresh metadata interval. Defaults to every 10 minutes.
620
+ #refresh_frequency: 10m
621
+
622
+ # The number of concurrent load-balanced Kafka output workers.
623
+ #worker: 1
624
+
625
+ # The number of times to retry publishing an event after a publishing failure.
626
+ # After the specified number of retries, the events are typically dropped.
627
+ # Set max_retries to a value less than 0 to retry
628
+ # until all events are published. The default is 3.
629
+ #max_retries: 3
630
+
631
+ # The maximum number of events to bulk in a single Kafka request. The default
632
+ # is 2048.
633
+ #bulk_max_size: 2048
634
+
635
+ # The number of seconds to wait for responses from the Kafka brokers before
636
+ # timing out. The default is 30s.
637
+ #timeout: 30s
638
+
639
+ # The maximum duration a broker will wait for number of required ACKs. The
640
+ # default is 10s.
641
+ #broker_timeout: 10s
642
+
643
+ # The number of messages buffered for each Kafka broker. The default is 256.
644
+ #channel_buffer_size: 256
645
+
646
+ # The keep-alive period for an active network connection. If 0s, keep-alives
647
+ # are disabled. The default is 0 seconds.
648
+ #keep_alive: 0
649
+
650
+ # Sets the output compression codec. Must be one of none, snappy and gzip. The
651
+ # default is gzip.
652
+ #compression: gzip
653
+
654
+ # Set the compression level. Currently only gzip provides a compression level
655
+ # between 0 and 9. The default value is chosen by the compression algorithm.
656
+ #compression_level: 4
657
+
658
+ # The maximum permitted size of JSON-encoded messages. Bigger messages will be
659
+ # dropped. The default value is 1000000 (bytes). This value should be equal to
660
+ # or less than the broker's message.max.bytes.
661
+ #max_message_bytes: 1000000
662
+
663
+ # The ACK reliability level required from broker. 0=no response, 1=wait for
664
+ # local commit, -1=wait for all replicas to commit. The default is 1. Note:
665
+ # If set to 0, no ACKs are returned by Kafka. Messages might be lost silently
666
+ # on error.
667
+ #required_acks: 1
668
+
669
+ # The configurable ClientID used for logging, debugging, and auditing
670
+ # purposes. The default is "beats".
671
+ #client_id: beats
672
+
673
+ # Enable SSL support. SSL is automatically enabled if any SSL setting is set.
674
+ #ssl.enabled: false
675
+
676
+ # Optional SSL configuration options. SSL is off by default.
677
+ #
678
+ # Control the verification of Kafka certificates. Valid values are:
679
+ # * full, which verifies that the provided certificate is signed by a trusted
680
+ # authority (CA) and also verifies that the server's hostname (or IP address)
681
+ # matches the names identified within the certificate.
682
+ # * strict, which verifies that the provided certificate is signed by a trusted
683
+ # authority (CA) and also verifies that the server's hostname (or IP address)
684
+ # matches the names identified within the certificate. If the Subject Alternative
685
+ # Name is empty, it returns an error.
686
+ # * certificate, which verifies that the provided certificate is signed by a
687
+ # trusted authority (CA), but does not perform any hostname verification.
688
+ # * none, which performs no verification of the server's certificate. This
689
+ # mode disables many of the security benefits of SSL/TLS and should only be used
690
+ # after very careful consideration. It is primarily intended as a temporary
691
+ # diagnostic mechanism when attempting to resolve TLS errors; its use in
692
+ # production environments is strongly discouraged.
693
+ #ssl.verification_mode: full
694
+
695
+ # List of supported/valid TLS versions. By default all TLS versions 1.0 up to
696
+ # 1.2 are enabled.
697
+ #ssl.supported_protocols: [TLSv1.0, TLSv1.1, TLSv1.2]
698
+
699
+ # List of root certificates for HTTPS server verifications.
700
+ #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
701
+
702
+ # Certificate for SSL client authentication.
703
+ #ssl.certificate: "/etc/pki/client/cert.pem"
704
+
705
+ # Client Certificate Key
706
+ #ssl.key: "/etc/pki/client/cert.key"
707
+
708
+ # Optional passphrase for decrypting the Certificate Key.
709
+ # It is recommended to use the provided keystore instead of entering the passphrase in plain text.
710
+ #ssl.key_passphrase: ''
711
+
712
+ # Configure cipher suites to be used for SSL connections.
713
+ #ssl.cipher_suites: []
714
+
715
+ # Configure curve types for ECDHE based cipher suites.
716
+ #ssl.curve_types: []
717
+
718
+ # Configure what types of renegotiation are supported. Valid options are
719
+ # never, once, and freely. Default is never.
720
+ #ssl.renegotiation: never
721
+
722
+ # Authentication type to use with Kerberos. Available options: keytab, password.
723
+ #kerberos.auth_type: password
724
+
725
+ # Path to the keytab file. It is used when auth_type is set to keytab.
726
+ #kerberos.keytab: /etc/krb5kdc/kafka.keytab
727
+
728
+ # Path to the Kerberos configuration.
729
+ #kerberos.config_path: /etc/path/config
730
+
731
+ # The service principal name.
732
+ #kerberos.service_name: HTTP/my-service@realm
733
+
734
+ # Name of the Kerberos user. It is used when auth_type is set to password.
735
+ #kerberos.username: elastic
736
+
737
+ # Password of the Kerberos user. It is used when auth_type is set to password.
738
+ #kerberos.password: changeme
739
+
740
+ # Kerberos realm.
741
+ #kerberos.realm: ELASTIC
742
+
743
+ #============================= Instrumentation =============================
744
+
745
+ # Instrumentation support for the server's HTTP endpoints and event publisher.
746
+ #instrumentation:
747
+
748
+ # Set to true to enable instrumentation of the APM Server itself.
749
+ #enabled: false
750
+
751
+ # Environment in which the APM Server is running on (eg: staging, production, etc.)
752
+ #environment: ""
753
+
754
+ # Hosts to report instrumentation results to.
755
+ # For reporting to itself, leave this field commented
756
+ #hosts:
757
+ # - http://remote-apm-server:8200
758
+
759
+ # API Key for the remote APM Server(s).
760
+ # If api_key is set then secret_token will be ignored.
761
+ #api_key:
762
+
763
+ # Secret token for the remote APM Server(s).
764
+ #secret_token:
765
+
766
+ # Enable profiling of the server, recording profile samples as events.
767
+ #
768
+ # This feature is experimental.
769
+ #profiling:
770
+ #cpu:
771
+ # Set to true to enable CPU profiling.
772
+ #enabled: false
773
+ #interval: 60s
774
+ #duration: 10s
775
+ #heap:
776
+ # Set to true to enable heap profiling.
777
+ #enabled: false
778
+ #interval: 60s
779
+
780
+ #================================= Paths ==================================
781
+
782
+ # The home path for the apm-server installation. This is the default base path
783
+ # for all other path settings and for miscellaneous files that come with the
784
+ # distribution.
785
+ # If not set by a CLI flag or in the configuration file, the default for the
786
+ # home path is the location of the binary.
787
+ #path.home:
788
+
789
+ # The configuration path for the apm-server installation. This is the default
790
+ # base path for configuration files, including the main YAML configuration file
791
+ # and the Elasticsearch template file. If not set by a CLI flag or in the
792
+ # configuration file, the default for the configuration path is the home path.
793
+ #path.config: ${path.home}
794
+
795
+ # The data path for the apm-server installation. This is the default base path
796
+ # for all the files in which apm-server needs to store its data. If not set by a
797
+ # CLI flag or in the configuration file, the default for the data path is a data
798
+ # subdirectory inside the home path.
799
+ #path.data: ${path.home}/data
800
+
801
+ # The logs path for an apm-server installation. If not set by a CLI flag or in the
802
+ # configuration file, the default is a logs subdirectory inside the home path.
803
+ #path.logs: ${path.home}/logs
804
+
805
+ #================================= Logging =================================
806
+
807
+ # There are three options for the log output: syslog, file, and stderr.
808
+ # Windows systems default to file output. All other systems default to syslog.
809
+
810
+ # Sets the minimum log level. The default log level is info.
811
+ # Available log levels are: error, warning, info, or debug.
812
+ #logging.level: info
813
+
814
+ # Enable debug output for selected components. To enable all selectors use ["*"].
815
+ # Other available selectors are "beat", "publish", or "service".
816
+ # Multiple selectors can be chained.
817
+ #logging.selectors: [ ]
818
+
819
+ # Send all logging output to syslog. The default is false.
820
+ #logging.to_syslog: true
821
+
822
+ # If enabled, apm-server periodically logs its internal metrics that have changed
823
+ # in the last period. For each metric that changed, the delta from the value at
824
+ # the beginning of the period is logged. Also, the total values for
825
+ # all non-zero internal metrics are logged on shutdown. The default is false.
826
+ #logging.metrics.enabled: false
827
+
828
+ # The period after which to log the internal metrics. The default is 30s.
829
+ #logging.metrics.period: 30s
830
+
831
+ # Logging to rotating files. When true, writes all logging output to files.
832
+ # The log files are automatically rotated when the log file size limit is reached.
833
+ #logging.to_files: true
834
+ #logging.files:
835
+ # Configure the path where the logs are written. The default is the logs directory
836
+ # under the home path (the binary location).
837
+ #path: /var/log/apm-server
838
+
839
+ # The name of the files where the logs are written to.
840
+ #name: apm-server
841
+
842
+ # Configure log file size limit. If limit is reached, log file will be
843
+ # automatically rotated.
844
+ #rotateeverybytes: 10485760 # = 10MB
845
+
846
+ # Number of rotated log files to keep. Oldest files will be deleted first.
847
+ #keepfiles: 7
848
+
849
+ # The permissions mask to apply when rotating log files. The default value is 0600.
850
+ # Must be a valid Unix-style file permissions mask expressed in octal notation.
851
+ #permissions: 0600
852
+
853
+ # Enable log file rotation on time intervals in addition to size-based rotation.
854
+ # Intervals must be at least 1s. Values of 1m, 1h, 24h, 7*24h, 30*24h, and 365*24h
855
+ # are boundary-aligned with minutes, hours, days, weeks, months, and years as
856
+ # reported by the local system clock. All other intervals are calculated from the
857
+ # Unix epoch. Defaults to disabled.
858
+ #interval: 0
859
+
860
+ #=============================== HTTP Endpoint ===============================
861
+
862
+ # apm-server can expose internal metrics through a HTTP endpoint. For security
863
+ # reasons the endpoint is disabled by default. This feature is currently experimental.
864
+ # Stats can be access through http://localhost:5066/stats. For pretty JSON output
865
+ # append ?pretty to the URL.
866
+
867
+ # Defines if the HTTP endpoint is enabled.
868
+ #http.enabled: false
869
+
870
+ # The HTTP endpoint will bind to this hostname or IP address. It is recommended to use only localhost.
871
+ #http.host: localhost
872
+
873
+ # Port on which the HTTP endpoint will bind. Default is 5066.
874
+ #http.port: 5066
875
+
876
+ #============================= X-pack Monitoring =============================
877
+
878
+ # APM server can export internal metrics to a central Elasticsearch monitoring
879
+ # cluster. This requires x-pack monitoring to be enabled in Elasticsearch. The
880
+ # reporting is disabled by default.
881
+
882
+ # Set to true to enable the monitoring reporter.
883
+ #monitoring.enabled: false
884
+
885
+ # Most settings from the Elasticsearch output are accepted here as well.
886
+ # Note that these settings should be configured to point to your Elasticsearch *monitoring* cluster.
887
+ # Any setting that is not set is automatically inherited from the Elasticsearch
888
+ # output configuration. This means that if you have the Elasticsearch output configured,
889
+ # you can simply uncomment the following line.
890
+ #monitoring.elasticsearch:
891
+
892
+ # Protocol - either `http` (default) or `https`.
893
+ #protocol: "https"
894
+
895
+ # Authentication credentials - either API key or username/password.
896
+ #api_key: "id:api_key"
897
+ #username: "elastic"
898
+ #password: "changeme"
899
+
900
+ # Array of hosts to connect to.
901
+ # Scheme and port can be left out and will be set to the default (`http` and `9200`).
902
+ # In case you specify and additional path, the scheme is required: `http://localhost:9200/path`.
903
+ # IPv6 addresses should always be defined as: `https://[2001:db8::1]:9200`.
904
+ #hosts: ["localhost:9200"]
905
+
906
+ # Set gzip compression level.
907
+ #compression_level: 0
908
+
909
+ # Dictionary of HTTP parameters to pass within the URL with index operations.
910
+ #parameters:
911
+ #param1: value1
912
+ #param2: value2
913
+
914
+ # Custom HTTP headers to add to each request.
915
+ #headers:
916
+ # X-My-Header: Contents of the header
917
+
918
+ # Proxy server url.
919
+ #proxy_url: http://proxy:3128
920
+
921
+ # The number of times a particular Elasticsearch index operation is attempted. If
922
+ # the indexing operation doesn't succeed after this many retries, the events are
923
+ # dropped. The default is 3.
924
+ #max_retries: 3
925
+
926
+ # The maximum number of events to bulk in a single Elasticsearch bulk API index request.
927
+ # The default is 50.
928
+ #bulk_max_size: 50
929
+
930
+ # The number of seconds to wait before trying to reconnect to Elasticsearch
931
+ # after a network error. After waiting backoff.init seconds, apm-server
932
+ # tries to reconnect. If the attempt fails, the backoff timer is increased
933
+ # exponentially up to backoff.max. After a successful connection, the backoff
934
+ # timer is reset. The default is 1s.
935
+ #backoff.init: 1s
936
+
937
+ # The maximum number of seconds to wait before attempting to connect to
938
+ # Elasticsearch after a network error. The default is 60s.
939
+ #backoff.max: 60s
940
+
941
+ # Configure HTTP request timeout before failing an request to Elasticsearch.
942
+ #timeout: 90
943
+
944
+ # Enable custom SSL settings. Set to false to ignore custom SSL settings for secure communication.
945
+ #ssl.enabled: true
946
+
947
+ # Optional SSL configuration options. SSL is off by default, change the `protocol` option if you want to enable `https`.
948
+ #
949
+ # Control the verification of Elasticsearch certificates. Valid values are:
950
+ # * full, which verifies that the provided certificate is signed by a trusted
951
+ # authority (CA) and also verifies that the server's hostname (or IP address)
952
+ # matches the names identified within the certificate.
953
+ # * strict, which verifies that the provided certificate is signed by a trusted
954
+ # authority (CA) and also verifies that the server's hostname (or IP address)
955
+ # matches the names identified within the certificate. If the Subject Alternative
956
+ # Name is empty, it returns an error.
957
+ # * certificate, which verifies that the provided certificate is signed by a
958
+ # trusted authority (CA), but does not perform any hostname verification.
959
+ # * none, which performs no verification of the server's certificate. This
960
+ # mode disables many of the security benefits of SSL/TLS and should only be used
961
+ # after very careful consideration. It is primarily intended as a temporary
962
+ # diagnostic mechanism when attempting to resolve TLS errors; its use in
963
+ # production environments is strongly discouraged.
964
+ #ssl.verification_mode: full
965
+
966
+ # List of supported/valid TLS versions. By default all TLS versions 1.0 up to
967
+ # 1.2 are enabled.
968
+ #ssl.supported_protocols: [TLSv1.0, TLSv1.1, TLSv1.2]
969
+
970
+ # List of root certificates for HTTPS server verifications.
971
+ #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
972
+
973
+ # Certificate for SSL client authentication.
974
+ #ssl.certificate: "/etc/pki/client/cert.pem"
975
+
976
+ # Client Certificate Key
977
+ #ssl.key: "/etc/pki/client/cert.key"
978
+
979
+ # Optional passphrase for decrypting the Certificate Key.
980
+ # It is recommended to use the provided keystore instead of entering the passphrase in plain text.
981
+ #ssl.key_passphrase: ''
982
+
983
+ # Configure cipher suites to be used for SSL connections.
984
+ #ssl.cipher_suites: []
985
+
986
+ # Configure curve types for ECDHE based cipher suites.
987
+ #ssl.curve_types: []
988
+
989
+ # Configure what types of renegotiation are supported. Valid options are
990
+ # never, once, and freely. Default is never.
991
+ #ssl.renegotiation: never
992
+
993
+ # Enable Kerberos support. Kerberos is automatically enabled if any Kerberos setting is set.
994
+ #kerberos.enabled: true
995
+
996
+ # Authentication type to use with Kerberos. Available options: keytab, password.
997
+ #kerberos.auth_type: password
998
+
999
+ # Path to the keytab file. It is used when auth_type is set to keytab.
1000
+ #kerberos.keytab: /etc/elastic.keytab
1001
+
1002
+ # Path to the Kerberos configuration.
1003
+ #kerberos.config_path: /etc/krb5.conf
1004
+
1005
+ # Name of the Kerberos user.
1006
+ #kerberos.username: elastic
1007
+
1008
+ # Password of the Kerberos user. It is used when auth_type is set to password.
1009
+ #kerberos.password: changeme
1010
+
1011
+ # Kerberos realm.
1012
+ #kerberos.realm: ELASTIC
1013
+
1014
+ #metrics.period: 10s
1015
+ #state.period: 1m