nic-6443 commented on PR #14034:
URL: https://github.com/apache/apisix/pull/14034#issuecomment-6186704569

   Thanks for the review!
   
   The worker reduction case is handled in 6d33fdb. Whenever collection starts, 
which includes the privileged agent coming back after the reload that changes 
`worker_processes`, the privileged agent deletes every process series whose 
`worker-<id>` is >= `ngx.worker.count()`, and runs a second pass one interval 
later in case an exiting worker was still writing. 
`t/cli/test_prometheus_reload.sh` covers it: start with 2 workers, reload with 
1, and assert that no `worker-1` series is left.
   
   Leaving `expire` out of these was on purpose. The label set is bounded by 
the number of processes, and every process overwrites its own series every 
`refresh_interval`, so the only thing expiry could clean up is series of 
workers that no longer exist, and those are now removed explicitly. Expiry 
would also hide exactly the signal these metrics exist for: if a process runs 
out of timers, its reporting stops, and with `expire` its last near-limit 
values would disappear right when you want to alert on them.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to