3. Configuring #
Environment variables, database and cache.
The principle #
Observa follows the “12-factor” approach: everything is set through environment variables (.env with Compose, values.yaml with Helm). An environment variable locks the matching field in the interface.
Main variables #
| Variable | Default | Role |
|---|---|---|
ROOT_URL | http://localhost:3000 | public URL (links, SSO) |
DATABASE_URL | postgresql+psycopg://observa:observa@db:5432/observa | API database |
ADMIN_USER / ADMIN_PASSWORD | admin / to set | initial administrator |
LOCAL_AUTH_ENABLED | True | local accounts |
PASSWORD_MIN_LENGTH | 10 | minimum length |
DEFAULT_ROLE | Viewer | role of new accounts |
SESSION_HOURS / COOKIE_SECURE | 8 / False | session length, HTTPS cookie |
DB_AUTO_CREATE | true | creates databases (CREATEDB right) |
QUERY_WORKERS | 16 | parallel queries of the query service |
ALERTING_TICK_SECONDS | 5 | evaluator tick |
PROVISIONING_DIR | /etc/observa/provisioning | provisioned sources and dashboards |
OTEL_ENABLED | False | Observa self-instrumentation |
The query cache #
| Variable | Default | Role |
|---|---|---|
QUERY_CACHE_ENABLED | true | enables the cache |
QUERY_CACHE_TTL | 30 | time to live (s) |
QUERY_CACHE_MAX_ENTRIES | 2000 | in-memory entries (LRU) |
QUERY_CACHE_MAX_ITEM_KB | 2048 | maximum response size |
QUERY_CACHE_REDIS_URL | empty | cache shared across replicas (Helm: query.cache.redisUrl) |
The hit rate is tracked with observa_query_cache_total{result="hit|miss"}; an administrator clears the cache with DELETE /api/datasources-cache or a single source's cache with DELETE /api/datasources/{uid}/cache.
Best practice : With several query replicas, plug in Redis: otherwise each replica has its own cache and the hit rate drops. A dashboard opened by 50 people should trigger only one query per panel to Prometheus.4. Operating #
Upgrades, self-observability and troubleshooting.
Upgrading #
docker compose pull && docker compose up -d --no-build
docker compose ps
docker compose logs -f api alertingBack up PostgreSQL before an upgrade. On Kubernetes: helm upgrade observa observa/observa -n observa -f values.yaml.
Observing Observa #
Python services instrument themselves with OpenTelemetry (OTEL_ENABLED=true, OTLP endpoint) and log in JSON (logging.format: json). The cache exposes its metrics; also watch the PostgreSQL database and source latency.
Troubleshooting #
| Symptom | Lead |
|---|---|
| The UI does not answer on port 3000 | docker compose ps, then docker compose logs ui api |
| The API restarts in a loop | wrong DATABASE_URL, or CREATEDB right missing with DB_AUTO_CREATE=true |
| Logged out right after logging in | COOKIE_SECURE=true without HTTPS |
| Notification links point to localhost | ROOT_URL not set |
| A field is greyed out in the UI | it is enforced by an environment variable |
| Source secrets unreadable after migration | SECRET_KEY differs from the original |
Sources #
My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
Installing and configuring CrowdSec: packages, Docker, acquisition
Install CrowdSec with packages or Docker, understand its files, declare the logs to read, enroll ...
Installing Grafana Loki (Docker Compose, binary and Helm)
Install and validate Grafana Loki: minimal configuration, Docker Compose with Grafana and Alloy, ...
Installing Grafana Tempo (Docker Compose, binary and Helm)
Install Grafana Tempo: the tempo.yaml configuration, Docker Compose with Grafana and Prometheus, ...
Securing Observa: authentication, roles and multi-tenancy
Configure access to Observa: local accounts, LDAP and Active Directory, OIDC, SAML, auth proxy, r...
Deploying and operating Pyroscope on Kubernetes
Install Pyroscope with Helm, collect cluster profiles with Alloy (annotations and eBPF), size, se...
Operating Grafana: internal metrics, health, logs, performance and backups
Operating Grafana: /metrics and /api/health endpoints, logs, slow queries, dashboard performance,...
Dashboards, Explore and Drilldown in Observa
Build Grafana v2 dashboards in Observa: visualizations, variables, transformations, import from g...
Discovering Observa: the self-hosted observability console
What Observa is, what it adds to Grafana OSS, its five-service architecture, its parity with Graf...
Connecting sources and collecting telemetry for Observa
Declare data sources in Observa (UI or provisioning), handle authentication, PKI, mTLS and proxy,...