Elastic Logs and Monitoring Integration

ElasticSearch Logging

In order to enable Aidbox logging to ElasticSearch, you need to define AIDBOX_ES_URL environment variable:
1
AIDBOX_ES_URL = <url>
2
# Required
3
# Elasticsearch url
4
​
5
AIDBOX_ES_AUTH = <user>:<password>
6
# Optional
7
# Basic auth credentials if there is protection
8
​
9
AIDBOX_ES_BATCH_SIZE = <uint>
10
# Optional. Default value is 200
11
# Size of elastic search post batch
12
​
13
AIDBOX_ES_BATCH_TIMEOUT = <millis>
14
# Optional. Default value is 3600000 (1 hour)
15
# Timeout when to post batch if there not enough
16
# messages to post a full batch.
17
​
18
AIDBOX_LOGS = <fallback logs file path>
19
# Optional.
20
# Path to file where to write logs if error while
21
# posting to elastic has occurred
22
# If not provided, aidbox will just print logs to stdout
23
# in case of an errors.
24
​
25
AIDBOX_ES_INDEX_PAT = <format string>
26
# Optional. Default value is 'aidbox-logs'-yyyy-MM-dd
27
# Π‘ustom index name format string.
28
# By changing the date precision you can control
29
# how often new indixes should be created. Example:
30
# 'aidbox-logs'-yyyy-MM will create new index monthly
31
# 'aidbox-logs'-yyyy-MM-W will create new index weekly
Copied!
AIDBOX_ES_INDEX_PAT formatter syntax documentation is here​
Note. If elastic was down and some logs were accumulated in AIDBOX_LOGS, Aidbox doesn't resend those logs to elastic

Elastic APM Monitoring

You need to define ELASTIC_APM_SERVER_URLS environment variable to enable monitoring with Elastic APM:
1
ELASTIC_APM_SERVER_URLS = <url>
2
# Required. APM server url
3
ELASTIC_APM_SERVICE_NAME = <name>
4
# Optional. Default value is "Aidbox"
Copied!
The full list of configuration options can be found here.
​
Last modified 2mo ago