DirectorySecurity AdvisoriesPricing
Sign inTry Starter for free
Directory
cloudnative-pg logoHELM

cloudnative-pg

Helm chart
Last changed
Request a free trial

Contact our team to test out this Helm chart and related images for free. Please also indicate any other images you would like to evaluate.

Overview
Chart tags
Default values
Chart metadata
Images

Tag:
Compare:

1
#
2
# Copyright © contributors to CloudNativePG, established as
3
# CloudNativePG a Series of LF Projects, LLC.
4
#
5
# Licensed under the Apache License, Version 2.0 (the "License");
6
# you may not use this file except in compliance with the License.
7
# You may obtain a copy of the License at
8
#
9
# http://www.apache.org/licenses/LICENSE-2.0
10
#
11
# Unless required by applicable law or agreed to in writing, software
12
# distributed under the License is distributed on an "AS IS" BASIS,
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
# See the License for the specific language governing permissions and
15
# limitations under the License.
16
#
17
# SPDX-License-Identifier: Apache-2.0
18
#
19
# Default values for CloudNativePG.
20
# This is a YAML-formatted file.
21
# Please declare variables to be passed to your templates.
22
23
replicaCount: 1
24
image:
25
repository: cgr.dev/chainguard-private/cloudnative-pg
26
pullPolicy: IfNotPresent
27
# -- Overrides the image tag whose default is the chart appVersion.
28
tag: 1.30.2-r0@sha256:4a2fc14eba1f96f9f89bd2d924f1ecc306d0ffeb7845085212fccf84222cf6e8
29
imagePullSecrets: []
30
nameOverride: ""
31
fullnameOverride: ""
32
namespaceOverride: ""
33
hostNetwork: false
34
dnsPolicy: ""
35
# -- Update strategy for the operator.
36
# ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
37
updateStrategy: {}
38
# For example:
39
# type: RollingUpdate
40
# rollingUpdate:
41
# maxSurge: 25%
42
# maxUnavailable: 25%
43
44
crds:
45
# -- Specifies whether the CRDs should be created when installing the chart.
46
create: true
47
# -- The webhook configuration.
48
webhook:
49
port: 9443
50
mutating:
51
create: true
52
failurePolicy: Fail
53
validating:
54
create: true
55
failurePolicy: Fail
56
livenessProbe:
57
initialDelaySeconds: 3
58
readinessProbe:
59
initialDelaySeconds: 3
60
startupProbe:
61
failureThreshold: 6
62
periodSeconds: 5
63
# Operator configuration.
64
config:
65
# -- Specifies whether the secret should be created.
66
create: true
67
# -- The name of the configmap/secret to use.
68
name: cnpg-controller-manager-config
69
# -- Specifies whether it should be stored in a secret, instead of a configmap.
70
secret: false
71
# -- This option determines if the operator is responsible for observing
72
# events across the entire Kubernetes cluster or if its focus should be
73
# narrowed down to the specific namespace within which it has been deployed.
74
# When `false`, webhook configurations and cluster-scoped RBAC objects are
75
# suffixed with the namespace, and webhooks only intercept the watched
76
# namespaces. Requires operator >= 1.30.0. See "Single namespace
77
# installation" in the README.
78
clusterWide: true
79
# -- The content of the configmap/secret, see
80
# https://cloudnative-pg.io/documentation/current/operator_conf/#available-options
81
# for all the available options.
82
data: {}
83
# INHERITED_ANNOTATIONS: categories
84
# INHERITED_LABELS: environment, workload, app
85
# WATCH_NAMESPACE: namespace-a,namespace-b
86
87
# -- The maximum number of concurrent reconciles. Defaults to 10.
88
maxConcurrentReconciles: 10
89
# -- Additional arguments to be added to the operator's args list.
90
additionalArgs: []
91
# -- Array containing extra environment variables which can be templated.
92
additionalEnv: []
93
# For example:
94
# - name: RELEASE_NAME
95
# value: "{{ .Release.Name }}"
96
# - name: MY_VAR
97
# value: "mySpecialKey"
98
99
# -- Array containing extra volumes to be added to the operator pod, which can be templated.
100
additionalVolumes: []
101
# For example, to serve the metrics endpoint over TLS:
102
# - name: metrics-certificates
103
# secret:
104
# secretName: "{{ .Release.Name }}-metrics-cert"
105
# defaultMode: 420
106
107
# -- Array containing extra volume mounts to be added to the operator container, which can be templated.
108
additionalVolumeMounts: []
109
# For example, to serve the metrics endpoint over TLS, together with a
110
# `METRICS_CERT_DIR` entry in `additionalEnv` pointing to the same path:
111
# - name: metrics-certificates
112
# mountPath: /run/secrets/cnpg.io/metrics
113
# readOnly: true
114
115
serviceAccount:
116
# -- Specifies whether the service account should be created.
117
create: true
118
# -- The name of the service account to use.
119
# If not set and create is true, a name is generated using the fullname template.
120
name: ""
121
rbac:
122
# -- Specifies whether ClusterRole and ClusterRoleBinding should be created.
123
create: true
124
# -- Aggregate ClusterRoles to Kubernetes default user-facing roles.
125
# Ref: https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles
126
aggregateClusterRoles: false
127
# -- Annotations to be added to all other resources.
128
commonAnnotations: {}
129
# -- Annotations to be added to the pod.
130
podAnnotations: {}
131
# -- Labels to be added to the pod.
132
podLabels: {}
133
# -- Container Security Context.
134
containerSecurityContext:
135
allowPrivilegeEscalation: false
136
readOnlyRootFilesystem: true
137
runAsUser: 10001
138
runAsGroup: 10001
139
seccompProfile:
140
type: RuntimeDefault
141
capabilities:
142
drop:
143
- "ALL"
144
# -- Security Context for the whole pod.
145
podSecurityContext:
146
runAsNonRoot: true
147
seccompProfile:
148
type: RuntimeDefault
149
# fsGroup: 2000
150
# -- Priority indicates the importance of a Pod relative to other Pods.
151
priorityClassName: ""
152
service:
153
type: ClusterIP
154
# -- The name of the Webhook Service.
155
name: cnpg-webhook-service
156
# DO NOT CHANGE THE SERVICE NAME as it is currently used to generate the certificate
157
# and can not be configured
158
159
port: 443
160
# -- Set the ip family policy to configure dual-stack see [Configure dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
161
ipFamilyPolicy: ""
162
# -- Sets the families that should be supported and the order in which they should be applied to ClusterIP as well. Can be IPv4 and/or IPv6.
163
ipFamilies: []
164
resources: {}
165
# If you want to specify resources, uncomment the following
166
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
167
#
168
# limits:
169
# cpu: 100m
170
# memory: 200Mi
171
# requests:
172
# cpu: 100m
173
# memory: 100Mi
174
175
scratchData:
176
# -- EmptyDir options for the scratch-data volume.
177
emptyDir: {}
178
# -- Nodeselector for the operator to be installed.
179
nodeSelector: {}
180
# -- Topology Spread Constraints for the operator to be installed.
181
topologySpreadConstraints: []
182
# -- Tolerations for the operator to be installed.
183
tolerations: []
184
# -- Affinity for the operator to be installed.
185
affinity: {}
186
monitoring:
187
# -- Specifies whether the monitoring should be enabled. Requires Prometheus Operator CRDs.
188
podMonitorEnabled: false
189
# -- Metrics relabel configurations to apply to samples before ingestion.
190
podMonitorMetricRelabelings: []
191
# -- Relabel configurations to apply to samples before scraping.
192
podMonitorRelabelings: []
193
# -- Additional labels for the podMonitor
194
podMonitorAdditionalLabels: {}
195
# @schema
196
# type: string
197
# enum: ["", http, https, HTTP, HTTPS]
198
# @schema
199
# -- Scheme to use when scraping the metrics endpoint. Set it to `https` when
200
# TLS is enabled on the operator metrics server through `METRICS_CERT_DIR`.
201
podMonitorScheme: ""
202
# -- TLS configuration to use when scraping the metrics endpoint, which can be templated.
203
podMonitorTLSConfig: {}
204
# For example:
205
# ca:
206
# secret:
207
# name: "{{ .Release.Name }}-metrics-cert"
208
# key: ca.crt
209
210
grafanaDashboard:
211
create: false
212
# -- Allows overriding the namespace where the ConfigMap will be created, defaulting to the same one as the Release.
213
namespace: ""
214
# -- The name of the ConfigMap containing the dashboard.
215
configMapName: "cnpg-grafana-dashboard"
216
# -- Label that ConfigMaps should have to be loaded as dashboards. DEPRECATED: Use labels instead.
217
sidecarLabel: "grafana_dashboard"
218
# -- Label value that ConfigMaps should have to be loaded as dashboards. DEPRECATED: Use labels instead.
219
sidecarLabelValue: "1"
220
# -- Labels that ConfigMaps should have to get configured in Grafana.
221
labels: {}
222
# -- Annotations that ConfigMaps can have to get configured in Grafana.
223
annotations: {}
224
# Default monitoring queries
225
monitoringQueriesConfigMap:
226
# -- The name of the default monitoring configmap.
227
name: cnpg-default-monitoring
228
# -- A string representation of a YAML defining monitoring queries.
229
queries: |
230
backends:
231
query: |
232
SELECT sa.datname
233
, sa.usename
234
, sa.application_name
235
, states.state
236
, COALESCE(sa.count, 0) AS total
237
, COALESCE(sa.max_tx_secs, 0) AS max_tx_duration_seconds
238
FROM ( VALUES ('active')
239
, ('idle')
240
, ('idle in transaction')
241
, ('idle in transaction (aborted)')
242
, ('fastpath function call')
243
, ('disabled')
244
) AS states(state)
245
LEFT JOIN (
246
SELECT datname
247
, state
248
, usename
249
, COALESCE(application_name, '') AS application_name
250
, pg_catalog.count(*)
251
, COALESCE(EXTRACT (EPOCH FROM (pg_catalog.max(pg_catalog.now() OPERATOR(pg_catalog.-) xact_start))), 0) AS max_tx_secs
252
FROM pg_catalog.pg_stat_activity
253
GROUP BY datname, state, usename, application_name
254
) sa ON states.state OPERATOR(pg_catalog.=) sa.state
255
WHERE sa.usename IS NOT NULL
256
metrics:
257
- datname:
258
usage: "LABEL"
259
description: "Name of the database"
260
- usename:
261
usage: "LABEL"
262
description: "Name of the user"
263
- application_name:
264
usage: "LABEL"
265
description: "Name of the application"
266
- state:
267
usage: "LABEL"
268
description: "State of the backend"
269
- total:
270
usage: "GAUGE"
271
description: "Number of backends"
272
- max_tx_duration_seconds:
273
usage: "GAUGE"
274
description: "Maximum duration of a transaction in seconds"
275
276
backends_waiting:
277
query: |
278
SELECT pg_catalog.count(*) AS total
279
FROM pg_catalog.pg_locks blocked_locks
280
JOIN pg_catalog.pg_locks blocking_locks
281
ON blocking_locks.locktype OPERATOR(pg_catalog.=) blocked_locks.locktype
282
AND blocking_locks.database IS NOT DISTINCT FROM blocked_locks.database
283
AND blocking_locks.relation IS NOT DISTINCT FROM blocked_locks.relation
284
AND blocking_locks.page IS NOT DISTINCT FROM blocked_locks.page
285
AND blocking_locks.tuple IS NOT DISTINCT FROM blocked_locks.tuple
286
AND blocking_locks.virtualxid IS NOT DISTINCT FROM blocked_locks.virtualxid
287
AND blocking_locks.transactionid IS NOT DISTINCT FROM blocked_locks.transactionid
288
AND blocking_locks.classid IS NOT DISTINCT FROM blocked_locks.classid
289
AND blocking_locks.objid IS NOT DISTINCT FROM blocked_locks.objid
290
AND blocking_locks.objsubid IS NOT DISTINCT FROM blocked_locks.objsubid
291
AND blocking_locks.pid OPERATOR(pg_catalog.<>) blocked_locks.pid
292
JOIN pg_catalog.pg_stat_activity blocking_activity ON blocking_activity.pid OPERATOR(pg_catalog.=) blocking_locks.pid
293
WHERE NOT blocked_locks.granted
294
metrics:
295
- total:
296
usage: "GAUGE"
297
description: "Total number of backends that are currently waiting on other queries"
298
299
pg_database:
300
query: |
301
SELECT datname
302
, pg_catalog.pg_database_size(datname) AS size_bytes
303
, pg_catalog.age(datfrozenxid) AS xid_age
304
, pg_catalog.mxid_age(datminmxid) AS mxid_age
305
FROM pg_catalog.pg_database
306
WHERE datallowconn
307
metrics:
308
- datname:
309
usage: "LABEL"
310
description: "Name of the database"
311
- size_bytes:
312
usage: "GAUGE"
313
description: "Disk space used by the database"
314
- xid_age:
315
usage: "GAUGE"
316
description: "Number of transactions from the frozen XID to the current one"
317
- mxid_age:
318
usage: "GAUGE"
319
description: "Number of multiple transactions (Multixact) from the frozen XID to the current one"
320
321
pg_postmaster:
322
query: |
323
SELECT EXTRACT(EPOCH FROM pg_postmaster_start_time) AS start_time
324
FROM pg_catalog.pg_postmaster_start_time()
325
metrics:
326
- start_time:
327
usage: "GAUGE"
328
description: "Time at which postgres started (based on epoch)"
329
330
pg_replication:
331
query: |
332
SELECT CASE WHEN (
333
NOT pg_catalog.pg_is_in_recovery()
334
OR pg_catalog.pg_last_wal_receive_lsn() OPERATOR(pg_catalog.=) pg_catalog.pg_last_wal_replay_lsn())
335
THEN 0
336
ELSE GREATEST (0,
337
EXTRACT(EPOCH FROM (pg_catalog.now() OPERATOR(pg_catalog.-) pg_catalog.pg_last_xact_replay_timestamp())))
338
END AS lag,
339
pg_catalog.pg_is_in_recovery() AS in_recovery,
340
EXISTS (TABLE pg_catalog.pg_stat_wal_receiver) AS is_wal_receiver_up,
341
(SELECT pg_catalog.count(*) FROM pg_catalog.pg_stat_replication) AS streaming_replicas
342
metrics:
343
- lag:
344
usage: "GAUGE"
345
description: "Replication lag behind primary in seconds"
346
- in_recovery:
347
usage: "GAUGE"
348
description: "Whether the instance is in recovery"
349
- is_wal_receiver_up:
350
usage: "GAUGE"
351
description: "Whether the instance wal_receiver is up"
352
- streaming_replicas:
353
usage: "GAUGE"
354
description: "Number of streaming replicas connected to the instance"
355
356
pg_replication_slots:
357
query: |
358
SELECT slot_name,
359
slot_type,
360
database,
361
active,
362
(CASE pg_catalog.pg_is_in_recovery()
363
WHEN TRUE THEN pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_last_wal_receive_lsn(), restart_lsn)
364
ELSE pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), restart_lsn)
365
END) as pg_wal_lsn_diff
366
FROM pg_catalog.pg_replication_slots
367
WHERE NOT temporary
368
metrics:
369
- slot_name:
370
usage: "LABEL"
371
description: "Name of the replication slot"
372
- slot_type:
373
usage: "LABEL"
374
description: "Type of the replication slot"
375
- database:
376
usage: "LABEL"
377
description: "Name of the database"
378
- active:
379
usage: "GAUGE"
380
description: "Flag indicating whether the slot is active"
381
- pg_wal_lsn_diff:
382
usage: "GAUGE"
383
description: "Replication lag in bytes"
384
385
pg_stat_archiver:
386
query: |
387
SELECT archived_count
388
, failed_count
389
, COALESCE(EXTRACT(EPOCH FROM (pg_catalog.now() OPERATOR(pg_catalog.-) last_archived_time)), -1) AS seconds_since_last_archival
390
, COALESCE(EXTRACT(EPOCH FROM (pg_catalog.now() OPERATOR(pg_catalog.-) last_failed_time)), -1) AS seconds_since_last_failure
391
, COALESCE(EXTRACT(EPOCH FROM last_archived_time), -1) AS last_archived_time
392
, COALESCE(EXTRACT(EPOCH FROM last_failed_time), -1) AS last_failed_time
393
, COALESCE(CAST(CAST('x' OPERATOR(pg_catalog.||) pg_catalog.right(pg_catalog.split_part(last_archived_wal, '.', 1), 16) AS pg_catalog.bit(64)) AS pg_catalog.int8), -1) AS last_archived_wal_start_lsn
394
, COALESCE(CAST(CAST('x' OPERATOR(pg_catalog.||) pg_catalog.right(pg_catalog.split_part(last_failed_wal, '.', 1), 16) AS pg_catalog.bit(64)) AS pg_catalog.int8), -1) AS last_failed_wal_start_lsn
395
, EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
396
FROM pg_catalog.pg_stat_archiver
397
predicate_query: |
398
SELECT NOT pg_catalog.pg_is_in_recovery()
399
OR pg_catalog.current_setting('archive_mode') OPERATOR(pg_catalog.=) 'always'
400
metrics:
401
- archived_count:
402
usage: "COUNTER"
403
description: "Number of WAL files that have been successfully archived"
404
- failed_count:
405
usage: "COUNTER"
406
description: "Number of failed attempts for archiving WAL files"
407
- seconds_since_last_archival:
408
usage: "GAUGE"
409
description: "Seconds since the last successful archival operation"
410
- seconds_since_last_failure:
411
usage: "GAUGE"
412
description: "Seconds since the last failed archival operation"
413
- last_archived_time:
414
usage: "GAUGE"
415
description: "Epoch of the last time WAL archiving succeeded"
416
- last_failed_time:
417
usage: "GAUGE"
418
description: "Epoch of the last time WAL archiving failed"
419
- last_archived_wal_start_lsn:
420
usage: "GAUGE"
421
description: "Archived WAL start LSN"
422
- last_failed_wal_start_lsn:
423
usage: "GAUGE"
424
description: "Last failed WAL LSN"
425
- stats_reset_time:
426
usage: "GAUGE"
427
description: "Time at which these statistics were last reset"
428
429
pg_stat_bgwriter:
430
runonserver: "<17.0.0"
431
query: |
432
SELECT checkpoints_timed
433
, checkpoints_req
434
, checkpoint_write_time
435
, checkpoint_sync_time
436
, buffers_checkpoint
437
, buffers_clean
438
, maxwritten_clean
439
, buffers_backend
440
, buffers_backend_fsync
441
, buffers_alloc
442
FROM pg_catalog.pg_stat_bgwriter
443
metrics:
444
- checkpoints_timed:
445
usage: "COUNTER"
446
description: "Number of scheduled checkpoints that have been performed"
447
- checkpoints_req:
448
usage: "COUNTER"
449
description: "Number of requested checkpoints that have been performed"
450
- checkpoint_write_time:
451
usage: "COUNTER"
452
description: "Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds"
453
- checkpoint_sync_time:
454
usage: "COUNTER"
455
description: "Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds"
456
- buffers_checkpoint:
457
usage: "COUNTER"
458
description: "Number of buffers written during checkpoints"
459
- buffers_clean:
460
usage: "COUNTER"
461
description: "Number of buffers written by the background writer"
462
- maxwritten_clean:
463
usage: "COUNTER"
464
description: "Number of times the background writer stopped a cleaning scan because it had written too many buffers"
465
- buffers_backend:
466
usage: "COUNTER"
467
description: "Number of buffers written directly by a backend"
468
- buffers_backend_fsync:
469
usage: "COUNTER"
470
description: "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)"
471
- buffers_alloc:
472
usage: "COUNTER"
473
description: "Number of buffers allocated"
474
475
pg_stat_bgwriter_17:
476
runonserver: ">=17.0.0"
477
name: pg_stat_bgwriter
478
query: |
479
SELECT buffers_clean
480
, maxwritten_clean
481
, buffers_alloc
482
, EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
483
FROM pg_catalog.pg_stat_bgwriter
484
metrics:
485
- buffers_clean:
486
usage: "COUNTER"
487
description: "Number of buffers written by the background writer"
488
- maxwritten_clean:
489
usage: "COUNTER"
490
description: "Number of times the background writer stopped a cleaning scan because it had written too many buffers"
491
- buffers_alloc:
492
usage: "COUNTER"
493
description: "Number of buffers allocated"
494
- stats_reset_time:
495
usage: "GAUGE"
496
description: "Time at which these statistics were last reset"
497
498
pg_stat_checkpointer:
499
runonserver: ">=17.0.0"
500
query: |
501
SELECT num_timed AS checkpoints_timed
502
, num_requested AS checkpoints_req
503
, restartpoints_timed
504
, restartpoints_req
505
, restartpoints_done
506
, write_time
507
, sync_time
508
, buffers_written
509
, EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
510
FROM pg_catalog.pg_stat_checkpointer
511
metrics:
512
- checkpoints_timed:
513
usage: "COUNTER"
514
description: "Number of scheduled checkpoints that have been performed"
515
- checkpoints_req:
516
usage: "COUNTER"
517
description: "Number of requested checkpoints that have been performed"
518
- restartpoints_timed:
519
usage: "COUNTER"
520
description: "Number of scheduled restartpoints due to timeout or after a failed attempt to perform it"
521
- restartpoints_req:
522
usage: "COUNTER"
523
description: "Number of requested restartpoints that have been performed"
524
- restartpoints_done:
525
usage: "COUNTER"
526
description: "Number of restartpoints that have been performed"
527
- write_time:
528
usage: "COUNTER"
529
description: "Total amount of time that has been spent in the portion of processing checkpoints and restartpoints where files are written to disk, in milliseconds"
530
- sync_time:
531
usage: "COUNTER"
532
description: "Total amount of time that has been spent in the portion of processing checkpoints and restartpoints where files are synchronized to disk, in milliseconds"
533
- buffers_written:
534
usage: "COUNTER"
535
description: "Number of buffers written during checkpoints and restartpoints"
536
- stats_reset_time:
537
usage: "GAUGE"
538
description: "Time at which these statistics were last reset"
539
540
pg_stat_database:
541
query: |
542
SELECT datname
543
, xact_commit
544
, xact_rollback
545
, blks_read
546
, blks_hit
547
, tup_returned
548
, tup_fetched
549
, tup_inserted
550
, tup_updated
551
, tup_deleted
552
, conflicts
553
, temp_files
554
, temp_bytes
555
, deadlocks
556
, blk_read_time
557
, blk_write_time
558
FROM pg_catalog.pg_stat_database
559
metrics:
560
- datname:
561
usage: "LABEL"
562
description: "Name of this database"
563
- xact_commit:
564
usage: "COUNTER"
565
description: "Number of transactions in this database that have been committed"
566
- xact_rollback:
567
usage: "COUNTER"
568
description: "Number of transactions in this database that have been rolled back"
569
- blks_read:
570
usage: "COUNTER"
571
description: "Number of disk blocks read in this database"
572
- blks_hit:
573
usage: "COUNTER"
574
description: "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)"
575
- tup_returned:
576
usage: "COUNTER"
577
description: "Number of rows returned by queries in this database"
578
- tup_fetched:
579
usage: "COUNTER"
580
description: "Number of rows fetched by queries in this database"
581
- tup_inserted:
582
usage: "COUNTER"
583
description: "Number of rows inserted by queries in this database"
584
- tup_updated:
585
usage: "COUNTER"
586
description: "Number of rows updated by queries in this database"
587
- tup_deleted:
588
usage: "COUNTER"
589
description: "Number of rows deleted by queries in this database"
590
- conflicts:
591
usage: "COUNTER"
592
description: "Number of queries canceled due to conflicts with recovery in this database"
593
- temp_files:
594
usage: "COUNTER"
595
description: "Number of temporary files created by queries in this database"
596
- temp_bytes:
597
usage: "COUNTER"
598
description: "Total amount of data written to temporary files by queries in this database"
599
- deadlocks:
600
usage: "COUNTER"
601
description: "Number of deadlocks detected in this database"
602
- blk_read_time:
603
usage: "COUNTER"
604
description: "Time spent reading data file blocks by backends in this database, in milliseconds"
605
- blk_write_time:
606
usage: "COUNTER"
607
description: "Time spent writing data file blocks by backends in this database, in milliseconds"
608
609
pg_stat_replication:
610
primary: true
611
query: |
612
SELECT usename
613
, COALESCE(application_name, '') AS application_name
614
, COALESCE(client_addr::text, '') AS client_addr
615
, COALESCE(client_port::text, '') AS client_port
616
, EXTRACT(EPOCH FROM backend_start) AS backend_start
617
, COALESCE(pg_catalog.age(backend_xmin), 0) AS backend_xmin_age
618
, pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), sent_lsn) AS sent_diff_bytes
619
, pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), write_lsn) AS write_diff_bytes
620
, pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), flush_lsn) AS flush_diff_bytes
621
, COALESCE(pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), replay_lsn),0) AS replay_diff_bytes
622
, COALESCE((EXTRACT(EPOCH FROM write_lag)),0)::float AS write_lag_seconds
623
, COALESCE((EXTRACT(EPOCH FROM flush_lag)),0)::float AS flush_lag_seconds
624
, COALESCE((EXTRACT(EPOCH FROM replay_lag)),0)::float AS replay_lag_seconds
625
FROM pg_catalog.pg_stat_replication
626
metrics:
627
- usename:
628
usage: "LABEL"
629
description: "Name of the replication user"
630
- application_name:
631
usage: "LABEL"
632
description: "Name of the application"
633
- client_addr:
634
usage: "LABEL"
635
description: "Client IP address"
636
- client_port:
637
usage: "LABEL"
638
description: "Client TCP port"
639
- backend_start:
640
usage: "COUNTER"
641
description: "Time when this process was started"
642
- backend_xmin_age:
643
usage: "COUNTER"
644
description: "The age of this standby's xmin horizon"
645
- sent_diff_bytes:
646
usage: "GAUGE"
647
description: "Difference in bytes from the last write-ahead log location sent on this connection"
648
- write_diff_bytes:
649
usage: "GAUGE"
650
description: "Difference in bytes from the last write-ahead log location written to disk by this standby server"
651
- flush_diff_bytes:
652
usage: "GAUGE"
653
description: "Difference in bytes from the last write-ahead log location flushed to disk by this standby server"
654
- replay_diff_bytes:
655
usage: "GAUGE"
656
description: "Difference in bytes from the last write-ahead log location replayed into the database on this standby server"
657
- write_lag_seconds:
658
usage: "GAUGE"
659
description: "Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written it"
660
- flush_lag_seconds:
661
usage: "GAUGE"
662
description: "Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written and flushed it"
663
- replay_lag_seconds:
664
usage: "GAUGE"
665
description: "Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written, flushed and applied it"
666
667
pg_settings:
668
query: |
669
SELECT name,
670
CASE setting WHEN 'on' THEN '1' WHEN 'off' THEN '0' ELSE setting END AS setting
671
FROM pg_catalog.pg_settings
672
WHERE vartype IN ('integer', 'real', 'bool')
673
ORDER BY 1
674
metrics:
675
- name:
676
usage: "LABEL"
677
description: "Name of the setting"
678
- setting:
679
usage: "GAUGE"
680
description: "Setting value"
681
682
pg_extensions:
683
query: |
684
SELECT
685
pg_catalog.current_database() as datname,
686
name as extname,
687
default_version,
688
installed_version,
689
CASE
690
WHEN default_version OPERATOR(pg_catalog.=) installed_version THEN 0
691
ELSE 1
692
END AS update_available
693
FROM pg_catalog.pg_available_extensions
694
WHERE installed_version IS NOT NULL
695
metrics:
696
- datname:
697
usage: "LABEL"
698
description: "Name of the database"
699
- extname:
700
usage: "LABEL"
701
description: "Extension name"
702
- default_version:
703
usage: "LABEL"
704
description: "Default version"
705
- installed_version:
706
usage: "LABEL"
707
description: "Installed version"
708
- update_available:
709
usage: "GAUGE"
710
description: "An update is available"
711
target_databases:
712
- '*'
713

The trusted source for open source

Talk to an expert
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
© 2026 Chainguard, Inc. All Rights Reserved.
Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.