Skip to main content

Configuration

Business Engine is configured using environment variables.

Timescale database

Timescale (PostgreSQL) database is used to store Business Engine database and required for start-up. We selected Timescale database because it can be used to store Grafana configuration for High Availability setup.

########################### Database Configuration #############################################
##
## Database (Timescale) Host
##
DATABASE_HOST=timescale

##
## Database (Timescale) Port
##
DATABASE_PORT=5432

##
## Database (Timescale) Name if different from postgres
##
DATABASE_DB=postgres

##
## Database (Timescale) User
##
DATABASE_USERNAME=postgres

##
## Database (Timescale) Password
##
DATABASE_PASSWORD=postgres

Grafana

Grafana connection details are required for start-up. Business Engine supports Grafana OSS, Enterprise and Cloud instances.

##
## Grafana HTTP API
##
GRAFANA_URL=http://grafana:3000

##
## Service Account
## - Viewer permission is required to access dashboards
## - Editor permission is required to access dashboards and add Annotations
##
GRAFANA_TOKEN=SERVICE-ACCOUNT-TOKEN

Health Check

Depends on the configuration, Grafana might take longer time to respond to the requests from Business Engine. This scenario may lead to the failure of the startup health check. Simply put, if the Business Engine can't verify that Grafana is responding, it shuts itself down.

To avoid this false health check failure, we added timing parameters that determine how long the Business Engine waits before checking Grafana's active status using Grafana token and URL to connect to.

By default, the waiting is 2 seconds.

##
## Grafana Health-Check timeout, ms
## Waiting for Grafana availability for (Timeout * Number of Retries / 1000 ) seconds
##
GRAFANA_HEALTH_CHECK_TIMEOUT=1000

##
## Grafana Health-Check number of retries
##
GRAFANA_HEALTH_CHECK_RETRY=2

Data Source Request

Data Source requests timeout can be increased for slow requests. By default, the waiting is 10 seconds.

##
## Data Source timeout, ms
##
GRAFANA_REQUEST_TIMEOUT=10000