prometheus-community / prometheus-community/postgres_exporter

Non-superuser script improvement suggestions

Open
#512 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

  1. CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
    

    This^^^ was missing in my database. (Also shared_preload_libraries = 'pg_stat_statements' was needed.)

  2. All function names (i.e., not only view names) can be (and perhaps should be) schema-qualified, so that they are in the newly created schema and not in the default one.

  3. I like to use UNIX domain sockets for all local PostgreSQL connections. This is feasible, but the hostname must be a directory, not localhost, which doesn’t play well with the most common postgresql:// URI format. Fortunately one can pass everything as parameter key words (after three slashes). For example, when my PostgreSQL socket is in /run/postgresql/.s.PGSQL.5432, then I could use:

    postgresql:///?dbname=postgres&user=postgres_exporter&password=CENSORED&host=/run/postgresql/&port=5432
    

    The only drawback is that settings like sslmode=verify-full have no effect with UNIX domain sockets, so one won’t get an automated test whether certificates and CRLs are up-to-date and working. This works with TCP only. If encrypted connections need to be checked this way, one would use TCP on [::1] (instead of a UNIX socket) and then sslcert=... and sslkey=... can be set in the URI to get client authentication working.

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

The issue names no files or tests. Start by locating the scripts that create the PostgreSQL extension, views, and functions, then inspect how PostgreSQL connection parameters are handled. Compare the current behavior with the requested non-superuser, schema-qualified, and UNIX-socket use cases before defining what completion requires.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.