We need a "data source" plugin for Grafana analytics visualization tool (https://grafana.com) for the connection with Postgresql database tables (not database metrics but general time series metrics)
Development can start from some similar plugins, available from the Grafana site or other open source projects on Github.
Features and performances for the data extraction must be aligned with the ones available for other data source plugins and database such as InfluxDB, Elasticsearch, etc.
Basic development guide can be find here:
Quote of Grafana plugin developers guide:
Knowledge of Postgresql API is required.