{"id":18346958,"url":"https://github.com/coroot/coroot-pg-agent","last_synced_at":"2025-04-04T23:07:43.283Z","repository":{"id":44522299,"uuid":"408475553","full_name":"coroot/coroot-pg-agent","owner":"coroot","description":"A Prometheus exporter for Postgres focusing on query performance statistics","archived":false,"fork":false,"pushed_at":"2025-03-24T13:41:27.000Z","size":61,"stargazers_count":142,"open_issues_count":6,"forks_count":18,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T22:12:18.223Z","etag":null,"topics":["monitoring","postgresql","postgresql-metrics","postgresql-monitoring","prometheus","prometheus-exporter"],"latest_commit_sha":null,"homepage":"https://docs.coroot.com/metrics/cluster-agent#postgres","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coroot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-20T14:27:58.000Z","updated_at":"2025-03-24T13:41:31.000Z","dependencies_parsed_at":"2025-03-28T22:12:17.234Z","dependency_job_id":"7ade849f-c764-45f9-84e8-84aeb7e9a115","html_url":"https://github.com/coroot/coroot-pg-agent","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coroot%2Fcoroot-pg-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coroot%2Fcoroot-pg-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coroot%2Fcoroot-pg-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coroot%2Fcoroot-pg-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coroot","download_url":"https://codeload.github.com/coroot/coroot-pg-agent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261603,"owners_count":20910108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["monitoring","postgresql","postgresql-metrics","postgresql-monitoring","prometheus","prometheus-exporter"],"created_at":"2024-11-05T21:12:49.630Z","updated_at":"2025-04-04T23:07:43.265Z","avatar_url":"https://github.com/coroot.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coroot-pg-agent\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/coroot/coroot-pg-agent)](https://goreportcard.com/report/github.com/coroot/coroot-pg-agent)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\nCoroot-pg-agent is an open-source prometheus exporter that gathers metrics from Postgres servers.\n\n## Philosophy\n\nMetrics should help you identify issues with your Postgres servers.  \nThis agent collects metrics that can help you answer questions such as:\n  * What queries are consuming the most IOPS or CPU time?\n  * Which transactions are hanging in the *Idle in transaction* state?\n  * Which query is holding the lock?\n\nThis provides visibility into Postgres performance without the need to navigate through system views manually.\n  \n## Features\n\n### Comprehensive query metrics\n\nThe agent aggregates data from *pg_stat_statements* and *pg_stat_activity* to provide accurate\nmetrics about queries, whether they are completed or still running.\n\n\u003cimg src=\"https://coroot.com/static/img/blog/pg_stat_statements_visibility.svg\" width=\"800\" /\u003e\n\u003cimg src=\"https://coroot.com/static/img/blog/pg_stat_activity_visibility.svg\" width=\"800\" /\u003e\n\nLearn more about query metrics in the blog post \"[Missing metrics required to gain visibility into Postgres performance](https://coroot.com/blog/pg-missing-metrics)\"\n\n\n### Locks monitoring\n\nIt is not enough to gather the number of active locks from *pg_locks*. \nWhat engineers really want to know is which query is blocking other queries.\nThe [pg_lock_awaiting_queries](https://docs.coroot.com/metrics/cluster-agent#pg_lock_awaiting_queries) metric can provide the answer to that.\n\n### Query normalization and obfuscation\n\nIn addition to query normalization, which Postgres does, the agent obfuscates all queries so that no sensitive data gets into the metrics labels.\n\n## Quick start\n\n### Create database role\n\n    create role \u003cUSER\u003e with login password '\u003cPASSWORD\u003e';\n    grant pg_monitor to \u003cUSER\u003e;\n\n### Enable pg_stat_statements\n\n    create extension pg_stat_statements;\n    select * from pg_stat_statements; -- to check\n\n### Run\n\n    docker run --detach --name coroot-pg-agent \\\n    --env DSN=\"postgresql://\u003cUSER\u003e:\u003cPASSWORD\u003e@\u003cHOST\u003e:5432/postgres?connect_timeout=1\u0026statement_timeout=30000\" \\\n    ghcr.io/coroot/coroot-pg-agent\n\n## Metrics\n\nThe collected metrics are described [here](https://docs.coroot.com/metrics/cluster-agent#postgres).\n\n## License\n\nCoroot-pg-agent is licensed under the [Apache License, Version 2.0](https://github.com/coroot/coroot-node-agent/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoroot%2Fcoroot-pg-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoroot%2Fcoroot-pg-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoroot%2Fcoroot-pg-agent/lists"}