A PostgreSQL Foglight agent displays an incorrect number of functions in Databases dashboard Functions column.
Users may observe one of the following:
The pg_stat_user_functions view used by the PostgreSQL agent only displays statistics for user-defined functions that have been executed since the last statistics reset or server restart. If a function has not been called, it will not appear in this view.
While the view is intended to track user-defined functions, any function that is executed and not marked as internal-only may appear — including system functions — if:
track_functions setting is set to all.For example:
shobj_description() from the pg_catalog schema may appear if it was called directly.pg_stat_statements() may appear if a wrapper function was created in the public schema or if the extension was installed there.SELECT statement, for example:SELECT public.my_function(); -- Replace with your actual function name and argumentsSELECT * FROM pg_stat_user_functions;
The function should now appear with its execution statistics. Confirm that track_functions = all is set in postgresql.confSELECT pg_reload_conf(); is not sufficient.pg_stat_user_functions if they are explicitly executed and tracked.track_functions = all is enabled.