You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DatIDint64`bun:"datid" help:"OID of a database" metric:"database_id,type:label"`
13
-
DatNamestring`bun:"datname" help:"Name of this database" metric:"database,type:label"`
14
-
NumBackendsint`bun:"numbackends" help:"Number of backends currently connected to this database" metric:"backends,type:gauge"`
15
-
XactCommitint64`bun:"xact_commit" help:"Number of transactions in this database that have been committed" metric:"xact_commited_total"`
16
-
XactRollbackint64`bun:"xact_rollback" help:"Number of transactions in this database that have been rolled back" metric:"xact_rolledback_total"`
17
-
BlksReadint64`bun:"blks_read" help:"Number of disk blocks read in this database" metric:"blocks_read_total"`
18
-
BlksHitint64`bun:"blks_hit" help:"Number of times disk blocks were found already in the buffer cache, so that a read was not necessary" metric:"blocks_hit_total"`
19
-
TupReturnedint64`bun:"tup_returned" help:"Number of rows returned by queries in this database" metric:"rows_returned_total"`
20
-
TupFetchedint64`bun:"tup_fetched" help:"Number of rows fetched by queries in this database" metric:"rows_fetched_total"`
21
-
TupInsertedint64`bun:"tup_inserted" help:"Number of rows inserted by queries in this database" metric:"rows_inserted_total"`
22
-
TupUpdatedint64`bun:"tup_updated" help:"Number of rows updated by queries in this database" metric:"rows_updated_total"`
23
-
TupDeletedint64`bun:"tup_deleted" help:"Number of rows deleted by queries in this database" metric:"rows_deleted_total"`
24
-
Conflictsint64`bun:"conflicts" help:"Number of queries canceled due to conflicts with recovery in this database" metric:"conflicts_total"`
25
-
TempFilesint64`bun:"temp_files" help:"Number of temporary files created by queries in this database" metric:"temp_files_total"`
26
-
TempBytesint64`bun:"temp_bytes" help:"Total amount of data written to temporary files by queries in this database" metric:"temp_bytes_total"`
27
-
Deadlocksint64`bun:"deadlocks" help:"Number of deadlocks detected in this database" metric:"deadlocks_total"`
28
-
ChecksumFailuresint64`bun:"checksum_failures" help:"Number of data page checksum failures detected in this database" metric:"checksum_failures_count"`// new in PG12
29
-
ChecksumLastFailuretime.Time`bun:"checksum_last_failure" help:"Time at which the last data page checksum failure was detected in this database" metric:"checksum_last_failure"`// new in PG12
30
-
BlkReadTimeMilliseconds`bun:"blk_read_time" help:"Time spent reading data file blocks by backends in this database" metric:"blk_read_seconds_total"`
31
-
BlkWriteTimeMilliseconds`bun:"blk_write_time" help:"Time spent writing data file blocks by backends in this database" metric:"blk_write_seconds_total"`
32
-
SessionTimeMilliseconds`bun:"session_time" help:"Time spent by database sessions in this database, in milliseconds" metric:"session_time_total"`// new in PG14
33
-
ActiveTimeMilliseconds`bun:"active_time" help:"Time spent executing SQL statements in this database, in milliseconds" metric:"active_time_total"`// new in PG14
34
-
IdleInTransactionTimeMilliseconds`bun:"idle_in_transaction_time" help:"Time spent idling while in a transaction in this database, in milliseconds" metric:"idle_in_transaction_time_total"`// new in PG14
35
-
Sessionsint64`bun:"sessions" help:"Total number of sessions established to this database" metric:"sessions_count"`// new in PG14
36
-
SessionsAbandonedint64`bun:"sessions_abandoned" help:"Number of database sessions to this database that were terminated because connection to the client was lost" metric:"sessions_abandoned_count"`// new in PG14
37
-
SessionsFatalint64`bun:"sessions_fatal" help:"Number of database sessions to this database that were terminated by fatal errors" metric:"sessions_fatal_count"`// new in PG14
38
-
SessionsKilledint64`bun:"sessions_killed" help:"Number of database sessions to this database that were terminated by operator intervention" metric:"sessions_killed_count"`// new in PG14
39
-
StatsReset time.Time`bun:"stats_reset" help:"Time at which these statistics were last reset"`
13
+
DatIDint64`bun:"datid" help:"OID of a database" metric:"database_id,type:label"`
14
+
DatNamestring`bun:"datname" help:"Name of this database" metric:"database,type:label"`
15
+
NumBackendsint`bun:"numbackends" help:"Number of backends currently connected to this database" metric:"backends,type:gauge"`
16
+
XactCommitint64`bun:"xact_commit" help:"Number of transactions in this database that have been committed" metric:"xact_commited_total"`
17
+
XactRollbackint64`bun:"xact_rollback" help:"Number of transactions in this database that have been rolled back" metric:"xact_rolledback_total"`
18
+
BlksReadint64`bun:"blks_read" help:"Number of disk blocks read in this database" metric:"blocks_read_total"`
19
+
BlksHitint64`bun:"blks_hit" help:"Number of times disk blocks were found already in the buffer cache, so that a read was not necessary" metric:"blocks_hit_total"`
20
+
TupReturnedint64`bun:"tup_returned" help:"Number of rows returned by queries in this database" metric:"rows_returned_total"`
21
+
TupFetchedint64`bun:"tup_fetched" help:"Number of rows fetched by queries in this database" metric:"rows_fetched_total"`
22
+
TupInsertedint64`bun:"tup_inserted" help:"Number of rows inserted by queries in this database" metric:"rows_inserted_total"`
23
+
TupUpdatedint64`bun:"tup_updated" help:"Number of rows updated by queries in this database" metric:"rows_updated_total"`
24
+
TupDeletedint64`bun:"tup_deleted" help:"Number of rows deleted by queries in this database" metric:"rows_deleted_total"`
25
+
Conflictsint64`bun:"conflicts" help:"Number of queries canceled due to conflicts with recovery in this database" metric:"conflicts_total"`
26
+
TempFilesint64`bun:"temp_files" help:"Number of temporary files created by queries in this database" metric:"temp_files_total"`
27
+
TempBytesint64`bun:"temp_bytes" help:"Total amount of data written to temporary files by queries in this database" metric:"temp_bytes_total"`
28
+
Deadlocksint64`bun:"deadlocks" help:"Number of deadlocks detected in this database" metric:"deadlocks_total"`
29
+
ChecksumFailuressql.NullInt64`bun:"checksum_failures" help:"Number of data page checksum failures detected in this database" metric:"checksum_failures_count"`// new in PG12
30
+
ChecksumLastFailuresql.NullTime`bun:"checksum_last_failure" help:"Time at which the last data page checksum failure was detected in this database" metric:"checksum_last_failure"`// new in PG12
31
+
BlkReadTimeMilliseconds`bun:"blk_read_time" help:"Time spent reading data file blocks by backends in this database" metric:"blk_read_seconds_total"`
32
+
BlkWriteTimeMilliseconds`bun:"blk_write_time" help:"Time spent writing data file blocks by backends in this database" metric:"blk_write_seconds_total"`
33
+
SessionTimeNullMilliseconds`bun:"session_time" help:"Time spent by database sessions in this database, in milliseconds" metric:"session_time_total"`// new in PG14
34
+
ActiveTimeNullMilliseconds`bun:"active_time" help:"Time spent executing SQL statements in this database, in milliseconds" metric:"active_time_total"`// new in PG14
35
+
IdleInTransactionTimeNullMilliseconds`bun:"idle_in_transaction_time" help:"Time spent idling while in a transaction in this database, in milliseconds" metric:"idle_in_transaction_time_total"`// new in PG14
36
+
Sessionssql.NullInt64`bun:"sessions" help:"Total number of sessions established to this database" metric:"sessions_count"`// new in PG14
37
+
SessionsAbandonedsql.NullInt64`bun:"sessions_abandoned" help:"Number of database sessions to this database that were terminated because connection to the client was lost" metric:"sessions_abandoned_count"`// new in PG14
38
+
SessionsFatalsql.NullInt64`bun:"sessions_fatal" help:"Number of database sessions to this database that were terminated by fatal errors" metric:"sessions_fatal_count"`// new in PG14
39
+
SessionsKilledsql.NullInt64`bun:"sessions_killed" help:"Number of database sessions to this database that were terminated by operator intervention" metric:"sessions_killed_count"`// new in PG14
40
+
StatsReset time.Time`bun:"stats_reset" help:"Time at which these statistics were last reset"`
prometheus.BuildFQName(namespace, subsystem, `checksum_failures_count`), `Number of data page checksum failures detected in this database`, nil, labels,
prometheus.BuildFQName(namespace, subsystem, `checksum_last_failure`), `Time at which the last data page checksum failure was detected in this database`, nil, labels,
prometheus.BuildFQName(namespace, subsystem, `session_time_total`), `Time spent by database sessions in this database, in milliseconds`, nil, labels,
184
-
), prometheus.CounterValue, sessionTimeTotal,
185
-
)
186
-
187
-
// active_time_total (CounterValue)
188
-
activeTimeTotal:=r.ActiveTime.Seconds()
189
-
ch<-prometheus.MustNewConstMetric(
190
-
prometheus.NewDesc(
191
-
prometheus.BuildFQName(namespace, subsystem, `active_time_total`), `Time spent executing SQL statements in this database, in milliseconds`, nil, labels,
prometheus.BuildFQName(namespace, subsystem, `idle_in_transaction_time_total`), `Time spent idling while in a transaction in this database, in milliseconds`, nil, labels,
prometheus.BuildFQName(namespace, subsystem, `sessions_abandoned_count`), `Number of database sessions to this database that were terminated because connection to the client was lost`, nil, labels,
prometheus.BuildFQName(namespace, subsystem, `sessions_fatal_count`), `Number of database sessions to this database that were terminated by fatal errors`, nil, labels,
224
-
), prometheus.CounterValue, sessionsFatalCount,
225
-
)
226
-
227
-
// sessions_killed_count (CounterValue)
228
-
sessionsKilledCount:=float64(r.SessionsKilled)
229
-
ch<-prometheus.MustNewConstMetric(
230
-
prometheus.NewDesc(
231
-
prometheus.BuildFQName(namespace, subsystem, `sessions_killed_count`), `Number of database sessions to this database that were terminated by operator intervention`, nil, labels,
prometheus.BuildFQName(namespace, subsystem, `checksum_failures_count`), `Number of data page checksum failures detected in this database`, nil, labels,
prometheus.BuildFQName(namespace, subsystem, `session_time_total`), `Time spent by database sessions in this database, in milliseconds`, nil, labels,
189
+
), prometheus.CounterValue, sessionTimeTotal,
190
+
)
191
+
}
192
+
// active_time_total (CounterValue)
193
+
ifr.ActiveTime.Valid {
194
+
activeTimeTotal:=r.ActiveTime.Seconds()
195
+
196
+
ch<-prometheus.MustNewConstMetric(
197
+
prometheus.NewDesc(
198
+
prometheus.BuildFQName(namespace, subsystem, `active_time_total`), `Time spent executing SQL statements in this database, in milliseconds`, nil, labels,
prometheus.BuildFQName(namespace, subsystem, `idle_in_transaction_time_total`), `Time spent idling while in a transaction in this database, in milliseconds`, nil, labels,
prometheus.BuildFQName(namespace, subsystem, `sessions_abandoned_count`), `Number of database sessions to this database that were terminated because connection to the client was lost`, nil, labels,
prometheus.BuildFQName(namespace, subsystem, `sessions_fatal_count`), `Number of database sessions to this database that were terminated by fatal errors`, nil, labels,
prometheus.BuildFQName(namespace, subsystem, `sessions_killed_count`), `Number of database sessions to this database that were terminated by operator intervention`, nil, labels,
0 commit comments