Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration Reference

This page documents runtime-relevant configuration fields and defaults.

Topic Wire Format

  • Topic wire subjects always use . as separator.
  • Per-schema topic.separator is no longer used.
  • Token values are percent-encoded for reserved chars (., *, >, %) before writing to backend subjects.

See Topic Encoding for rules and examples.

application

FieldTypeDefaultNotes
hoststringnoneBind address.
portu16noneBind port.
base_urlstringhttp://localhostUsed in generated CloudEvent source links.
static_files_pathstring/app/staticStatic asset root for homepage assets.

logging

FieldTypeDefaultNotes
levelstringimplementation defaultExample: info, debug, warn, error.
formatstringimplementation defaultKept for compatibility; output is OTel-aligned JSON.

auth

Authentication is optional. When disabled (default), all API endpoints are publicly accessible only if schemas do not define stream auth rules. Startup fails if global auth is disabled while a schema sets auth.required=true or non-empty auth.read_roles/auth.write_roles.

When enabled:

  • Admin endpoints always require a valid JWT and an admin role.
  • Stream endpoints (notify, watch, replay) enforce authentication only when the target schema has auth.required: true.
  • Schema endpoints (/api/v1/schema) are always public.
  • In trusted_proxy mode, Aviso validates Authorization: Bearer <jwt> locally with jwt_secret.
FieldTypeDefaultNotes
enabledboolfalseSet to true to enable authentication.
mode"direct"|"trusted_proxy""direct"direct: forward credentials to auth-o-tron. trusted_proxy: validate forwarded JWT locally.
auth_o_tron_urlstring""auth-o-tron base URL. Required when enabled=true and mode=direct.
jwt_secretstring""Shared HMAC secret for JWT validation. Required when enabled=true. Not exposed via /api/v1/schema endpoints and redacted when auth settings are serialized or logged.
admin_rolesmap<string, string[]>{}Realm-scoped roles for admin endpoints (/api/v1/admin/*). Must contain at least one realm with non-empty roles when enabled=true.
timeout_msu645000Timeout for auth-o-tron requests (milliseconds). Must be > 0.

Per-stream auth (notification_schema.<event_type>.auth)

FieldTypeDefaultNotes
requiredboolMust be explicitly set whenever an auth block is present. When true, the stream requires authentication.
read_rolesmap<string, string[]>Realm-scoped roles for read access (watch/replay). When omitted, any authenticated user can read. Use ["*"] as the role list to grant realm-wide access.
write_rolesmap<string, string[]>Realm-scoped roles for write access (notify). When omitted, only users matching global admin_roles can write. Use ["*"] as the role list to grant realm-wide access.

See Authentication for detailed setup, client usage, and error responses.

metrics

Optional Prometheus metrics endpoint. When enabled, a separate HTTP server serves /metrics on an internal port for scraping by Prometheus/ServiceMonitor. This keeps metrics isolated from the public API.

FieldTypeDefaultNotes
enabledboolfalseEnable the metrics endpoint.
hoststring"127.0.0.1"Bind address for the metrics server. Defaults to loopback to avoid public exposure.
portu16noneRequired when enabled=true. Must differ from application.port.

Exposed metrics:

MetricTypeLabelsDescription
aviso_notifications_totalcounterevent_type, statusTotal notification requests.
aviso_sse_connections_activegaugeendpoint, event_typeCurrently active SSE connections.
aviso_sse_connections_totalcounterendpoint, event_typeTotal SSE connections opened.
aviso_sse_unique_users_activegaugeendpointDistinct users with active SSE connections.
aviso_auth_requests_totalcountermode, outcomeAuthentication attempts.

Process-level metrics (CPU, memory, open FDs) are automatically collected on Linux.

notification_backend

FieldTypeDefaultNotes
kindstringnonejetstream or in_memory.
in_memoryobjectoptionalUsed when kind = in_memory.
jetstreamobjectoptionalUsed when kind = jetstream.

notification_backend.in_memory

FieldTypeDefaultNotes
max_history_per_topicusize1Retained messages per topic in memory.
max_topicsusize10000Max tracked topics before LRU-style eviction.
enable_metricsboolfalseEnables extra internal metrics logs.

See InMemory Backend for operational caveats.

notification_backend.jetstream

FieldTypeDefaultRuntime usage summary
nats_urlstringnats://localhost:4222NATS connection URL.
tokenstring?NoneToken auth; NATS_TOKEN env fallback.
timeout_secondsu64?30NATS connection timeout for each startup connect attempt (> 0).
retry_attemptsu32?3Startup connect attempts before backend init fails (> 0).
max_messagesi64?NoneStream message cap.
max_bytesi64?NoneStream size cap in bytes.
retention_timestring?NoneDefault stream max age (s, m, h, d, w; for example 30d).
storage_typestring?filefile or memory (parsed as typed enum at config load).
replicasusize?NoneStream replicas.
retention_policystring?limitslimits/interest/workqueue (parsed as typed enum at config load).
discard_policystring?oldold/new (parsed as typed enum at config load).
enable_auto_reconnectbool?trueEnables/disables NATS client reconnect behavior.
max_reconnect_attemptsu32?5Mapped to NATS max_reconnects (0 => unlimited).
reconnect_delay_msu64?2000Reconnect delay and startup connect retry backoff (> 0).
publish_retry_attemptsu32?5Retry attempts for transient publish channel closed failures (> 0).
publish_retry_base_delay_msu64?150Base backoff in milliseconds for publish retries (> 0).

See JetStream Backend for detailed behavior.

notification_schema.<event_type>.payload

Schema-level payload contract for notify requests.

FieldTypeExampleNotes
requiredbooltrueWhen true, /notification rejects requests without payload.

Behavior details and edge cases are documented in Payload Contract.

notification_schema.<event_type>.storage_policy

Optional per-schema storage settings validated at startup against selected backend capabilities.

FieldTypeExampleNotes
retention_timestring7d, 12h, 30mDuration literal (s, m, h, d, w).
max_messagesinteger100000Must be > 0.
max_sizestring512Mi, 2GSize literal (K, Ki, M, Mi, G, Gi, T, Ti).
allow_duplicatesbooltrueBackend support is capability-gated.
compressionbooltrueBackend support is capability-gated.

Field behavior:

  • retention_time overrides backend-level retention for the schema stream.
  • max_messages overrides backend-level message cap for the schema stream.
  • max_size overrides backend-level byte cap for the schema stream.
  • allow_duplicates = false maps to one message per subject (latest kept); true removes this cap.
  • compression = true enables stream compression when backend supports it.

Startup behavior:

  • Invalid retention_time/max_size format fails startup.
  • Unsupported fields for selected backend fail startup.
  • Validation happens before backend initialization.
  • With in_memory, all storage_policy fields are currently unsupported (startup fails if provided).

Runtime application behavior:

  • storage_policy is applied on stream create and reconciled for existing JetStream streams when those streams are accessed by Aviso.
  • Aviso-managed stream subject binding is also reconciled to the expected <base>.> pattern.
  • Mutable fields (retention/limits/compression/duplicates/replicas) are updated when drift is detected.
  • Recreate stream(s) only when you need historical data physically rewritten with new settings.

Example:

notification_backend:
  kind: jetstream
  jetstream:
    nats_url: "nats://localhost:4222"
    publish_retry_attempts: 5
    publish_retry_base_delay_ms: 150

notification_schema:
  dissemination:
    topic:
      base: "diss"
      key_order: ["destination", "target", "class", "expver", "domain", "date", "time", "stream", "step"]
    storage_policy:
      retention_time: "7d"
      max_messages: 2000000
      max_size: "10Gi"
      allow_duplicates: true
      compression: true

watch_endpoint

FieldTypeDefaultNotes
sse_heartbeat_interval_secu6430SSE heartbeat period.
connection_max_duration_secu643600Maximum live watch duration.
replay_batch_sizeusize100Historical fetch batch size.
max_historical_notificationsusize10000Replay cap for historical delivery.
replay_batch_delay_msu64100Delay between historical replay batches.
concurrent_notification_processingusize15Live stream CloudEvent conversion concurrency.

Custom config file path

Set AVISOSERVER_CONFIG_FILE to use a specific config file instead of the default search cascade:

AVISOSERVER_CONFIG_FILE=/path/to/config.yaml cargo run

When set, only this file is loaded as a file source (startup fails if it does not exist). The default locations (./configuration/config.yaml, /etc/aviso_server/config.yaml, $HOME/.aviso_server/config.yaml) are skipped. AVISOSERVER_* field-level overrides still apply on top.

Environment override examples

AVISOSERVER_APPLICATION__HOST=0.0.0.0
AVISOSERVER_APPLICATION__PORT=8000
AVISOSERVER_NOTIFICATION_BACKEND__KIND=jetstream
AVISOSERVER_NOTIFICATION_BACKEND__JETSTREAM__NATS_URL=nats://localhost:4222
AVISOSERVER_NOTIFICATION_BACKEND__JETSTREAM__TOKEN=secret
AVISOSERVER_WATCH_ENDPOINT__REPLAY_BATCH_SIZE=200
AVISOSERVER_AUTH__ENABLED=true
AVISOSERVER_AUTH__JWT_SECRET=secret
AVISOSERVER_METRICS__ENABLED=true
AVISOSERVER_METRICS__PORT=9090