Skip to content

#258 Document running as non-superuser on PostgreSQL versions 10 or newer. #590

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Jan 26, 2022
Merged

Conversation

juris-greitans
Copy link
Contributor

@juris-greitans juris-greitans commented Nov 17, 2021

Starting from version 10, PostgreSQL includes a built-in role pg_monitor meant for use by monitoring tools. This PR adds documentation about granting the role when running postgres_exporter as non-superuser. Fixes #258.

…ewer.

Signed-off-by: juris.greitans <juris.greitans@visma.com>
README.md Outdated
data with the non-superuser. Only creating the views will leave out the most
important bits of data.
To be able to collect metrics from `pg_stat*` views as non-superuser in PostgreSQL
server versions >= 10 you can grant pg_monitor built-in role to the user. If
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"you can grant the pg_monitor built-in role" I'd say, maybe also markup pg_monitor with backticks, like pg_stat* before.
Also, I guess technically the pg_read_all_stats role would suffice, so maybe mention both

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. PostgreSQL documentation says that pg_monitor is a member of pg_read_all_stats, that's why I went with pg_monitor.
Also, I added a link to pre-defined role documentation.

…about pre-defined roles.

Signed-off-by: juris.greitans <juris.greitans@visma.com>
@runhardr
Copy link

Why is merging still blocked on this?

@mbanck
Copy link
Contributor

mbanck commented Jan 25, 2022

I guess my vote doesn't count for a lot

@sysadmind sysadmind merged commit c0ca2fd into prometheus-community:master Jan 26, 2022
ritbl pushed a commit to heniek/postgres_exporter that referenced this pull request Mar 19, 2023
percona#258 Document running as non-superuser on PostgreSQL versions 10 or newer.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggest using pg_monitor role for PostgreSQL >= 10
4 participants