Skip to main content

AFS_AETHER_CLIENT_METRICS_ADDR

Deep-dive reference for:

  • AFS_AETHER_CLIENT_METRICS_ADDR

Status

  • active

Audience

  • production/user

Type and Default

  • Type: socket address (ip:port, parsed as SocketAddr).
  • Default: 127.0.0.1:9600.
  • Scrape path: /metrics.

What It Does

Sets the bind address for the Aether client's Prometheus metrics HTTP endpoint.

When aether mount starts, the client metrics exporter is initialized with this address and serves metrics at:

  • http://<AFS_AETHER_CLIENT_METRICS_ADDR>/metrics

This is local client-process observability, not a remote server endpoint.

Input Surfaces

  • Env: AFS_AETHER_CLIENT_METRICS_ADDR=127.0.0.1:9600
  • Config file (aether.toml): metrics_addr = "127.0.0.1:9600"
  • CLI override: aether mount --metrics-addr 127.0.0.1:9600

Resolution and Override Order

  1. Default (127.0.0.1:9600)
  2. aether.toml (metrics_addr)
  3. Env (AFS_AETHER_CLIENT_METRICS_ADDR)
  4. CLI (--metrics-addr)

aether metrics show prints the resolved configured value.

Validation and Failure Behavior

  • Parse validation is strict (ip:port must parse as SocketAddr).
    • Invalid env/config/CLI value fails configuration load and startup.
  • Bind happens in the exporter thread during mount startup.
    • If bind fails (port in use, permission denied, etc.), Aether logs a warning and the metrics endpoint is unavailable for that process.

Reload Semantics

  • Config reload via SIGHUP does not hot-rebind metrics address.
  • If metrics_addr changes at reload time, Aether logs that restart is required.

Operational Notes

  • Default 127.0.0.1 keeps metrics loopback-only (safer for local dev and laptops).
  • Use 0.0.0.0:<port> only when you intentionally want remote scraping access.
  • If running multiple Aether mounts on one host, assign distinct ports per process to avoid bind conflicts.
  • No built-in auth/TLS is applied on this endpoint; protect network exposure accordingly.

Quick Examples

  • Default local scrape:
    • curl http://127.0.0.1:9600/metrics
  • Custom port via env:
    • AFS_AETHER_CLIENT_METRICS_ADDR=127.0.0.1:9700 aether mount ...
  • Per-invocation override:
    • aether mount --metrics-addr 127.0.0.1:9800 ...

Primary Implementation Sources

  • packages/aether/src/config/types/model_defaults.rs
  • packages/aether/src/config/types/file_config_loader.rs
  • packages/aether/src/config/types/apply_env.rs
  • packages/aether/src/config/types/config_resolution.rs
  • packages/aether/src/config/reload.rs
  • packages/aether/src/metrics/exporter.rs
  • packages/aether-cli/src/cli/args/cli_option_args.rs
  • packages/aether-cli/src/app/dispatch_and_runtime.rs
  • packages/aether-cli/src/app/command_handlers.rs