prometheus-community / prometheus-community/postgres_exporter
Non-superuser script improvement suggestions
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 835
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 10
Description
-
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;This^^^ was missing in my database. (Also
shared_preload_libraries = 'pg_stat_statements'was needed.) -
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.
-
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 commonpostgresql://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=5432The only drawback is that settings like
sslmode=verify-fullhave 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 thensslcert=...andsslkey=...can be set in the URI to get client authentication working.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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