pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

OpenTelemetry Support

Open pythonweb2 opened this issue 2 months ago • 3 comments

Describe the solution you'd like

Support for OpenTelemetry, probably both in logging and metrics in the response/requests via the open source otel packages.

Describe alternatives you've considered

File logging is available, but I don't think any metrics or tracing is currently available.

Additional context

None

pythonweb2 avatar Oct 29 '25 18:10 pythonweb2

@pythonweb2,

Can you please share some examples?

akshay-joshi avatar Oct 31 '25 11:10 akshay-joshi

@akshay-joshi sure.

There are a few options to support opentelemetry, first is Logfire, although this is a paid service, but it does allow you to send opentelemetry metrics to other providers. It mostly shines with FastAPI, but it also supports other services.

The better option for this project is probably just to use the packages maintained by opentelemetry themselves.

For pgadmin, I think logging and request metrics via flask would be good, and they can be instrumented with these packages:

  • https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/flask/flask.html
  • https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/logging/logging.html

pythonweb2 avatar Oct 31 '25 18:10 pythonweb2

Could also instrument the flask app in the gunicorn config file: https://logfire.pydantic.dev/docs/integrations/web-frameworks/gunicorn/

pythonweb2 avatar Oct 31 '25 18:10 pythonweb2