PostgreSQL metrics
Collect metrics from the PostgreSQL database
Configuration
Example configurations
{
"sources": {
"my_source_id": {
"type": "postgresql_metrics",
"endpoints": [
"postgresql://postgres:vector@localhost:5432/postgres"
]
}
}
}
[sources.my_source_id]
type = "postgresql_metrics"
endpoints = [ "postgresql://postgres:vector@localhost:5432/postgres" ]
sources:
my_source_id:
type: postgresql_metrics
endpoints:
- postgresql://postgres:vector@localhost:5432/postgres
{
"sources": {
"my_source_id": {
"type": "postgresql_metrics",
"endpoints": [
"postgresql://postgres:vector@localhost:5432/postgres"
],
"exclude_databases": [
"^postgres$"
],
"include_databases": [
"^postgres$"
],
"namespace": "postgresql",
"scrape_interval_secs": 15
}
}
}
[sources.my_source_id]
type = "postgresql_metrics"
endpoints = [ "postgresql://postgres:vector@localhost:5432/postgres" ]
exclude_databases = [ "^postgres$" ]
include_databases = [ "^postgres$" ]
namespace = "postgresql"
scrape_interval_secs = 15
sources:
my_source_id:
type: postgresql_metrics
endpoints:
- postgresql://postgres:vector@localhost:5432/postgres
exclude_databases:
- ^postgres$
include_databases:
- ^postgres$
namespace: postgresql
scrape_interval_secs: 15
endpoints
required [string]A list of PostgreSQL instances to scrape.
Each endpoint must be in the Connection URI format.
exclude_databases
optional [string]A list of databases to match (by using POSIX Regular
Expressions) against
the datname
column for which you don’t want to collect metrics from.
Specifying ""
includes metrics where datname
is NULL
.
This can be used in conjunction with include_databases
.
include_databases
optional [string]A list of databases to match (by using POSIX Regular
Expressions) against
the datname
column for which you want to collect metrics from.
If not set, metrics are collected from all databases. Specifying ""
includes metrics where datname
is
NULL
.
This can be used in conjunction with exclude_databases
.
namespace
optional string literalpostgresql
tls
optional objecttls.ca_file
required string literalAbsolute path to an additional CA certificate file.
The certificate must be in the DER or PEM (X.509) format.
Outputs
<component_id>
Output Data
Metrics
pg_stat_bgwriter_buffers_alloc_total
counterpg_stat_bgwriter_buffers_backend_fsync_total
counterpg_stat_bgwriter_buffers_backend_total
counterpg_stat_bgwriter_buffers_checkpoint_total
counterpg_stat_bgwriter_buffers_clean_total
counterpg_stat_bgwriter_checkpoint_sync_time_seconds_total
counterpg_stat_bgwriter_checkpoint_write_time_seconds_total
counterpg_stat_bgwriter_checkpoints_req_total
counterpg_stat_bgwriter_checkpoints_timed_total
counterpg_stat_bgwriter_maxwritten_clean_total
counterpg_stat_bgwriter_stats_reset
gaugepg_stat_database_blk_read_time_seconds_total
countertrack_io_timing
is enabled, otherwise zero).pg_stat_database_blk_write_time_seconds_total
countertrack_io_timing
is enabled, otherwise zero).pg_stat_database_blks_hit_total
counterpg_stat_database_blks_read_total
counterpg_stat_database_checksum_failures_total
counterpg_stat_database_checksum_last_failure
gaugepg_stat_database_conflicts_confl_bufferpin_total
counterpg_stat_database_conflicts_confl_deadlock_total
counterpg_stat_database_conflicts_confl_lock_total
counterpg_stat_database_conflicts_confl_snapshot_total
counterpg_stat_database_conflicts_confl_tablespace_total
counterpg_stat_database_conflicts_total
counterpg_stat_database_conflicts
for details.)pg_stat_database_datid
gaugepg_stat_database_deadlocks_total
counterpg_stat_database_numbackends
gaugepg_stat_database_stats_reset
gaugepg_stat_database_temp_bytes_total
counterlog_temp_files
setting.pg_stat_database_temp_files_total
counterlog_temp_files
setting.pg_stat_database_tup_deleted_total
counterpg_stat_database_tup_fetched_total
counterpg_stat_database_tup_inserted_total
counterpg_stat_database_tup_returned_total
counterpg_stat_database_tup_updated_total
counterpg_stat_database_xact_commit_total
counterTelemetry
Metrics
linkcollect_completed_total
countercollect_duration_seconds
histogramcomponent_discarded_events_total
counterfilter
transform, or false if due to an error.component_errors_total
countercomponent_received_bytes_total
countercomponent_received_event_bytes_total
countercomponent_received_events_count
histogramA histogram of the number of events passed in each internal batch in Vector’s internal topology.
Note that this is separate than sink-level batching. It is mostly useful for low level debugging performance issues in Vector due to small internal batches.