Open Gruummy opened 11 months ago
Hello! 👋 As the README explains you can get default metrics with a one-liner (ok, two with imports):
from prometheus_flask_exporter import PrometheusMetrics
...
metrics = PrometheusMetrics(app)
For a quick test, I'd perhaps just add it in pkg/docker/run_pgadmin.py
to get default metrics on the default /metrics
endpoint:
import builtins
from prometheus_flask_exporter import PrometheusMetrics
builtins.SERVER_MODE = True
from pgAdmin4 import app
metrics = PrometheusMetrics(app)
That should be it (based on a quick look).
Hi to the round,
i am no developer .. i directly need so say. I am starting the evolve to a DevOps engeneer and need to extend things to make it better.
Currently we use pgadmin4 .. which is a flask .. gunicorn docker container we run.
https://github.com/pgadmin-org/pgadmin4
It uses this command to start gunicorn https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/docker/entrypoint.sh#L95
And it uses this for gunicorn config https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/docker/gunicorn_config.py
And the startup happens where https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/docker/run_pgadmin.py
pgadmin4 app itself is located here: https://github.com/pgadmin-org/pgadmin4/blob/master/web/pgAdmin4.py
Is there some possibility existing with some "smart" and small "tweaks" to extend / wrap the application to be able to add the metrics of flask without big rework of the main code of the application ?
Any help / hint how to do it with application would be REALLY great.