So when supervisor restarts elli elli_startup event is generated and prometheus_<metric>:new/1,2 would be called now. The 'problem' is prometheus_<metric>:new/1,2 really expects non-existent metric! For restarts-friendly use-cases there is prometheus_<metric>:declare/1,2 which is basically the same as prometheus_<metric>:new/1,2 except it is ok if metric already exists.
Hey!
So when supervisor restarts elli
elli_startup
event is generated andprometheus_<metric>:new/1,2
would be called now. The 'problem' isprometheus_<metric>:new/1,2
really expects non-existent metric! For restarts-friendly use-cases there isprometheus_<metric>:declare/1,2
which is basically the same asprometheus_<metric>:new/1,2
except it is ok if metric already exists.