Skip to content

Latest commit

 

History

History
469 lines (310 loc) · 18.4 KB

File metadata and controls

469 lines (310 loc) · 18.4 KB

postgresql

Default Metrics

The following metrics are emitted by default. Each of them can be disabled by applying the following configuration:

metrics:
  <metric_name>:
    enabled: false

postgresql.backends

The number of backends.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
1 Sum Int Cumulative false Development

postgresql.bgwriter.buffers.allocated

Number of buffers allocated.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{buffers} Sum Int Cumulative true Development

postgresql.bgwriter.buffers.writes

Number of buffers written.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{buffers} Sum Int Cumulative true Development

Attributes

Name Description Values Requirement Level
source The source of a buffer write. Str: backend, backend_fsync, checkpoints, bgwriter Recommended

postgresql.bgwriter.checkpoint.count

The number of checkpoints performed.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{checkpoints} Sum Int Cumulative true Development

Attributes

Name Description Values Requirement Level
type The type of checkpoint state. Str: requested, scheduled Recommended

postgresql.bgwriter.duration

Total time spent writing and syncing files to disk by checkpoints.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
ms Sum Double Cumulative true Development

Attributes

Name Description Values Requirement Level
type The type of time spent during the checkpoint. Str: sync, write Recommended

postgresql.bgwriter.maxwritten

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

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
1 Sum Int Cumulative true Development

postgresql.blocks_read

The number of blocks read.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
1 Sum Int Cumulative true Development

Attributes

Name Description Values Requirement Level
source The block read source type. Str: heap_read, heap_hit, idx_read, idx_hit, toast_read, toast_hit, tidx_read, tidx_hit Recommended

postgresql.commits

The number of commits.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
1 Sum Int Cumulative true Development

postgresql.connection.max

Configured maximum number of client connections allowed

Unit Metric Type Value Type Stability
{connections} Gauge Int Development

postgresql.database.count

Number of user databases.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{databases} Sum Int Cumulative false Development

postgresql.db_size

The database disk usage.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
By Sum Int Cumulative false Development

postgresql.index.scans

The number of index scans on a table.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{scans} Sum Int Cumulative true Development

postgresql.index.size

The size of the index on disk.

Unit Metric Type Value Type Stability
By Gauge Int Development

postgresql.operations

The number of db row operations.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
1 Sum Int Cumulative true Development

Attributes

Name Description Values Requirement Level
operation The database operation. Str: ins, upd, del, hot_upd Recommended

postgresql.replication.data_delay

The amount of data delayed in replication.

Unit Metric Type Value Type Stability
By Gauge Int Development

Attributes

Name Description Values Requirement Level
replication_client The IP address of the client connected to this backend. If this field is "unix", it indicates either that the client is connected via a Unix socket. Any Str Recommended

postgresql.rollbacks

The number of rollbacks.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
1 Sum Int Cumulative true Development

postgresql.rows

The number of rows in the database.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
1 Sum Int Cumulative false Development

Attributes

Name Description Values Requirement Level
state The tuple (row) state. Str: dead, live Recommended

postgresql.table.count

Number of user tables in a database.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{table} Sum Int Cumulative false Development

postgresql.table.size

Disk space used by a table.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
By Sum Int Cumulative false Development

postgresql.table.vacuum.count

Number of times a table has manually been vacuumed.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{vacuum} Sum Int Cumulative true Development

postgresql.wal.age

Age of the oldest WAL file.

This metric requires WAL to be enabled with at least one replica.

Unit Metric Type Value Type Stability
s Gauge Int Development

postgresql.wal.lag

Time between flushing recent WAL locally and receiving notification that the standby server has completed an operation with it.

This metric requires WAL to be enabled with at least one replica.

Unit Metric Type Value Type Stability
s Gauge Int Development

Attributes

Name Description Values Requirement Level
operation The operation which is responsible for the lag. Str: flush, replay, write Recommended
replication_client The IP address of the client connected to this backend. If this field is "unix", it indicates either that the client is connected via a Unix socket. Any Str Recommended

Optional Metrics

The following metrics are not emitted by default. Each of them can be enabled by applying the following configuration:

metrics:
  <metric_name>:
    enabled: true

postgresql.blks_hit

Number of times disk blocks were found already in the buffer cache.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{blks_hit} Sum Int Cumulative true Development

postgresql.blks_read

Number of disk blocks read in this database.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{blks_read} Sum Int Cumulative true Development

postgresql.database.locks

The number of database locks.

Unit Metric Type Value Type Stability
{lock} Gauge Int Development

Attributes

Name Description Values Requirement Level
relation OID of the relation targeted by the lock, or null if the target is not a relation or part of a relation. Any Str Recommended
mode Name of the lock mode held or desired by the process. Any Str Recommended
lock_type Type of the lockable object. Any Str Recommended

postgresql.deadlocks

The number of deadlocks.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{deadlock} Sum Int Cumulative true Development

postgresql.function.calls

The number of calls made to a function. Requires track_functions=pl|all in Postgres config.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{call} Sum Int Cumulative true Development

Attributes

Name Description Values Requirement Level
function The name of the function. Any Str Recommended

postgresql.sequential_scans

The number of sequential scans.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{sequential_scan} Sum Int Cumulative true Development

postgresql.temp.io

Total amount of data written to temporary files by queries.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
By Sum Int Cumulative true Development

postgresql.temp_files

The number of temp files.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{temp_file} Sum Int Cumulative true Development

postgresql.tup_deleted

Number of rows deleted by queries in the database.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{tup_deleted} Sum Int Cumulative true Development

postgresql.tup_fetched

Number of rows fetched by queries in the database.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{tup_fetched} Sum Int Cumulative true Development

postgresql.tup_inserted

Number of rows inserted by queries in the database.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{tup_inserted} Sum Int Cumulative true Development

postgresql.tup_returned

Number of rows returned by queries in the database.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{tup_returned} Sum Int Cumulative true Development

postgresql.tup_updated

Number of rows updated by queries in the database.

Unit Metric Type Value Type Aggregation Temporality Monotonic Stability
{tup_updated} Sum Int Cumulative true Development

postgresql.wal.delay

Time between flushing recent WAL locally and receiving notification that the standby server has completed an operation with it.

This metric requires WAL to be enabled with at least one replica.

Unit Metric Type Value Type Stability
s Gauge Double Development

Attributes

Name Description Values Requirement Level
operation The operation which is responsible for the lag. Str: flush, replay, write Recommended
replication_client The IP address of the client connected to this backend. If this field is "unix", it indicates either that the client is connected via a Unix socket. Any Str Recommended

Default Events

The following events are emitted by default. Each of them can be disabled by applying the following configuration:

events:
  <event_name>:
    enabled: false

Optional Events

The following events are not emitted by default. Each of them can be enabled by applying the following configuration:

events:
  <event_name>:
    enabled: true

db.server.query_sample

query sample

Attributes

Name Description Values
db.system.name The database management system (DBMS) product as identified by the client instrumentation. Str: postgresql
db.namespace The namespace or schema of the database where the query is executed. Any Str
db.query.text The text of the database query being executed. Any Str
user.name Name of the user logged into this backend. Any Str
postgresql.state Current overall state of this backend Any Str
postgresql.pid Process ID of this backend. Any Int
postgresql.application_name Name of the application that is connected to this backend. Any Str
network.peer.address IP address of the client connected to this backend. Any Str
network.peer.port TCP port number that the client is using for communication with this backend. Any Int
postgresql.client_hostname Host name of the connected client, as reported by a reverse DNS lookup of client_addr. Any Str
postgresql.query_start Time when the currently active query was started, or if state is not active, when the last query was started. Any Str
postgresql.wait_event Wait event name if backend is currently waiting, otherwise NULL. Any Str
postgresql.wait_event_type The type of event for which the backend is waiting, if any; otherwise NULL. Any Str
postgresql.query_id Identifier of this backend's most recent query. If state is active this field shows the identifier of the currently executing query. In all other states, it shows the identifier of last query that was executed. Any Str
postgresql.total_exec_time Total time spent executing the statement, in delta milliseconds. Any Double

db.server.top_query

top query

Attributes

Name Description Values
db.system.name The database management system (DBMS) product as identified by the client instrumentation. Str: postgresql
db.namespace The namespace or schema of the database where the query is executed. Any Str
db.query.text The text of the database query being executed. Any Str
postgresql.calls Number of times the statement was executed, reported in delta value. Any Int
postgresql.rows Total number of rows retrieved or affected by the statement, reported in delta value. Any Int
postgresql.shared_blks_dirtied Total number of shared blocks dirtied by the statement, reported in delta value. Any Int
postgresql.shared_blks_hit Total number of shared block cache hits by the statement, reported in delta value. Any Int
postgresql.shared_blks_read Total number of shared blocks read by the statement, reported in delta value. Any Int
postgresql.shared_blks_written Total number of shared blocks written by the statement, reported in delta value. Any Int
postgresql.temp_blks_read Total number of temp blocks read by the statement, reported in delta value. Any Int
postgresql.temp_blks_written Total number of temp blocks written by the statement, reported in delta value. Any Int
postgresql.queryid Hash code to identify identical normalized queries. Any Str
postgresql.rolname The name of the PostgreSQL role that executed the query. Any Str
postgresql.total_exec_time Total time spent executing the statement, in delta milliseconds. Any Double
postgresql.total_plan_time Total time spent planning the statement, in delta milliseconds. Any Double
postgresql.query_plan The execution plan used by PostgreSQL for the query. Any Str

Resource Attributes

Name Description Values Enabled
postgresql.database.name The name of the database. Any Str true
postgresql.index.name The name of the index on a table. Any Str true
postgresql.schema.name The schema name. Any Str true
postgresql.table.name The table name. Any Str true
service.instance.id A unique identifier of the PostgreSQL instance in the format host:port (defaults to 'unknown:5432' in case of error in generating this value). Any Str true