ldap-sync: config, logging, and metrics modules

Three standalone modules with no internal imports — the foundation that all subsequent modules build on.

  • config.py: Config dataclass loaded from environment variables. Required fields abort at startup with a clear error. Parse failures are wrapped in ConfigError. Skip-list emails are normalized to lowercase at load time.

  • log.py: stdlib logging with a JSON formatter. Generates a sync_run_id UUID per invocation and stamps every log line with it for Logstash/Kibana correlation.

  • metrics.py: Prometheus registry (seats by role, drift by action, applied actions by result, errors by source, run duration, staleness timestamps, threshold_exceeded, source_healthy). Pushgateway delivery is best-effort — an outage logs a warning but does not fail the sync.

Tests for config (including parse-failure edge cases) and log.

Bug: T420691

Merge request reports

Loading