Skip to content

Add-on Environment Variables

When you attach an add-on, Watasu injects connection details into your app as config vars. This page lists them per add-on. Read these like any other config var (watasu config --app my-app), but don’t overwrite them — the add-on resets them on its next reconcile.

VariablePurpose
DATABASE_URLFull Postgres connection string
PGHOSTHostname
PGPORTPort
PGDATABASEDatabase name
PGUSERUsername
PGPASSWORDPassword

DATABASE_URL is what most ORMs and frameworks read. The discrete PG* variables are for tools (psql, pg_dump) and code that builds connections programmatically.

VariablePurpose
REDIS_URLRedis-protocol connection URL
REDIS_HOSTHostname
REDIS_PORTPort
REDIS_PASSWORDPassword

The REDIS_* names are intentional — Valkey speaks the Redis protocol, and existing libraries that look for REDIS_URL work unchanged.

VariablePurpose
CLICKHOUSE_URLFull connection URL
CLICKHOUSE_HOSTHostname
CLICKHOUSE_PORTNative protocol port
CLICKHOUSE_DATABASEDatabase name
CLICKHOUSE_USERUsername
CLICKHOUSE_PASSWORDPassword

Redpanda exports both REDPANDA_* and KAFKA_* names so Kafka client libraries find what they expect:

VariablePurpose
REDPANDA_BROKERS, KAFKA_BROKERS, KAFKA_BOOTSTRAP_SERVERSBroker address list
REDPANDA_USERNAME, KAFKA_USERNAMESASL username
REDPANDA_PASSWORD, KAFKA_PASSWORDSASL password

Object storage exports a wide set of S3-compatible variables so that whichever name your SDK looks for, it finds:

VariablePurpose
S3_BUCKET, AWS_S3_BUCKETBucket name
S3_ACCESS_KEY_ID, AWS_ACCESS_KEY_IDCredential ID
S3_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEYCredential secret
S3_ENDPOINT, AWS_ENDPOINT_URL, AWS_ENDPOINT_URL_S3Endpoint (this isn’t AWS — it’s the Watasu-managed S3-compatible endpoint)
S3_REGION, AWS_REGION, AWS_DEFAULT_REGION, AWS_S3_REGIONRegion label expected by AWS SDKs
S3_FORCE_PATH_STYLEWhether the SDK should use path-style addressing
S3_PUBLIC_BUCKET_URL, AWS_S3_URLConvenience URLs combining bucket + endpoint

Most SDKs (boto3, aws-sdk-*, rclone, minio, etc.) pick these up automatically.

VariablePurpose
METRICS_PORTPort your app should serve Prometheus metrics on (default 9464)
OTEL_EXPORTER_OTLP_METRICS_ENDPOINTOTLP metrics push endpoint
OTEL_EXPORTER_OTLP_METRICS_PROTOCOLhttp/protobuf
PROMETHEUS_REMOTE_WRITE_URLPrometheus remote-write endpoint

Serve your metrics endpoint on $METRICS_PORT and Watasu scrapes it — see Metrics.

VariablePurpose
OTEL_EXPORTER_OTLP_ENDPOINTOTLP ingest endpoint
OTEL_EXPORTER_OTLP_TRACES_ENDPOINTThe same endpoint with the /v1/traces path
OTEL_EXPORTER_OTLP_PROTOCOLhttp/protobuf

Standard OpenTelemetry SDKs read these automatically.

The logs and Grafana add-ons collect from the platform side and don’t inject any env vars into your app.

When you attach an add-on with --as <ALIAS>, every variable that add-on would normally export gets prefixed with ALIAS_:

Terminal window
watasu addons:attach reporting-db --app my-app --as REPORTING

Now your app sees both:

  • DATABASE_URL — the original primary
  • REPORTING_DATABASE_URL — the new alias

This is how you give one app multiple databases of the same kind, and it’s how PostgreSQL CLI commands target a specific database (watasu pg:psql REPORTING_DATABASE_URL, or just watasu pg:psql reporting).