rucio / containers

Containers for Rucio
Apache License 2.0
9 stars 55 forks source link

Servers & Dev: expose prometheus metrics #180

Closed rcarpa closed 2 years ago

rcarpa commented 2 years ago

https://github.com/rucio/rucio/pull/5158 Introduced the possibility to collect metrics from servers.

This commit allows to expose those metrics. I use a separate apache port for servers containers, but expose them on the /metrics path in the dev container.

ericvaandering commented 2 years ago

So this is exposing prometheus metrics through the normal flask/server port rather than through a dedicated port provided by the prometheus library? I guess the point is that you can retrieve the metrics from anywhere, not just from within a cluster where the port is exposed?

rcarpa commented 2 years ago

I pushed a small update because I realized setEnv doesn't work for mod_wsgi, but it doesn't change anything related to your question.

For server containers it exposes the metrics on a separate port. Which will only be reachable as you configure the pod. However, it is still done via apache. This is somehow necessary, because the server containers don't run any "daemon-like" python process to expose metrics .

rcarpa commented 2 years ago

If you wish, it can be exposed on the same port. For that you'll just have to add "metrics" to the rucio.cfg 'api/endpoints' configuration option. However, this can already be done without requiring this PR. This PR is all about using a separate port