-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
AstorisTheBrave edited this page Jun 20, 2026
·
5 revisions
All configuration flows through one immutable ArgusConfig (invariant 6).
Precedence is constructor kwargs > ARGUS_* environment variables > defaults.
A kwarg left as None is treated as "not provided" and falls through to the
environment, then the default.
Argus(bot, port=9300, cluster_id="eu-1", dashboard_auth_token="secret")from argus import ArgusConfig
cfg = ArgusConfig.resolve(port=9300, environ={"ARGUS_NAMESPACE": "bot"})| kwarg | env | type | default | meaning |
|---|---|---|---|---|
port |
ARGUS_PORT |
int | 9191 |
server port (metrics + dashboard) |
host |
ARGUS_HOST |
str | 0.0.0.0 |
bind host |
metrics_path |
ARGUS_METRICS_PATH |
str | /metrics |
metrics endpoint (leading slash enforced) |
cluster_id |
ARGUS_CLUSTER_ID |
str |
None -> default
|
value of the cluster label |
namespace |
ARGUS_NAMESPACE |
str | discord |
metric name prefix (argus_* internals excluded) |
dashboard |
ARGUS_DASHBOARD |
bool | True |
serve the SPA |
dashboard_path |
ARGUS_DASHBOARD_PATH |
str | / |
dashboard mount (must differ from metrics_path) |
dashboard_interval |
ARGUS_DASHBOARD_INTERVAL |
int | 5 |
seconds between SSE snapshots |
dashboard_auth_token |
ARGUS_DASHBOARD_AUTH_TOKEN |
str | None |
bearer token gating dashboard + /api/*
|
grafana_url |
ARGUS_GRAFANA_URL |
str | None |
base URL for the Grafana section |
enable_per_guild |
ARGUS_ENABLE_PER_GUILD |
bool | False |
enable the analytical path |
clickhouse_dsn |
ARGUS_CLICKHOUSE_DSN |
str | None |
ClickHouse DSN for the sink + queries |
otlp_endpoint |
ARGUS_OTLP_ENDPOINT |
str | None |
OTLP collector endpoint |
-
bool env values:
1/true/yes/on-> True,0/false/no/off/""-> False (case-insensitive); anything else raisesValueError. -
int env values go through
int(). -
metrics_pathanddashboard_pathare normalised to a leading/. -
cluster_idresolves to the literal stringdefaultwhen unset; that is the value emitted on theclusterlabel.
-
ArgusConfigis a frozen, slotted dataclass; mutating it raises. -
resolve(environ=...)accepts an explicit mapping for testing/isolation. - The dashboard and analytics interact: the per-guild analytics API only mounts
when
enable_per_guildand aclickhouse_dsnare set, and it refuses to serve without adashboard_auth_token(fail-closed). See Dashboard.