-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
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 |
These wire a bot into a Fleet control plane. When fleet_url is unset, no
fleet code runs at all - behaviour is exactly as without them. (The control
plane's own server settings are separate; see Fleet.)
| kwarg | env | type | default | meaning |
|---|---|---|---|---|
fleet_url |
ARGUS_FLEET_URL |
str | None |
opt in; register + heartbeat to this control plane |
fleet_token |
ARGUS_FLEET_TOKEN |
str | None |
shared (or ingest) token the bot presents |
fleet_group |
ARGUS_FLEET_GROUP |
str | default |
the region/fleet this process belongs to |
fleet_id |
ARGUS_FLEET_ID |
str | None |
stable identity; an auto-UUID is persisted if unset |
fleet_state_dir |
ARGUS_FLEET_STATE_DIR |
str | . |
where the auto-UUID identity is persisted |
fleet_scrape_target |
ARGUS_FLEET_SCRAPE_TARGET |
str | None |
advertise host:port for Prometheus http_sd
|
-
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.
Set one environment variable on the host/process running the bot:
ARGUS_DASHBOARD_AUTH_TOKEN=your-secretArgus reads it automatically and uses it to gate / and /api/* (the metrics
and health endpoints stay open). The dashboard is served by Argus in the same
process, so there is nothing else to configure or host. Viewers open
http://host:9191/?token=your-secret once; the token is remembered in the
browser. See the FAQ and Dashboard.
-
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.