prometheus-community / prometheus-community/postgres_exporter

Only run certain queries on some databases

Open
#443 31 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
3.6k
Forks
835
Avg merge
2d 4h
Merged PRs (30d)
10

Description

I was wondering if it is possible to run some queries on some of the databases?
The postgres exporter auto discovers the databases, and runs all queries on all databases. Which currently logs errors in both the exporter and postgres logs. How can I restrict certain queries to only some/one of the databases (for example only run pg_stat_statements on the "main" database)? Or is that a new feature?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing PostgreSQL database auto-discovery and the exporter path that runs configured queries. Review how query configuration is represented and how database errors are reported. Done means queries such as pg_stat_statements can be restricted to selected databases without producing errors on others, with coverage for the new behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql, prometheus
Domain
databases, observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.