|
| 1 | +# Configuration |
| 2 | +The basic configs are set through the `configs.yaml` file. This file is read when the application starts and all the settings will be loaded. |
| 3 | + |
| 4 | +THe monitors path is also defined in the `configs.yaml` file. By default, it's set to the `sample_monitors` folder, but it can be changed to another folder if desired. The `configs.yaml` file also have other configurations that can be adjusted. |
| 5 | + |
| 6 | +> [!IMPORTANT] |
| 7 | +> Check the documentation for the plugins that are being used to see if they have environment variables of their own. |
| 8 | +
|
| 9 | +# Environment variables |
| 10 | +## `CONFIGS_FILE` |
| 11 | +The application will try to load the configs file through the path defined in the `CONFIGS_FILE` environment variable. If this variable is not defined, it'll look for the file in the root directory of the application. |
| 12 | + |
| 13 | +Example: |
| 14 | +``` |
| 15 | +CONFIGS_FILE=configs.yaml |
| 16 | +``` |
| 17 | + |
| 18 | +## `SENTINELA_PLUGINS` |
| 19 | +To enable a plugin, set the environment variable `SENTINELA_PLUGINS` with the name of the desired plugin. When enabling multiple plugins, separate them with commas. |
| 20 | +- To enable the Slack plugin, the environment variable should be set as `SENTINELA_PLUGINS=slack`. |
| 21 | +- To enable multiple plugins, the environment variable should be set as `SENTINELA_PLUGINS=plugin_1,plugin_2`. |
| 22 | + |
| 23 | +## `DATABASE_APPLICATION` |
| 24 | +Specifies the database DSN that will be used to connect to the application database. This database will not be accessible through the databases interface for the monitors. |
| 25 | + |
| 26 | +Example: |
| 27 | +``` |
| 28 | +DATABASE_APPLICATION=postgresql+asyncpg://postgres:postgres@postgres:5432/postgres |
| 29 | +``` |
| 30 | + |
| 31 | +## `DATABASE_{NAME}` |
| 32 | +Every variable that starts with `DATABASE`, besides the application database, will have a connection pool instantiated, that can be used in the monitors to query data from them. The variable must contain the DSN to be used to connect to the database. |
| 33 | + |
| 34 | +For an environment variable `DATABASE_ABC`, the connection pool will be available with the name `abc`, that will be able to be used in the `query` function. |
| 35 | + |
| 36 | +Example: |
| 37 | +``` |
| 38 | +DATABASE_ABC=postgres://postgres:postgres@postgres:5432/postgres |
| 39 | +``` |
| 40 | + |
| 41 | +## `AWS_ENDPOINT_URL` |
| 42 | +`AWS_ENDPOINT_URL` specifies the AWS endpoint to be used for local testing, without the need of a real SQS queue. When using the `motoserver` container as an AWS mock, it should be `http://motoserver:5000`. Don't set this environment variable when using a real SQS queue. |
| 43 | + |
| 44 | +Example: |
| 45 | +``` |
| 46 | +AWS_ENDPOINT_URL=http://motoserver:5000 |
| 47 | +``` |
| 48 | + |
| 49 | +## `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_SESSION_TOKEN` |
| 50 | +`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_SESSION_TOKEN` specifies the service credentials to access the AWS SQS queue. |
| 51 | + |
| 52 | +If the credentials does not include the session token, the `AWS_SESSION_TOKEN` environment variable should not be set. |
| 53 | + |
| 54 | +Example: |
| 55 | +``` |
| 56 | +AWS_ACCESS_KEY_ID=ACCESSKEYID |
| 57 | +AWS_SECRET_ACCESS_KEY=SECRETACCESSKEY |
| 58 | +AWS_SESSION=SESSIONTOKEN |
| 59 | +``` |
| 60 | + |
| 61 | +or, when not using a session token, |
| 62 | + |
| 63 | +``` |
| 64 | +AWS_ACCESS_KEY_ID=ACCESSKEYID |
| 65 | +AWS_SECRET_ACCESS_KEY=SECRETACCESSKEY |
| 66 | +``` |
0 commit comments