Skip to content

Hot-reload log level (add log.level to config and the hot whitelist) #415

Description

@taitelee

Problem

Changing the log level still requires a full restart. Log level is currently set only by the WH_LOG_LEVEL environment variable (cmd/wavehouse/main.go) — it has no config.yaml key, and environment values are frozen at process start, so the hot-reload mechanism from #414 can never touch it.

Split from #48, whose SIGHUP / admin-endpoint mechanism landed in #414 with dedupe.id_field and dedupe.require_id as the first hot fields.

Proposed Solution

  • Add a log.level key to config.yaml, keeping WH_LOG_LEVEL as its environment override (which pins it, per the documented env caveat in Configuration § Hot Reload).
  • Classify log.level in hotFields (internal/config/reload.go) — the drift-guard test TestReloadDiff_CoversEveryConfigField enforces the classification.
  • Apply via an OnReload hook calling slog.LevelVar.Set: the logger already reads its level through a LevelVar (cmd/wavehouse/main.go), which is safe to change at runtime.

Additional Context

Sample-rate hot reload (also mentioned in #48) can follow the same pattern later; per-table dedupe overrides are tracked separately in #222.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/configConfig file, config knobs, hot-reloadarea/observabilityMetrics, logs, traces, health, profilingenhancementNew feature or request

    Type

    No type

    Projects

    Status
    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions