Skip to content

Support safe config reload via SIGHUP and /-/reload #1390

Open

Description

@ArthurSens

Proposal

Support reloading the postgres_exporter configuration without restarting the process, following Prometheus' lifecycle behavior:

  • SIGHUP triggers a configuration reload.
  • POST /-/reload triggers the same reload path.

Use case

Operators need to rotate auth_modules and other reloadable file-backed configuration without restarting the exporter. This is particularly useful with Kubernetes Secrets, external secret managers, and multi-target /probe deployments.

Several old pull requests attempted parts of this:

Expected behavior

  1. Parse and validate the candidate configuration before applying it.
  2. Apply a successful reload atomically.
  3. Preserve the last-known-good configuration after a failed reload.
  4. Return a non-2xx response from /-/reload when reload fails, including a useful error message.
  5. Handle concurrent or repeated reload requests safely.
  6. Update the existing config reload success/timestamp metrics consistently for both HTTP and SIGHUP reloads.
  7. Document the signal, endpoint, and failure semantics.
  8. Add tests for successful reload, invalid configuration, signal handling, and concurrent requests.

Activity

  1. Chaithanyanallamothu commented on Oct 7, 2026

    @Chaithanyanallamothu

    Hi @ArthurSens , I had a look through the current config handling and I’d like to work on this. ReloadAuthConfig already provides a good base for keeping the existing config when a reload fails, so I’ll build the 'SIGHUP' and 'POST /-/reload' paths around that. I’ll also cover the concurrent reload and failure cases in tests and update the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions