Skip to main content

Environment variables

Every InfraSage service is configured with environment variables. Set them in your .env file (Docker Compose), a Kubernetes Secret, or your deployment's environment configuration.

Core / shared

VariableDefaultRequiredDescription
ENVIRONMENTdevelopmentNoDeployment environment: development, staging, production
LOG_LEVELinfoNoLog verbosity: debug, info, warn, error

ClickHouse

VariableDefaultRequiredDescription
CLICKHOUSE_ADDRlocalhost:9000YesClickHouse native protocol address
CLICKHOUSE_DBinfrasageYesDatabase name
CLICKHOUSE_USERinfrasageYesDatabase username
CLICKHOUSE_PASSWORDinfrasage-devYesDatabase password. Change in production.

Kafka / Redpanda

VariableDefaultRequiredDescription
REDPANDA_BROKERSlocalhost:9092YesComma-separated broker addresses
KAFKA_TOPICraw-telemetryNoTelemetry topic name
KAFKA_PARTITIONS3NoNumber of topic partitions

Ingestion Gateway

VariableDefaultRequiredDescription
GATEWAY_HTTP_PORT8080NoHTTP listener port
GATEWAY_METRICS_PORT9090NoPrometheus metrics port
INGESTION_WORKER_COUNT4NoParallel Kafka publish workers
BATCH_FIREHOSE_SIZE10000NoMax records per ClickHouse batch write
BATCH_FIREHOSE_TIMEOUT_MS5000NoMax wait time before flushing a batch (ms)
BATCH_EXEMPLAR_SIZE2000NoMax exemplar records per batch
BATCH_EXEMPLAR_TIMEOUT_MS10000NoMax wait time for exemplar batch flush (ms)

Telemetry Operator

VariableDefaultRequiredDescription
OPERATOR_HTTP_PORT8081NoHTTP listener port
OPERATOR_METRICS_PORT9091NoPrometheus metrics port
OPERATOR_WORKER_COUNT2NoNumber of Kafka consumer workers

AIops Engine

VariableDefaultRequiredDescription
AIOPS_HTTP_PORT8080NoHTTP listener port
AIOPS_METRICS_PORT9092NoPrometheus metrics port
ALERTMANAGER_WEBHOOK_PORT9093NoPort for Prometheus Alertmanager webhook
WATCHDOG_INTERVAL_SECONDS60NoHow often the anomaly watchdog polls ClickHouse
WATCHDOG_Z_SCORE_THRESHOLD3.0NoZ-score threshold for anomaly declaration. Lower = more sensitive.
WATCHDOG_RCA_COOLDOWN_MINUTES15NoMinimum minutes between RCA runs for the same service/metric
WATCHDOG_NAMED_METRIC_Z_THRESHOLD4.0NoModified-z threshold for the named-metric detector. Operation-class series (per-endpoint/span names) additionally require max(2×, 6.0) and ≥50% deviation from the baseline median. See Detection Quality Controls.
WATCHDOG_WARMUP_MINUTES8NoPost-restart warmup: the state-driven ML alert path stays quiet this long after boot (independent signals still alert). 0 disables.
ALERT_DEDUP_MAX_AGE_MINUTES60NoA firing alert older than this stops absorbing same-fingerprint fires as dedups; new fires get a new alert identity
VECTORIZER_INTERVAL_SECONDS60NoHow often to rebuild the HNSW vector index

Log anomaly detection (AIops Engine)

VariableDefaultDescription
LOG_GRACE_PERIOD_MINUTES60Minutes of template history required before novel-template alerts fire for a service. Prevents false-positive floods on new deployments.
LOG_BURST_ZSCORE_THRESHOLD10.0Multiplier above 24-hour average before an existing template is flagged as bursting. Lower values = more sensitive.
LOG_SEMANTIC_AUTO_DETECTtrueEnable heuristic detection of critical keywords and state transitions from raw log lines, without requiring application instrumentation.
LOG_SEMANTIC_ENRICHtrueEnable Claude Haiku enrichment of novel templates: classifies severity, writes a summary, and detects semantic duplicates. Requires ANTHROPIC_API_KEY.
LOG_SEMANTIC_SUPPRESS_THRESHOLD7Similarity score (0-10) returned by Claude above which a novel template is suppressed as a duplicate of a recent pattern.

Log rate limiting (Ingestion Gateway)

VariableDefaultDescription
LOG_MAX_RAW_PER_SECOND1000Per-service cap on raw log writes to infrasage_raw_firehose. Template clustering is unaffected. Set to 0 to disable.

Saturation detector (AIops Engine)

VariableDefaultDescription
SATURATION_DETECTOR_ENABLEDfalseLimit-aware exhaustion rules for bounded (percent/ratio) metrics: time-to-exhaustion, headroom breach, resident-high. See Detection Quality Controls.
SATURATION_TTE_CRIT_MINUTES60Projected exhaustion inside this horizon fires high
SATURATION_TTE_WARN_MINUTES360… inside this horizon fires medium
SATURATION_TTE_LOW_MINUTES1440Slow steady fills landing inside this horizon fire low (only once the series is ≥50% full)
SATURATION_ABS_FLOOR_FRAC0.92Absolute floor as a fraction of the limit
SATURATION_RESIDENT_FRAC0.85Baseline at/above this fraction = "normally lives high" (the database case)
SATURATION_MAX_SERIES_PER_TICK300Discovery cap per 2-minute tick

Reliability & rules (AIops Engine)

VariableDefaultDescription
DEADMAN_HEARTBEAT_URLExternal heartbeat endpoint pinged on every watchdog evaluation tick (healthchecks.io, a PagerDuty heartbeat integration, any URL that alerts on missing pings). This is how "InfraSage itself is down" reaches you. See Dead-man's switch. Unset = disabled.
ALERT_RULES_ENABLEDfalseEvaluate operator-defined alert rules once a minute.
ALERT_RULES_INTERVAL_SECONDS60Rule evaluation cadence
ALERT_RULES_MAX_RULES500Safety ceiling on rules evaluated per tick
NAMED_METRIC_RATIO_MIN_VOLUME20Minimum requests per window before an error ratio is scored at all. Stops "1 error in 3 requests = 33%" paging on quiet services.
OTEL_TEMPORALITY_NORMALIZEtrueConvert cumulative OTLP counters/histograms to per-interval deltas at ingest. Set false only to reproduce pre-v0.5.0 raw-counter behavior.

Paging (AIops Engine)

VariableDefaultDescription
PAGERDUTY_ROUTING_KEYPagerDuty Events API v2 integration key. Unset = the PagerDuty channel doesn't exist.
OPSGENIE_API_KEYOpsgenie Alerts API key. Unset = the Opsgenie channel doesn't exist.
PAGER_MIN_SEVERITYhighMinimum alert severity that pages (low|medium|high|critical). Lower tiers reach dashboards and chat channels, not the pager.

Code Intelligence (AIops Engine)

VariableDefaultDescription
GITHUB_CODEINTEL_TOKENRead-only GitHub token for indexing deploy diff packs. Unset = code context is dark; change events still record.

In-cluster runner (runs in your cluster)

VariableDefaultDescription
INFRASAGE_BASE_URLThe InfraSage control plane, e.g. https://api.infrasage.dev
INFRASAGE_API_TOKENTenant API token the runner enrolls and polls with
RUNNER_CLUSTERThis cluster's name; must match runbook steps' cluster selectors
RUNNER_NAMESPACESOptional comma-separated namespaces, informational for the target map

LLM / AI

VariableDefaultRequiredDescription
LLM_PROVIDERanthropicNoLLM backend. Currently only anthropic is supported.
ANTHROPIC_API_KEYYes (for RCA)Anthropic API key. Get one at console.anthropic.com.
ANTHROPIC_MODELclaude-opus-4-6NoClaude model to use for RCA analysis
BEDROCK_HAIKU_MODELNoFast model for the copilot's unescalated turns: a model or inference-profile id your account can invoke (e.g. us.anthropic.claude-haiku-4-5-20251001-v1:0). Unset routes all chat turns through the primary model.
tip

Without ANTHROPIC_API_KEY, anomaly detection and alerting still work. Only AI-generated RCA summaries are disabled.

Vector index (HNSW)

VariableDefaultRequiredDescription
VECTOR_HNSW_M16NoHNSW graph connectivity. Higher = better recall, more memory.
VECTOR_HNSW_EF_CONSTRUCTION200NoBuild-time search width. Higher = better index quality, slower build.
VECTOR_HNSW_EF_SEARCH50NoQuery-time search width. Higher = better recall, slower queries.

For large-scale deployments (500+ services), set VECTOR_HNSW_M=24 and VECTOR_HNSW_EF_CONSTRUCTION=400.

Integrations

Slack

VariableDefaultDescription
SLACK_WEBHOOK_URLIncoming webhook URL for alert notifications
SLACK_BOT_TOKENBot token for interactive approval flows (optional)
SLACK_CHANNEL#alertsDefault alert channel

PagerDuty

VariableDefaultDescription
PAGERDUTY_API_TOKENPagerDuty API token
PAGERDUTY_SERVICE_KEYIntegration key for incident creation

Jira

VariableDefaultDescription
JIRA_API_TOKENJira API token
JIRA_DOMAINYour Jira domain (e.g. mycompany.atlassian.net)
JIRA_PROJECT_KEYOPSProject key for auto-created tickets
JIRA_USERNAMEJira account email/username

Microsoft Teams

VariableDefaultDescription
TEAMS_WEBHOOK_URLTeams incoming webhook URL

AWS CloudWatch

VariableDefaultDescription
AWS_REGIONAWS region (e.g. us-east-1)
AWS_ACCESS_KEY_IDAWS access key (or use IAM role)
AWS_SECRET_ACCESS_KEYAWS secret key (or use IAM role)
CLOUDWATCH_POLL_INTERVAL_SECONDS60How often to poll CloudWatch metrics

Grafana

VariableDefaultDescription
GF_SECURITY_ADMIN_PASSWORDadminGrafana admin password. Change in production.
GF_SECURITY_ADMIN_USERadminGrafana admin username

Complete .env example

# Core
ENVIRONMENT=production
LOG_LEVEL=info

# ClickHouse
CLICKHOUSE_ADDR=clickhouse:9000
CLICKHOUSE_DB=infrasage
CLICKHOUSE_USER=infrasage
CLICKHOUSE_PASSWORD=CHANGE_ME_SECURE_PASSWORD

# Kafka
REDPANDA_BROKERS=redpanda:29092

# Ingestion tuning (medium scale: 50-500 services)
INGESTION_WORKER_COUNT=16
BATCH_FIREHOSE_SIZE=50000
BATCH_FIREHOSE_TIMEOUT_MS=5000
BATCH_EXEMPLAR_SIZE=10000

# AIops Engine
WATCHDOG_INTERVAL_SECONDS=60
WATCHDOG_Z_SCORE_THRESHOLD=3.0
WATCHDOG_RCA_COOLDOWN_MINUTES=15

# AI
LLM_PROVIDER=anthropic
ANTHROPIC_API_KEY=sk-ant-YOUR_KEY_HERE

# Integrations
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK
PAGERDUTY_API_TOKEN=your-pd-token
JIRA_API_TOKEN=your-jira-token
JIRA_DOMAIN=mycompany.atlassian.net
JIRA_USERNAME=[email protected]

# Grafana
GF_SECURITY_ADMIN_PASSWORD=CHANGE_ME_SECURE_PASSWORD