4

For some reason I can't get persistent storage to work with alertmanager. This is my compose:

  alertmanager:
    image: 'my/alertmanager/prod:latest'
    restart: always
    volumes:
      - alertmanager-data:/alertmanager-data
    command:
      - '--config.file=/alertmanager/alertmanager-config.yml'
      - '--storage.path=/alertmanager-data'
    ports:
      - 9103:9093

  volumes:
    alertmanager-data:
      external: true

I have created the volume and everything seems to initialise correctly. But after entering the machine /alertmanager-data doesn't seem to contain any DB or files. And creating new silences on the alertmanager never persist.

somerandomusername
  • 1,993
  • 4
  • 23
  • 55

2 Answers2

2
Moved from comment for visibility

It turns out that it actually does work, but it takes a while for it to write memory to storage. I don't remember how often it is stored but it takes some time.

Nifle
  • 11,745
  • 10
  • 75
  • 100
  • Any insight on what the time persistence time is? Is it configurable? In the alertmanager flags i found `--alerts.gc-interval=30m` , maybe changing this value persists alerts faster – makefu Aug 19 '22 at 12:39
1

Looking at this change https://github.com/prometheus/alertmanager/pull/2849/files It looks like it used to be persisted to disk every 15 minutes, and now that is configurable with the parameter --data.maintenance-interval since version 0.25

Gustavo
  • 195
  • 2
  • 11