I am currently monitoring a dockerized service with metricbeat using autodiscover, which works fine so far.
The problem: when I deploy a newer version of the service, metricbeat starts an additional monitoring cycle which I don't know how to prevent.
- I have a metricbeat.yml file with autodiscover and period set to 20 s
- for the service I want to monitor, I have a docker-compose.yml file
- I start the service using docker-compose up
- works fine: I receive logs every 20 s (let's say at 0:05, 0:25, 0:45)
- then I change the docker-compose.yml (specifically the image)
- I run docker-compose up again
- docker recreates the image
- from now on I receive additional logs every 20 s (at 0:10, 0:30, 0:50), which means in total: at 0:05, 0:10; 0:25, 0:30, 0:45, 0:50
- even stopping and starting the docker image does not change that
- the only fix is to stop and restart metricbeat
Can I fix that somehow?