Skip to main content
Version: 2.0.0

Configuration

In a production environment, your application server would typically be run containerized in a Docker or Kubernetes context. As such, environment variables would either be set by your Docker Compose files, or Kubernetes deployment manifests.

Modlet Environment Variables

This section covers DASH specific modlet environment variables. The Web Base environment variables still apply.

Environment VariableExample Value
DASH_URLhttp://dash.127.0.0.1.nip.io
TAG_URLhttp://tag.127.0.0.1.nip.io

DASH_URL

The URL to the DASH service

The base URL to call the DASH service endpoints. The modlet in the web server is responsible for making these calls, though you can use this base URL to make calls to the DASH service yourself as well.

TAG_URL

The URL to the TAG service

The base URL to call the TAG service endpoints. The DASH module integrates with the TAG service for widget tagging functionality, and this environment variable configures that connection.

Service Environment Variables

The DASH backend service is a Golang application. This section covers the specific environment variables used to configure its runtime behavior, database connection, and authentication settings.

Environment VariableExample Value
APP_PORT5001
LOG_LEVELdebug
SQL_HOSTdash.127.0.0.1.nip.io
SQL_PORT5432
SQL_USERpostgres
SQL_PASSWORDpostgres
SQL_PLUGIN_NAMEpostgresql
SQL_DATABASE_NAMEdash
SQL_SCHEMAdash
SQL_MAX_CONNS10
SQL_MAX_IDLE_CONNS5
SQL_MAX_CONN_LIFETIME300
IAM_URLhttp://iams-keycloak.127.0.0.1.nip.io/realms/aoh/protocol/openid-connect/userinfo
TAG_URLhttp://tag.127.0.0.1.nip.io

APP_PORT

The port on which the DASH backend service listens for requests

This variable defines the network port that the Golang HTTP server will bind to. API requests from the frontend should be directed to this port (often through an ingress or proxy).

LOG_LEVEL

Controls the verbosity of application logging

Sets the minimum level for log messages that will be outputted (e.g., debug, info, warn, error). debug is typically the most verbose level, useful for development.

SQL_HOST

The hostname or IP address of the database server
Specifies the location of the PostgreSQL database server that the DASH service needs to connect to.

SQL_PORT

The port on which the database server is listening
The network port for the PostgreSQL database connection. The default for PostgreSQL is typically 5432.

SQL_USER

The username for authenticating with the database

The database user account that the DASH service will use to establish a connection. Ensure this user has the necessary permissions on the target database and schema.

SQL_PASSWORD

The password for authenticating with the database

The password corresponding to the SQL_USER. It's recommended to manage this securely (e.g., using Kubernetes Secrets or Docker Swarm Secrets).

SQL_PLUGIN_NAME

Specifies the database driver or type to use

Indicates the type of SQL database being connected to, allowing the application to use the correct Go database driver. In this case, postgresql.

SQL_DATABASE_NAME

The name of the database to connect to

Specifies the target database name within the PostgreSQL server instance defined by SQL_HOST and SQL_PORT.

SQL_SCHEMA

The database schema to use for tables

Defines the PostgreSQL schema where the DASH application's tables reside or should be created. Using schemas helps namespace tables within a single database, especially in multi-tenant or multi-module scenarios. Ensure database migration tools (if used) are configured to use this schema.

SQL_MAX_CONNS

The maximum number of open connections to the database

Controls the size of the database connection pool. This limits the total number of connections (both in-use and idle) the service can open simultaneously. This value should be set carefully, considering the database server's max_connections limit and the number of service replicas.

SQL_MAX_IDLE_CONNS

The maximum number of connections kept idle in the pool

Specifies how many established database connections should be kept open and waiting in the pool, even when not actively used. This can improve performance by reducing the latency of acquiring a new connection. This value should be less than or equal to SQL_MAX_CONNS.

SQL_MAX_CONN_LIFETIME

The maximum time (in seconds) a connection can be reused

Sets the maximum duration for which a connection can be kept open and reused in the pool. After this time, the connection will be closed and potentially reopened when needed. This helps in gracefully handling database restarts, network changes, or load balancer configurations. The value 300 represents 5 minutes.

IAM_URL

The URL to the Identity Provider's userinfo endpoint for token validation

This URL is used by the DASH backend service to validate incoming access tokens (usually JWTs) received in API requests (typically in the Authorization header). By calling the OIDC userinfo endpoint with the received token, the backend can verify the token's validity and retrieve associated user information from the Identity Provider (Keycloak). Note that this URL is different from the IAM_URL used by the modlet; the service uses a specific endpoint for validation, while the modlet uses the discovery document URL.

TAG_URL

The URL to the Tag service's API

This URL is used by the DASH backend service to access the TAG service, which provides API's to allow us to associate dashboards with specific system-wide tags.