Coroot-pg-agent - an open-source Postgres exporter for Prometheus

From: Coroot via PostgreSQL Announce <announce-noreply(at)postgresql(dot)org>
To: PostgreSQL Announce <pgsql-announce(at)lists(dot)postgresql(dot)org>
Subject: Coroot-pg-agent - an open-source Postgres exporter for Prometheus
Date: 2022-07-22 17:55:29
Message-ID: 165851252992.271448.4623728043350271317@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-announce

The Coroot team is happy to announce [coroot-pg-agent](https://github.com/coroot/coroot-pg-agent) – an open-source (Apache 2.0)
Postgres exporter for Prometheus focusing on query performance statistics.

### Motivation:

At Coroot, we work on a product that detects the root cause of a service outage and provides our users with a list of possible fixes.

Initially, we planned to use metrics collected by existing open-source Prometheus exporters, such as [postgres_exporter](https://github.com/prometheus-community/postgres_exporter) (1.7k stars on Github).
Unfortunately, we realized that the metrics it collects are useless for identifying the most common performance issues, like:

* A CPU-intensive query is affecting other queries
* A server has reached its *max_connections* limit because most of the connections are stuck in the *idle in transaction* state
* An I/O-intensive query is affecting other queries
* A query is blocking other queries by holding an exclusive lock

Proposed changes to *postgres_exporter* would be too massive, so we decided to build another exporter.

### Features:
**Comprehensive query metrics**

The agent aggregates statistics from *pg_stat_statements* and *pg_stat_activity* to take into account not only finished queries but also those still executing.

**Locks monitoring**

It is not enough to gather the number of active locks from *pg_locks*.
What DBAs really want to know is which query is blocking other queries.
The collected metrics can provide the answer to that.

**Query normalization and obfuscation**

In addition to query normalization, which Postgres does, the agent obfuscates all queries so that no sensitive
data gets into the metrics labels.

### Links

* [GitHub repository](https://github.com/coroot/coroot-pg-agent)
* [The full announcement on our blog](https://coroot.com/blog/pg-agent)
* [Metrics description](https://coroot.com/docs/metrics/pg-agent)

Browse pgsql-announce by date

  From Date Subject
Next Message pgAdmin Development Team via PostgreSQL Announce 2022-07-23 03:49:18 pgAdmin User Survey
Previous Message OtterTune, Inc. via PostgreSQL Announce 2022-07-22 17:53:58 Human vs. OtterTune AI PostgreSQL tuning contest. $10,000 cash prize