You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update messages when the monitoring user doesn't have a proper setup (#699)
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.
c.Logger.PrintInfo("Warning: You are not connecting as superuser. Please setup"+
96
-
" the monitoring helper functions (https://pganalyze.com/docs/install/aiven/01_create_monitoring_user)"+
97
-
" or connect as superuser, to get replication statistics.")
95
+
c.Logger.PrintInfo("Warning: Monitoring user may have insufficient permissions to retrieve replication statistics.\n"+
96
+
"You are not connecting as a user with the pg_monitor role or a superuser."+
97
+
" Please make sure the monitoring user used by the collector has been granted the pg_monitor role or is a superuser.")
98
+
ifc.Config.SystemType=="aiven" {
99
+
c.Logger.PrintInfo("For Aiven, you can also set up the monitoring helper functions (https://pganalyze.com/docs/install/aiven/01_create_monitoring_user).")
c.SelfTest.MarkCollectionAspectWarning(state.CollectionAspectPgStatStatements, "monitoring user may have insufficient permissions to capture all queries")
171
-
c.SelfTest.HintCollectionAspect(state.CollectionAspectPgStatStatements, "Please set up"+
172
-
" the monitoring helper functions (%s)"+
173
-
" or connect as superuser to get query statistics for all roles.", selftest.URLPrinter.Sprint("https://pganalyze.com/docs/install/aiven/03_create_pg_stat_statements_helpers"))
174
-
c.Logger.PrintInfo("Warning: You are not connecting as superuser. Please setup"+
175
-
" the monitoring helper functions (https://pganalyze.com/docs/install/aiven/03_create_pg_stat_statements_helpers)"+
176
-
" or connect as superuser, to get query statistics for all roles.")
171
+
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.")
172
+
c.Logger.PrintInfo("Warning: Monitoring user may have insufficient permissions to capture all queries.\n"+
173
+
"You are not connecting as a superuser."+
174
+
" 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.")
c.SelfTest.HintCollectionAspect(state.CollectionAspectPgStatStatements, "For aiven, you can also set up the monitoring helper functions (%s).", selftest.URLPrinter.Sprint(docsLink))
178
+
c.Logger.PrintInfo("For Aiven, you can also set up the monitoring helper functions (%s).", docsLink)
0 commit comments