PostgreSQL Fields

edit

Metrics collected from PostgreSQL servers.

postgresql Fields

edit

PostgreSQL metrics.

activity Fields

edit

One document per server process, showing information related to the current activity of that process, such as state and current query. Collected by querying pg_stat_activity.

postgresql.activity.database.oid

edit

type: long

OID of the database this backend is connected to.

postgresql.activity.database.name

edit

type: keyword

Name of the database this backend is connected to.

postgresql.activity.pid

edit

type: long

Process ID of this backend.

postgresql.activity.user.id

edit

type: long

OID of the user logged into this backend.

postgresql.activity.user.name

edit

Name of the user logged into this backend.

postgresql.activity.application_name

edit

Name of the application that is connected to this backend.

postgresql.activity.client.address

edit

IP address of the client connected to this backend.

postgresql.activity.client.hostname

edit

Host name of the connected client, as reported by a reverse DNS lookup of client_addr.

postgresql.activity.client.port

edit

type: long

TCP port number that the client is using for communication with this backend, or -1 if a Unix socket is used.

postgresql.activity.backend_start

edit

type: date

Time when this process was started, i.e., when the client connected to the server.

postgresql.activity.transaction_start

edit

type: date

Time when this process' current transaction was started.

postgresql.activity.query_start

edit

type: date

Time when the currently active query was started, or if state is not active, when the last query was started.

postgresql.activity.state_change

edit

type: date

Time when the state was last changed.

postgresql.activity.waiting

edit

type: boolean

True if this backend is currently waiting on a lock.

postgresql.activity.state

edit

Current overall state of this backend. Possible values are:

  • active: The backend is executing a query.
  • idle: The backend is waiting for a new client command.
  • idle in transaction: The backend is in a transaction, but is not currently executing a query.
  • idle in transaction (aborted): This state is similar to idle in transaction, except one of the statements in the transaction caused an error.
  • fastpath function call: The backend is executing a fast-path function.
  • disabled: This state is reported if track_activities is disabled in this backend.

postgresql.activity.query

edit

Text of this backend’s most recent query. If state is active this field shows the currently executing query. In all other states, it shows the last query that was executed.

bgwriter Fields

edit

Statistics about the background writer process’s activity. Collected using the pg_stat_bgwriter query.

postgresql.bgwriter.checkpoints.scheduled

edit

type: long

Number of scheduled checkpoints that have been performed.

postgresql.bgwriter.checkpoints.requested

edit

type: long

Number of requested checkpoints that have been performed.

postgresql.bgwriter.checkpoints.times.write.ms

edit

type: float

Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds.

postgresql.bgwriter.checkpoints.times.sync.ms

edit

type: float

Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds.

postgresql.bgwriter.buffers.checkpoints

edit

type: long

Number of buffers written during checkpoints.

postgresql.bgwriter.buffers.clean

edit

type: long

Number of buffers written by the background writer.

postgresql.bgwriter.buffers.clean_full

edit

type: long

Number of times the background writer stopped a cleaning scan because it had written too many buffers.

postgresql.bgwriter.buffers.backend

edit

type: long

Number of buffers written directly by a backend.

postgresql.bgwriter.buffers.backend_fsync

edit

type: long

Number of times a backend had to execute its own fsync call (normally the background writer handles those even when the backend does its own write)

postgresql.bgwriter.buffers.allocated

edit

type: long

Number of buffers allocated.

postgresql.bgwriter.stats_reset

edit

type: date

Time at which these statistics were last reset.

database Fields

edit

One row per database, showing database-wide statistics. Collected by querying pg_stat_database

postgresql.database.oid

edit

type: long

OID of the database this backend is connected to.

postgresql.database.name

edit

type: keyword

Name of the database this backend is connected to.

postgresql.database.number_of_backends

edit

type: long

Number of backends currently connected to this database.

postgresql.database.transactions.commit

edit

type: long

Number of transactions in this database that have been committed.

postgresql.database.transactions.rollback

edit

type: long

Number of transactions in this database that have been rolled back.

postgresql.database.blocks.read

edit

type: long

Number of disk blocks read in this database.

postgresql.database.blocks.hit

edit

type: long

Number of times disk blocks were found already in the buffer cache, so that a read was not necessary (this only includes hits in the PostgreSQL buffer cache, not the operating system’s file system cache).

postgresql.database.blocks.time.read.ms

edit

type: long

Time spent reading data file blocks by backends in this database, in milliseconds.

postgresql.database.blocks.time.write.ms

edit

type: long

Time spent writing data file blocks by backends in this database, in milliseconds.

postgresql.database.rows.returned

edit

type: long

Number of rows returned by queries in this database.

postgresql.database.rows.fetched

edit

type: long

Number of rows fetched by queries in this database.

postgresql.database.rows.inserted

edit

type: long

Number of rows inserted by queries in this database.

postgresql.database.rows.updated

edit

type: long

Number of rows updated by queries in this database.

postgresql.database.rows.deleted

edit

type: long

Number of rows deleted by queries in this database.

postgresql.database.conflicts

edit

type: long

Number of queries canceled due to conflicts with recovery in this database.

postgresql.database.temporary.files

edit

type: long

Number of temporary files created by queries in this database. All temporary files are counted, regardless of why the temporary file was created (e.g., sorting or hashing), and regardless of the log_temp_files setting.

postgresql.database.temporary.bytes

edit

type: long

Total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the log_temp_files setting.

postgresql.database.deadlocks

edit

type: long

Number of deadlocks detected in this database.

postgresql.database.stats_reset

edit

type: date

Time at which these statistics were last reset.