Set up PostgreSQL for Monitoring
User Permissions
pg_stat_activity and pg_stat_statements.
Enable the pg_stat_statements Section
Validate the Setup
SELECT * FROM pg_stat_activity_allusers
SELECT * FROM pg_stat_statements_allusers
Gain operational intelligence by collecting, indexing, and visualizing data using a powerful on-premises engine for actionable insights.
Release NotesCollect, index, and visualize your data in the cloud for better operational intelligence.
Release NotesDiscover, share, and install apps and add-ons with the Splunk community on Splunkbase. Publish your own or add others to your Splunk platform instance.
Gain operational intelligence by collecting, indexing, and visualizing data using a powerful on-premises engine for actionable insights.
Release NotesStreamline your security operations with a SOAR system that integrates orchestration, playbook automation, and case management to enhance threat response.
Prevent disruptions and optimize operations when you monitor and analyze your IT service with predictive analytics and machine learning.
Release NotesCollect, index, and visualize your data in the cloud for better operational intelligence.
Release NotesGain end-to-end visibility, troubleshoot in real-time, and optimize performance across infrastructure, applications, and user interfaces.
Release NotesMonitor business application performance for cloud environments and IT infrastructure.
Release NotesMonitor business application performance for cloud environments and IT infrastructure.
Release NotesAn on-premises solution using AppDynamics On-Premises or Appdynamics Virtual Appliance (self hosted).
Release NotesBuild and deliver apps and integrations with SDKs, APIs and tools.
Access and share apps and add-ons with the Splunk community on Splunkbase. Publish your own apps, or download and install others on your Splunk platform instance.
Explore information on best practices, connect with community, or contact support.
pg_stat_activity and pg_stat_statements.
get_sa() function:
CREATE FUNCTION get_sa()
RETURNS SETOF pg_stat_activity LANGUAGE sql AS
$$ SELECT * FROM pg_catalog.pg_stat_activity; $$
VOLATILE
SECURITY DEFINER;
CREATE VIEW pg_stat_activity_allusers AS SELECT * FROM get_sa();
GRANT SELECT ON pg_stat_activity_allusers TO public;
get_querystats( ) function:
CREATE FUNCTION get_querystats()
RETURNS SETOF pg_stat_statements LANGUAGE sql AS
$$ SELECT * FROM pg_stat_statements; $$
VOLATILE
SECURITY DEFINER;
CREATE VIEW pg_stat_statements_allusers AS SELECT * FROM get_querystats();
GRANT SELECT ON pg_stat_statements_allusers TO public;
pg_stat_statements extension:
create extension pg_stat_statements
pg_stat_statements extension for the first time.SELECT * FROM pg_stat_activity_allusers
SELECT * FROM pg_stat_statements_allusers