Configuration
The Data Quality Agent can be configured through its web interface or using environment variables. This page provides details on how to use environment variables for configuration.
TIP
Configuration is typically done during deployment. See the Deployment Guide for basic setup instructions.
Environment Variables
Environment variables are the primary way to configure the Data Quality Agent, especially in containerized deployments (Docker). They allow you to modify the application's behavior without changing the code or rebuilding the image.
General Guidance
When deploying with Docker or Docker Compose, you can set environment variables in your compose.yaml file:
services:
quality-agent:
image: ghcr.io/bbmri-cz/data-quality-agent:latest
environment:
- ENV_VAR_NAME=value
- ANOTHER_VAR=another_valueConfiguration Overrides
The Data Quality Agent supports a flexible mechanism to override any application setting using environment variables. This is particularly useful for automated deployments or when you need to change settings that are not exposed through specific environment variables.
How It Works
Any setting available in the application configuration can be overridden by setting an environment variable with the prefix APP_SETTING_. The override system works as follows:
- Prefix: Use
APP_SETTING_at the beginning of the environment variable name. - Normalization: The system normalizes both the environment variable name (after removing the prefix) and the internal setting names. Normalization involves:
- Converting to lowercase.
- Removing underscores (
_), dots (.), and dashes (-).
- Matching: If a normalized environment variable matches a normalized setting name, the setting's value is updated with the value from the environment variable.
Examples
Suppose you want to override the fhirUrl setting.
- Internal Setting Name:
fhirUrl - Allowed Environment Variable Formats:
APP_SETTING_FHIRURL=http://new-url.comAPP_SETTING_FHIR_URL=http://new-url.comAPP_SETTING_fhir_url=http://new-url.com
All of the above will successfully override the fhirUrl setting because they all normalize to fhirurl, which matches the normalized setting name.
The same logic applies to other settings like fhirUsername.
- Override
fhirUsername:APP_SETTING_FHIR_USERNAME=admin
Secure Your Config
Be careful when using environment variables for sensitive information like passwords. Ensure your compose.yaml file is secure or use Docker secrets/env files where appropriate.
Specific Agent Configuration
The following are standard environment variables recognized by the Data Quality Agent:
| Variable | Description | Default |
|---|---|---|
REPORTING_SERVER_URL | URL of the central reporting server to send data to. | (Optional) |
REPORTING_SERVER_NAME | Name of the reporting server for identification. | Central Data Quality Server of BBMRI |
OTEL_METRICS_EXPORT_ENABLED | Enables OTLP metrics export (true/false). | false |
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT | OTLP HTTP metrics endpoint URL. | https://grafana.bbmri-eric.eu/otel/v1/metrics |
OTEL_EXPORTER_OTLP_AUTHORIZATION | Optional Authorization header value (for example Bearer <token>) sent with OTLP metrics requests. | (Not set) |
You can also define additional labels with MANAGEMENT_METRICS_TAGS_<LABEL_NAME>. |
Additionally, as described above, you can override any internal setting using the APP_SETTING_ prefix. Common settings include:
fhirUrl: The URL of the FHIR server to connect to.fhirUsername: Username for FHIR server authentication.fhirPassword: Password for FHIR server authentication (Base64 encoded).
By using environment variables, you can fully automate the configuration of your Data Quality Agent during deployment.