OpenTelemetry can be used to easily integrate basic metrics from the PostgreSQL statistics collector using the PostgreSQL receiver. However, this solution provides only insight into the overall health of your PostgreSQL instance. In many cases you have certain slow running queries in your application causing a problem and you might want to find out which ones they are or why they’re slow. PostgreSQL’s pg_stat_statements extension and its view are a popular source for such information.
For a recent project of mine, I was looking into observability around databases. I focused on open source tooling with PostgreSQL and OpenTelemetry. While there are various options for monitoring databases, most do not focus on integration with OpenTelemetry or otherwise combining PostgreSQL telemetry with application specific telemetry. However, for anyone who prefers to see all information regarding their application at a single glance, having a separate observability tool for the database is not good enough.