Giter VIP home page Giter VIP logo

coroot-pg-agent's Introduction

Coroot-pg-agent

Go Report Card License

Coroot-pg-agent is an open-source prometheus exporter that gathers metrics from Postgres servers.

Philosophy

Metrics should help you identify issues with your Postgres servers.
This agent collects metrics that can help you answer questions such as:

  • What queries are consuming the most IOPS or CPU time?
  • Which transactions are hanging in the Idle in transaction state?
  • Which query is holding the lock?

This provides visibility into Postgres performance without the need to navigate through system views manually.

Features

Comprehensive query metrics

The agent aggregates data from pg_stat_statements and pg_stat_activity to provide accurate metrics about queries, whether they are completed or still running.

Learn more about query metrics in the blog post "Missing metrics required to gain visibility into Postgres performance"

Locks monitoring

It is not enough to gather the number of active locks from pg_locks. What engineers really want to know is which query is blocking other queries. The pg_lock_awaiting_queries metric 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.

Quick start

Create database role

create role <USER> with login password '<PASSWORD>';
grant pg_monitor to <USER>;

Enable pg_stat_statements

create extension pg_stat_statements;
select * from pg_stat_statements; -- to check

Run

docker run --detach --name coroot-pg-agent \
--env DSN="postgresql://<USER>:<PASSWORD>@<HOST>:5432/postgres?connect_timeout=1&statement_timeout=30000" \
ghcr.io/coroot/coroot-pg-agent

Metrics

The collected metrics are described here.

License

Coroot-pg-agent is licensed under the Apache License, Version 2.0.

coroot-pg-agent's People

Contributors

def avatar apetruhin avatar franckpachot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.