我刚在我的 Postgres 实例上设置了 sqlcommenter。我在我的 ORM 上使用了一个钩子来附加元数据,然后使用 pg_stat_statements 获取统计信息并将其导出到 Prometheus。非常酷。