-
Notifications
You must be signed in to change notification settings - Fork 67
Update messages when the monitoring user doesn't have a proper setup #699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…oper setup Previously, when the monitoring user is neither superuser nor has pg_monitor role, we were showing error messages saying that please use a superuser or create a helper function. While this is true for Aiven, especially for "creating a helper function" guidance, it's not true for other cases and when the user hits this with other providers, the error message is confusing and make it not clear which actions to take. Update the messaging to make it clear the next action for these cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add a separate troubleshooting section for this to our docs instead?
Uhmm, I think there is not much to troubleshoot honestly. The messaging here is clear, the monitoring user is neither a superuser or a user with the pg_monitor role - so the fix is to use a superuser or grant pg_monitor to the monitoring user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On reviewing the actual changes, you're absolutely right.
input/postgres/replication.go
Outdated
"You are not connecting as a user with the pg_monitor role or a superuser." + | ||
" Please make sure the monitoring user used by the collector has been granted the pg_monitor role or is a superuser.") | ||
if c.Config.SystemType == "aiven" { | ||
c.Logger.PrintInfo("For aiven, you can also set up the monitoring helper functions (https://pganalyze.com/docs/install/aiven/01_create_monitoring_user).") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set up
Nice catch 😄
input/postgres/replication.go
Outdated
"You are not connecting as a user with the pg_monitor role or a superuser." + | ||
" Please make sure the monitoring user used by the collector has been granted the pg_monitor role or is a superuser.") | ||
if c.Config.SystemType == "aiven" { | ||
c.Logger.PrintInfo("For aiven, you can also set up the monitoring helper functions (https://pganalyze.com/docs/install/aiven/01_create_monitoring_user).") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also going to say that their branding uses an uppercase A, but after a quick fact-check of that impression, their branding uses both versions liberally, so this is fine 🤷♂️.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, well let's use Aiven, thanks for pointing out!
input/postgres/statements.go
Outdated
c.SelfTest.HintCollectionAspect(state.CollectionAspectPgStatStatements, "Please make sure the monitoring user used by the collector has been granted the pg_monitor role or is a superuser.") | ||
c.Logger.PrintInfo("Warning: Monitoring user may have insufficient permissions to capture all queries.\n" + | ||
"You are not connecting as a superuser." + | ||
" Please make sure the monitoring user used by the collector has been granted the pg_monitor role or is a superuser, to get query statistics for all roles.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" Please make sure the monitoring user used by the collector has been granted the pg_monitor role or is a superuser, to get query statistics for all roles.") | |
" Please make sure the monitoring user used by the collector has been granted the pg_monitor role or is a superuser in order to get query statistics for all roles.") |
This is kind of a long sentence, and I think adding "in order" makes it easier to interpret. "To" by itself has many possible meanings, making this harder to parse.
Previously, when the monitoring user is neither superuser nor has pg_monitor role, we were showing error messages saying that please use a superuser or create a helper function. While this is true for Aiven, especially for "creating a helper function" guidance, it's not true for other cases and when the user hits this with other providers, the error message is confusing and make it not clear which actions to take. Update the messaging to make it clear the next action for these cases.
This part, to link the Aiven doc was updated in #532 and I did say "it's okay to use Aiven link", but we had some report from the other provider's customer who was confused by this error, so I think it's better to avoid showing the link.
https://github.com/pganalyze/collector/pull/532/files#r1566602511