One of our Elixir projects is handling background stuff (not a web app). I added Cowboy 1.1.2 and Plug 1.0 to provide a web-endpoint for prometheus to store some metrics.
I added Plug to my root supervisor like
children = [
Plug.Adapters.Cowboy.child_spec(:http, ProjectRoot.Metrics, [], [port: 9100]),
....
]
It worked nicely but after a couple of hours (handling one request every minute) it stopped accepting connections. The metrics endpoint is doing 3 sql queries counting stuff and returning the result. The whole app is deployed with docker/kubernetes.
I don’t understand why plug died (did it?). Isn’t the supervisor supposed to restart it?
I am not sure how to approach that issue, never had such an issue. Help or ideas are highly appreciated