Skip to main content
Version: 25.01.01

Metrics

PostgreSQL is a powerful, open-source relational database system. Monitoring its metrics is vital to ensure performance, stability, and reliability. The following is a list of essential PostgreSQL metrics in PDS. Understanding these metrics will help administrators optimize performance, troubleshoot issues, and ensure the PostgreSQL database runs smoothly.

Access metrics for PostgreSQL

To fetch the above listed metrics for PostgreSQL deployments in PDS, you can connect to the metrics exporter using the following details:

Metrics port

For PostgreSQL deployment, the data service metrics are accessible on port 5555.

Access metrics

In a Kubernetes-based PDS deployment, the Postgres exporter is exposed either internally or externally. Here are a few common ways to access it:

Internal cluster access

  1. Look for the pod name that runs your PostgreSQL instance or the exporter sidecar container:

    kubectl get pods -n <your-namespace> 
  2. Map your local machine’s port 5555 to the pod’s port 5555:

    kubectl port-forward -n <your-namespace> <pod-name> 5555:5555
  3. Open a browser or use curl to access http://localhost:5555/metrics. You should see a text-based Prometheus metrics output.

External NodePort or LoadBalancer

  1. Look for a Service (for example, <release-name>-postgres-exporter) with either NodePort or LoadBalancer type:

    kubectl get svc -n <your-namespace>
    • If NodePort, you will see a port in the PORT(S) column (for example, 5555:32001/TCP).
    • If LoadBalancer, check the EXTERNAL-IP column for your load balancer endpoint.
  2. Access NodePort http://<node-ip>:<nodeport>/metrics or the LoadBalancer http://<loadbalancer-ip>:5555/metrics to view metrics.

Verify metrics

You can verify the metrics manually using curl:

curl http://<host>:5555/metrics

If you are using:

  • Prometheus UI: In the Prometheus expression browser, search for any metric beginning with pg_ (refer to the above metrics table) to verify data is being scraped successfully.
  • Grafana or other dashboards: If you have Grafana or a similar tool connected to Prometheus, open your dashboard to check that PostgreSQL metrics are populating.

PostgreSQL Metrics

Metric NameMetric Type
pg_database_connection_limitgauge
pg_database_size_bytesgauge
pg_exporter_last_scrape_duration_secondsgauge
pg_exporter_last_scrape_errorgauge
pg_exporter_scrapes_totalcounter
pg_locks_countgauge
pg_replication_is_replicagauge
pg_replication_lag_secondsgauge
pg_roles_connection_limitgauge
pg_scrape_collector_duration_secondsgauge
pg_scrape_collector_successgauge
pg_settings_allow_in_place_tablespacesgauge
pg_settings_allow_system_table_modsgauge
pg_settings_archive_timeout_secondsgauge
pg_settings_array_nullsgauge
pg_settings_authentication_timeout_secondsgauge
pg_settings_autovacuumgauge
pg_settings_autovacuum_analyze_scale_factorgauge
pg_settings_autovacuum_analyze_thresholdgauge
pg_settings_autovacuum_freeze_max_agegauge
pg_settings_autovacuum_max_workersgauge
pg_settings_autovacuum_multixact_freeze_max_agegauge
pg_settings_autovacuum_naptime_secondsgauge
pg_settings_autovacuum_vacuum_cost_delay_secondsgauge
pg_settings_autovacuum_vacuum_cost_limitgauge
pg_settings_autovacuum_vacuum_insert_scale_factorgauge
pg_settings_autovacuum_vacuum_insert_thresholdgauge
pg_settings_autovacuum_vacuum_scale_factorgauge
pg_settings_autovacuum_vacuum_thresholdgauge
pg_settings_autovacuum_work_mem_bytesgauge
pg_settings_backend_flush_after_bytesgauge
pg_settings_bgwriter_delay_secondsgauge
pg_settings_bgwriter_flush_after_bytesgauge
pg_settings_bgwriter_lru_maxpagesgauge
pg_settings_bgwriter_lru_multipliergauge
pg_settings_block_sizegauge
pg_settings_bonjourgauge
pg_settings_check_function_bodiesgauge
pg_settings_checkpoint_completion_targetgauge
pg_settings_checkpoint_flush_after_bytesgauge
pg_settings_checkpoint_timeout_secondsgauge
pg_settings_checkpoint_warning_secondsgauge
pg_settings_client_connection_check_interval_secondsgauge
pg_settings_commit_delaygauge
pg_settings_commit_siblingsgauge
pg_settings_cpu_index_tuple_costgauge
pg_settings_cpu_operator_costgauge
pg_settings_cpu_tuple_costgauge
pg_settings_cursor_tuple_fractiongauge
pg_settings_data_checksumsgauge
pg_settings_data_directory_modegauge
pg_settings_data_sync_retrygauge
pg_settings_db_user_namespacegauge
pg_settings_deadlock_timeout_secondsgauge
pg_settings_debug_assertionsgauge
pg_settings_debug_discard_cachesgauge
pg_settings_debug_pretty_printgauge
pg_settings_debug_print_parsegauge
pg_settings_debug_print_plangauge
pg_settings_debug_print_rewrittengauge
pg_settings_default_statistics_targetgauge
pg_settings_default_transaction_deferrablegauge
pg_settings_default_transaction_read_onlygauge
pg_settings_effective_cache_size_bytesgauge
pg_settings_effective_io_concurrencygauge
pg_settings_enable_async_appendgauge
pg_settings_enable_bitmapscangauge
pg_settings_enable_gathermergegauge
pg_settings_enable_hashagggauge
pg_settings_enable_hashjoingauge
pg_settings_enable_incremental_sortgauge
pg_settings_enable_indexonlyscangauge
pg_settings_enable_indexscangauge
pg_settings_enable_materialgauge
pg_settings_enable_memoizegauge
pg_settings_enable_mergejoingauge
pg_settings_enable_nestloopgauge
pg_settings_enable_parallel_appendgauge
pg_settings_enable_parallel_hashgauge
pg_settings_enable_partition_pruninggauge
pg_settings_enable_partitionwise_aggregategauge
pg_settings_enable_partitionwise_joingauge
pg_settings_enable_seqscangauge
pg_settings_enable_sortgauge
pg_settings_enable_tidscangauge
pg_settings_escape_string_warninggauge
pg_settings_exit_on_errorgauge
pg_settings_extra_float_digitsgauge
pg_settings_from_collapse_limitgauge
pg_settings_fsyncgauge
pg_settings_full_page_writesgauge
pg_settings_geqogauge
pg_settings_geqo_effortgauge
pg_settings_geqo_generationsgauge
pg_settings_geqo_pool_sizegauge
pg_settings_geqo_seedgauge
pg_settings_geqo_selection_biasgauge
pg_settings_geqo_thresholdgauge
pg_settings_gin_fuzzy_search_limitgauge
pg_settings_gin_pending_list_limit_bytesgauge
pg_settings_hash_mem_multipliergauge
pg_settings_hot_standbygauge
pg_settings_hot_standby_feedbackgauge
pg_settings_huge_page_size_bytesgauge
pg_settings_idle_in_transaction_session_timeout_secondsgauge
pg_settings_idle_session_timeout_secondsgauge
pg_settings_ignore_checksum_failuregauge
pg_settings_ignore_invalid_pagesgauge
pg_settings_ignore_system_indexesgauge
pg_settings_in_hot_standbygauge
pg_settings_integer_datetimesgauge
pg_settings_jitgauge
pg_settings_jit_above_costgauge
pg_settings_jit_debugging_supportgauge
pg_settings_jit_dump_bitcodegauge
pg_settings_jit_expressionsgauge
pg_settings_jit_inline_above_costgauge
pg_settings_jit_optimize_above_costgauge
pg_settings_jit_profiling_supportgauge
pg_settings_jit_tuple_deforminggauge
pg_settings_join_collapse_limitgauge
pg_settings_krb_caseins_usersgauge
pg_settings_lo_compat_privilegesgauge
pg_settings_lock_timeout_secondsgauge
pg_settings_log_autovacuum_min_duration_secondsgauge
pg_settings_log_checkpointsgauge
pg_settings_log_connectionsgauge
pg_settings_log_disconnectionsgauge
pg_settings_log_durationgauge
pg_settings_log_executor_statsgauge
pg_settings_log_file_modegauge
pg_settings_log_hostnamegauge
pg_settings_log_lock_waitsgauge
pg_settings_log_min_duration_sample_secondsgauge
pg_settings_log_min_duration_statement_secondsgauge
pg_settings_log_parameter_max_length_bytesgauge
pg_settings_log_parameter_max_length_on_error_bytesgauge
pg_settings_log_parser_statsgauge
pg_settings_log_planner_statsgauge
pg_settings_log_recovery_conflict_waitsgauge
pg_settings_log_replication_commandsgauge
pg_settings_log_rotation_age_secondsgauge
pg_settings_log_rotation_size_bytesgauge
pg_settings_log_statement_sample_rategauge
pg_settings_log_statement_statsgauge
pg_settings_log_temp_files_bytesgauge
pg_settings_log_transaction_sample_rategauge
pg_settings_log_truncate_on_rotationgauge
pg_settings_logging_collectorgauge
pg_settings_logical_decoding_work_mem_bytesgauge
pg_settings_maintenance_io_concurrencygauge
pg_settings_maintenance_work_mem_bytesgauge
pg_settings_max_connectionsgauge
pg_settings_max_files_per_processgauge
pg_settings_max_function_argsgauge
pg_settings_max_identifier_lengthgauge
pg_settings_max_index_keysgauge
pg_settings_max_locks_per_transactiongauge
pg_settings_max_logical_replication_workersgauge
pg_settings_max_parallel_maintenance_workersgauge
pg_settings_max_parallel_workersgauge
pg_settings_max_parallel_workers_per_gathergauge
pg_settings_max_pred_locks_per_pagegauge
pg_settings_max_pred_locks_per_relationgauge
pg_settings_max_pred_locks_per_transactiongauge
pg_settings_max_prepared_transactionsgauge
pg_settings_max_replication_slotsgauge
pg_settings_max_slot_wal_keep_size_bytesgauge
pg_settings_max_stack_depth_bytesgauge
pg_settings_max_standby_archive_delay_secondsgauge
pg_settings_max_standby_streaming_delay_secondsgauge
pg_settings_max_sync_workers_per_subscriptiongauge
pg_settings_max_wal_sendersgauge
pg_settings_max_wal_size_bytesgauge
pg_settings_max_worker_processesgauge
pg_settings_min_dynamic_shared_memory_bytesgauge
pg_settings_min_parallel_index_scan_size_bytesgauge
pg_settings_min_parallel_table_scan_size_bytesgauge
pg_settings_min_wal_size_bytesgauge
pg_settings_old_snapshot_threshold_secondsgauge
pg_settings_parallel_leader_participationgauge
pg_settings_parallel_setup_costgauge
pg_settings_parallel_tuple_costgauge
pg_settings_pg_stat_statements_maxgauge
pg_settings_pg_stat_statements_savegauge
pg_settings_pg_stat_statements_track_planninggauge
pg_settings_pg_stat_statements_track_utilitygauge
pg_settings_portgauge
pg_settings_post_auth_delay_secondsgauge
pg_settings_pre_auth_delay_secondsgauge
pg_settings_quote_all_identifiersgauge
pg_settings_random_page_costgauge
pg_settings_recovery_min_apply_delay_secondsgauge
pg_settings_recovery_target_inclusivegauge
pg_settings_remove_temp_files_after_crashgauge
pg_settings_restart_after_crashgauge
pg_settings_row_securitygauge
pg_settings_segment_size_bytesgauge
pg_settings_seq_page_costgauge
pg_settings_server_version_numgauge
pg_settings_shared_buffers_bytesgauge
pg_settings_sslgauge
pg_settings_ssl_passphrase_command_supports_reloadgauge
pg_settings_ssl_prefer_server_ciphersgauge
pg_settings_standard_conforming_stringsgauge
pg_settings_statement_timeout_secondsgauge
pg_settings_superuser_reserved_connectionsgauge
pg_settings_synchronize_seqscansgauge
pg_settings_syslog_sequence_numbersgauge
pg_settings_syslog_split_messagesgauge
pg_settings_tcp_keepalives_countgauge
pg_settings_tcp_keepalives_idle_secondsgauge
pg_settings_tcp_keepalives_interval_secondsgauge
pg_settings_tcp_user_timeout_secondsgauge
pg_settings_temp_buffers_bytesgauge
pg_settings_temp_file_limit_bytesgauge
pg_settings_trace_notifygauge
pg_settings_trace_sortgauge
pg_settings_track_activitiesgauge
pg_settings_track_activity_query_size_bytesgauge
pg_settings_track_commit_timestampgauge
pg_settings_track_countsgauge
pg_settings_track_io_timinggauge
pg_settings_track_wal_io_timinggauge
pg_settings_transaction_deferrablegauge
pg_settings_transaction_read_onlygauge
pg_settings_transform_null_equalsgauge
pg_settings_unix_socket_permissionsgauge
pg_settings_update_process_titlegauge
pg_settings_vacuum_cost_delay_secondsgauge
pg_settings_vacuum_cost_limitgauge
pg_settings_vacuum_cost_page_dirtygauge
pg_settings_vacuum_cost_page_hitgauge
pg_settings_vacuum_cost_page_missgauge
pg_settings_vacuum_defer_cleanup_agegauge
pg_settings_vacuum_failsafe_agegauge
pg_settings_vacuum_freeze_min_agegauge
pg_settings_vacuum_freeze_table_agegauge
pg_settings_vacuum_multixact_failsafe_agegauge
pg_settings_vacuum_multixact_freeze_min_agegauge
pg_settings_vacuum_multixact_freeze_table_agegauge
pg_settings_wal_block_sizegauge
pg_settings_wal_buffers_bytesgauge
pg_settings_wal_compressiongauge
pg_settings_wal_init_zerogauge
pg_settings_wal_keep_size_bytesgauge
pg_settings_wal_log_hintsgauge
pg_settings_wal_receiver_create_temp_slotgauge
pg_settings_wal_receiver_status_interval_secondsgauge
pg_settings_wal_receiver_timeout_secondsgauge
pg_settings_wal_recyclegauge
pg_settings_wal_retrieve_retry_interval_secondsgauge
pg_settings_wal_segment_size_bytesgauge
pg_settings_wal_sender_timeout_secondsgauge
pg_settings_wal_skip_threshold_bytesgauge
pg_settings_wal_writer_delay_secondsgauge
pg_settings_wal_writer_flush_after_bytesgauge
pg_settings_work_mem_bytesgauge
pg_settings_zero_damaged_pagesgauge
pg_stat_activity_countgauge
pg_stat_activity_max_tx_durationgauge
pg_stat_archiver_archived_countcounter
pg_stat_archiver_failed_countcounter
pg_stat_archiver_last_archive_agegauge
pg_stat_bgwriter_buffers_alloc_totalcounter
pg_stat_bgwriter_buffers_backend_fsync_totalcounter
pg_stat_bgwriter_buffers_backend_totalcounter
pg_stat_bgwriter_buffers_checkpoint_totalcounter
pg_stat_bgwriter_buffers_clean_totalcounter
pg_stat_bgwriter_checkpoint_sync_time_totalcounter
pg_stat_bgwriter_checkpoint_write_time_totalcounter
pg_stat_bgwriter_checkpoints_req_totalcounter
pg_stat_bgwriter_checkpoints_timed_totalcounter
pg_stat_bgwriter_maxwritten_clean_totalcounter
pg_stat_bgwriter_stats_reset_totalcounter
pg_stat_database_active_time_seconds_totalcounter
pg_stat_database_blk_read_timecounter
pg_stat_database_blk_write_timecounter
pg_stat_database_blks_hitcounter
pg_stat_database_blks_readcounter
pg_stat_database_conflictscounter
pg_stat_database_conflicts_confl_bufferpincounter
pg_stat_database_conflicts_confl_deadlockcounter
pg_stat_database_conflicts_confl_lockcounter
pg_stat_database_conflicts_confl_snapshotcounter
pg_stat_database_conflicts_confl_tablespacecounter
pg_stat_database_deadlockscounter
pg_stat_database_numbackendsgauge
pg_stat_database_stats_resetcounter
pg_stat_database_temp_bytescounter
pg_stat_database_temp_filescounter
pg_stat_database_tup_deletedcounter
pg_stat_database_tup_fetchedcounter
pg_stat_database_tup_insertedcounter
pg_stat_database_tup_returnedcounter
pg_stat_database_tup_updatedcounter
pg_stat_database_xact_commitcounter
pg_stat_database_xact_rollbackcounter
pg_stat_replication_pg_current_wal_lsn_bytesgauge
pg_stat_replication_pg_wal_lsn_diffgauge
pg_stat_replication_reply_timeuntyped
pg_staticuntyped
pg_upgauge
pg_wal_segmentsgauge
pg_wal_size_bytesgauge
postgres_exporter_build_infogauge
postgres_exporter_config_last_reload_success_timestamp_secondsgauge
postgres_exporter_config_last_reload_successfulgauge
process_cpu_seconds_totalcounter
process_max_fdsgauge
process_network_receive_bytes_totalcounter
process_network_transmit_bytes_totalcounter
process_open_fdsgauge
process_resident_memory_bytesgauge
process_start_time_secondsgauge
process_virtual_memory_bytesgauge
process_virtual_memory_max_bytesgauge
promhttp_metric_handler_requests_in_flightgauge
promhttp_metric_handler_requests_totalcounter