Postgres

Supported OS Linux Windows Mac OS

통합 버전22.6.0

PostgreSQL 그래프

개요

Postgres 통합은 Postgres 데이터베이스에 대한 상태 및 성능 메트릭을 거의 실시간으로 제공합니다. 제공된 대시보드를 사용하여 이러한 메트릭을 시각화하고 모니터를 만들어 팀에 PostgreSQL 상태를 알릴 수 있습니다.

데이터베이스 모니터링(DBM)을 활성화하면 쿼리 성능 및 데이터베이스 상태에 대한 향상된 인사이트를 얻을 수 있습니다. 표준 통합, Datadog DBM은 쿼리 수준 메트릭, 실시간 및 과거 쿼리 스냅샷, 대기 이벤트 분석, 데이터베이스 로드, 쿼리 설명 계획, 차단 쿼리 인사이트 등을 제공합니다.

Postgres 버전 9.6-16이 지원됩니다.

설정

이 페이지는 표준 Postgres 에이전트 통합에 대해 설명합니다. Postgres용 데이터베이스 모니터링 제품을 찾고 계신다면 Datadog 데이터베이스 모니터링을 참조하세요.

설치

PostgreSQL 점검은 에이전트와 함께 패키지화되어 있습니다. PostgreSQL 메트릭 및 로그를 수집하려면 에이전트을 설치하세요.

구성

참고: PostgreSQL용 데이터베이스 모니터링을 설치하려면 데이터베이스 모니터링 설명서에서 호스팅 솔루션을 선택하여 지침을 확인하세요.

표준 통합을 단독으로 설치하는 경우에만 이 가이드의 다음 단계를 진행하세요.

Postgres 준비

표준 PostgreSQL 통합을 시작하려면 PostgreSQL 서버에 대한 적절한 액세스 권한이 있는 읽기 전용 datadog 사용자를 만드세요. PostgreSQL 데이터베이스에서 psql을 시작합니다.

PostgreSQL 버전 10 이상의 경우 실행합니다.

create user datadog with password '<PASSWORD>';
grant pg_monitor to datadog;
grant SELECT ON pg_stat_database to datadog;

이전 PostgreSQL 버전의 경우 다음을 실행합니다.

create user datadog with password '<PASSWORD>';
grant SELECT ON pg_stat_database to datadog;

권한이 올바른지 확인하려면 다음 명령을 실행합니다.

psql -h localhost -U datadog postgres -c \
"select * from pg_stat_database LIMIT(1);" \
&& echo -e "\e[0;32mPostgres connection - OK\e[0m" \
|| echo -e "\e[0;31mCannot connect to Postgres\e[0m"

비밀번호를 입력하라는 메시지가 표시되면 첫 번째 명령에 사용한 비밀번호를 입력합니다.

참고: PostgreSQL 버전 9.6 이하의 경우 다음을 실행하고 SECURITY DEFINER를 생성하여 pg_stat_activity에서 읽습니다.

CREATE FUNCTION pg_stat_activity() RETURNS SETOF pg_catalog.pg_stat_activity AS
$$ SELECT * from pg_catalog.pg_stat_activity; $$
LANGUAGE sql VOLATILE SECURITY DEFINER;

CREATE VIEW pg_stat_activity_dd AS SELECT * FROM pg_stat_activity();
grant SELECT ON pg_stat_activity_dd to datadog;

참고: 추가 테이블을 쿼리해야 하는 커스텀 메트릭을 생성하는 경우 해당 테이블에 대한 SELECT 권한을 datadog 사용자에게 부여해야 할 수 있습니다. 예: grant SELECT on <TABLE_NAME> to datadog;. 자세한 내용은 FAQ 섹션을 참조하세요.

호스트

호스트에서 실행 중인 에이전트에 이 점검을 구성하는 방법:

메트릭 수집
  1. postgres.d/conf.yaml 파일을 편집하여 host/port를 가리키도록 하고 마스터를 모니터로 설정합니다. 사용 가능한 모든 설정 옵션은 샘플 postgres.d/conf.yaml을 참조하세요.

    init_config:
    
    instances:
      ## @param host - string - required
      ## The hostname to connect to.
      ## NOTE: Even if the server name is "localhost", the agent connects to
      ## PostgreSQL using TCP/IP, unless you also provide a value for the sock key.
      #
      - host: localhost
    
        ## @param port - integer - optional - default: 5432
        ## The port to use when connecting to PostgreSQL.
        #
        # port: 5432
    
        ## @param username - string - required
        ## The Datadog username created to connect to PostgreSQL.
        #
        username: datadog
    
        ## @param password - string - optional
        ## The password associated with the Datadog user.
        #
        # password: <PASSWORD>
    
        ## @param dbname - string - optional - default: postgres
        ## The name of the PostgresSQL database to monitor.
        ## Note: If omitted, the default system Postgres database is queried.
        #
        # dbname: <DBNAME>
    
        # @param disable_generic_tags - boolean - optional - default: false
        # The integration will stop sending server tag as is redundant with host tag
        disable_generic_tags: true
    
  2. 관계 메트릭을 수집하려면, 에이전트를 모든 논리적 데이터베이스에 연결합니다. 이러한 데이터베이스는 자동으로 검색되거나 설정에서 각 데이터베이스를 명시적으로 나열할 수 있습니다.

    • 특정 인스턴스에서 논리 데이터베이스를 자동으로 검색하려면 해당 인스턴스에서 자동탐지를 활성화하세요.
    instances:
      - host: localhost
        # port: 5432
        database_autodiscovery:
          enabled: true
          # Optionally, set the include field to specify
          # a set of databases you are interested in discovering
          include:
            - mydb.*
            - example.*
        relations:
          - relation_regex: .*
    
    • 또는 설정에서 각 논리적 데이터베이스를 인스턴스로 목록화할 수 있습니다.
    instances:
      - host: example-service-primary.example-host.com
        # port: 5432
        username: datadog
        password: '<PASSWORD>'
        relations:
          - relation_name: products
          - relation_name: external_seller_products
      - host: example-service-replica-1.example-host.com
        # port: 5432
        username: datadog
        password: '<PASSWORD>'
        relations:
          - relation_regex: inventory_.*
            relkind:
              - r
              - i
      - host: example-service-replica-2.example-host.com
        # port: 5432
        username: datadog
        password: '<PASSWORD>'
        relations:
          - relation_regex: .*
    
  3. 에이전트를 다시 시작합니다.

트레이스 수집

Datadog 애플리케이션 성능 모니터링(APM)은 분산 시스템에서 트레이스를 볼 수 있도록 Postgres와 통합됩니다. 트레이스 수집은 Datadog 에이전트 v6+에서 기본적으로 활성화됩니다. 트레이스 수집을 시작하려면 다음을 수행합니다.

  1. Datadog에서 트레이스 수집을 활성화합니다.
  2. Postgres에 요청하는 애플리케이션 계측.
로그 수집

에이전트 버전 > 6.0에서 사용 가능

PostgreSQL 기본 로깅은 stderr입니다. 로그에는 자세한 정보가 포함되어 있지 않습니다. 로그 줄 접두어에 지정된 추가 세부 정보를 사용해 파일에 로그인하는 것이 좋습니다. 자세한 내용은 오류 보고 및 로깅에 대한 PostgreSQL 설명서를 참조하세요.

  1. /etc/postgresql/<VERSION>/main/postgresql.conf 파일에서 로깅을 설정합니다. 문 출력과 같은 정기적인 로그 결과를 보려면 로그 섹션에서 다음 파라미터의 주석 처리를 제거합니다.

      logging_collector = on
      log_directory = 'pg_log'  # directory where log files are written,
                                # can be absolute or relative to PGDATA
      log_filename = 'pg.log'   # log file name, can include pattern
      log_statement = 'all'     # log all queries
      #log_duration = on
      log_line_prefix= '%m [%p] %d %a %u %h %c '
      log_file_mode = 0644
      ## For Windows
      #log_destination = 'eventlog'
    
  2. 자세한 기간 메트릭을 수집하여 Datadog 인터페이스에서 검색할 수 있도록 하려면 문 자체를 사용해 인라인으로 설정해야 합니다. 위와 권장 설정의 차이점은 아래를 참조하세요. 참고: log_statementlog_duration 옵션은 모두 주석 처리되어 있습니다. 이 주제에 대한 자세한 내용은 같은 줄에 문/기간 로깅하기를 참조하세요.

    이 설정은 모든 문을 기록합니다. 기간에 따라 출력을 줄이려면 log_min_duration_statement 값을 원하는 최소 기간(밀리초)으로 설정합니다.

      log_min_duration_statement = 0    # -1 is disabled, 0 logs all statements
                                        # and their durations, > 0 logs only
                                        # statements running at least this number
                                        # of milliseconds
      #log_statement = 'all'
      #log_duration = on
    
  3. 로그 수집은 Datadog 에이전트에서 기본적으로 비활성화되어 있습니다. datadog.yaml 파일에서 활성화합니다.

    logs_enabled: true
    
  4. 이 설정 블록을 postgres.d/conf.yaml 파일에 추가하고 편집하여 PostgreSQL 로그 수집을 시작하세요.

    logs:
      - type: file
        path: "<LOG_FILE_PATH>"
        source: postgresql
        service: "<SERVICE_NAME>"
        #To handle multi line that starts with yyyy-mm-dd use the following pattern
        #log_processing_rules:
        #  - type: multi_line
        #    pattern: \d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])
        #    name: new_log_start_with_date
    

    servicepath 파라미터 값을 변경하여 환경을 설정합니다. 사용 가능한 모든 설정 옵션은 샘플 postgres.d/conf.yaml을 참조하세요.

  5. 에이전트를 다시 시작합니다.

도커(Docker)

컨테이너에서 실행 중인 에이전트에 이 점검을 구성하는 방법:

메트릭 수집

애플리케이션 컨테이너에 자동탐지 통합 템플릿을 Docker 레이블로 설정하세요.

LABEL "com.datadoghq.ad.check_names"='["postgres"]'
LABEL "com.datadoghq.ad.init_configs"='[{}]'
LABEL "com.datadoghq.ad.instances"='[{"host":"%%host%%", "port":5432,"username":"datadog","password":"<PASSWORD>"}]'
로그 수집

기본적으로 로그 수집은 Datadog 에이전트에서 비활성화되어 있습니다. 활성화하려면 Docker 로그 수집을 참고하세요.

그런 다음 Docker 레이블로 로그 통합을 설정하세요.

LABEL "com.datadoghq.ad.logs"='[{"source":"postgresql","service":"postgresql"}]'
트레이스 수집

컨테이너화된 앱용 APM은 Agent v6+에서 지원되지만 트레이스 수집을 시작하려면 추가 구성이 필요합니다.

Agent 컨테이너의 필수 환경 변수:

파라미터
<DD_API_KEY>api_key
<DD_APM_ENABLED>true
<DD_APM_NON_LOCAL_TRAFFIC>true

사용 가능한 환경 변수 및 구성의 전체 목록은 Docker 애플리케이션 추적을 참조하세요.

그런 다음 [Postgres에 요청하는 애플리케이션 컨테이너]를 계측하고3 DD_AGENT_HOST를 에이전트 컨테이너의 이름으로 설정합니다.

Kubernetes

쿠버네티스에서 실행 중인 에이전트에 이 점검을 구성하는 방법:

메트릭 수집

자동탐지 통합 템플릿을 애플리케이션 컨테이너의 포드 주석으로 설정합니다. 이외 템플릿은 또한 파일, configmap, key-value store로 설정할 수 있습니다.

주석 v1(Datadog 에이전트 v7.36 이하용)

apiVersion: v1
kind: Pod
metadata:
  name: postgres
  annotations:
    ad.datadoghq.com/postgresql.check_names: '["postgres"]'
    ad.datadoghq.com/postgresql.init_configs: '[{}]'
    ad.datadoghq.com/postgresql.instances: |
      [
        {
          "host": "%%host%%",
          "port":"5432",
          "username":"datadog",
          "password":"<PASSWORD>"
        }
      ]      
spec:
  containers:
    - name: postgres

주석 v2(Datadog 에이전트 v7.36 이상용)

apiVersion: v1
kind: Pod
metadata:
  name: postgres
  annotations:
    ad.datadoghq.com/postgres.checks: |
      {
        "postgres": {
          "init_config": {},
          "instances": [
            {
              "host": "%%host%%",
              "port":"5432",
              "username":"datadog",
              "password":"<PASSWORD>"
            }
          ]
        }
      }      
spec:
  containers:
    - name: postgres
로그 수집

Datadog 에이전트에서 기본적으로 로그 수집이 비활성화되어 있습니다. 활성화하려면 [쿠버네티스 로그 수집]을 확인하세요.

그런 다음 로그 통합을 포드 주석으로 설정합니다. 또한 파일, configmap, 또는 key-value store로 설정할 수 있습니다.

주석 v1/v2

apiVersion: v1
kind: Pod
metadata:
  name: postgres
  annotations:
    ad.datadoghq.com/postgres.logs: '[{"source":"postgresql","service":"<SERVICE_NAME>"}]'
spec:
  containers:
    - name: postgres
트레이스 수집

컨테이너화된 앱용 APM은 Agent v6+를 실행하는 호스트에서 지원되지만 트레이스 수집을 시작하려면 추가 구성이 필요합니다.

Agent 컨테이너의 필수 환경 변수:

파라미터
<DD_API_KEY>api_key
<DD_APM_ENABLED>true
<DD_APM_NON_LOCAL_TRAFFIC>true

사용 가능한 환경 변수 및 구성의 전체 목록은 Kubernetes 애플리케이션 추적Kubernetes DaemonSet 설정을 참조하세요.

그런 다음 Postgres에 요청하는 애플리케이션 컨테이너를 계측합니다.

ECS

ECS에서 실행 중인 에이전트에 이 점검을 구성하는 방법:

메트릭 수집

애플리케이션 컨테이너에 자동탐지 통합 템플릿을 Docker 레이블로 설정하세요.

{
  "containerDefinitions": [{
    "name": "postgres",
    "image": "postgres:latest",
    "dockerLabels": {
      "com.datadoghq.ad.check_names": "[\"postgres\"]",
      "com.datadoghq.ad.init_configs": "[{}]",
      "com.datadoghq.ad.instances": "[{\"host\":\"%%host%%\", \"port\":5432,\"username\":\"datadog\",\"password\":\"<PASSWORD>\"}]"
    }
  }]
}
로그 수집

기본적으로 로그 수집은 Datadog 에이전트에서 비활성화되어 있습니다. 활성화하려면 ECS 로그 수집을 참조하세요.

그런 다음 Docker 레이블로 로그 통합을 설정하세요.

{
  "containerDefinitions": [{
    "name": "postgres",
    "image": "postgres:latest",
    "dockerLabels": {
      "com.datadoghq.ad.logs": "[{\"source\":\"postgresql\",\"service\":\"postgresql\"}]"
    }
  }]
}
트레이스 수집

컨테이너화된 앱용 APM은 Agent v6+에서 지원되지만 트레이스 수집을 시작하려면 추가 구성이 필요합니다.

Agent 컨테이너의 필수 환경 변수:

파라미터
<DD_API_KEY>api_key
<DD_APM_ENABLED>true
<DD_APM_NON_LOCAL_TRAFFIC>true

사용 가능한 환경 변수 및 구성의 전체 목록은 Docker 애플리케이션 추적을 참조하세요.

그런 다음 Postgres에 요청하는 애플리케이션 컨테이너 을 계측하고 [DD_AGENT_HOST]를 EC2 비공개 IP 주소로 설정합니다.

검증

에이전트의 상태 하위 명령을 실행하고 점검 섹션에서 postgres를 찾습니다.

수집한 데이터

아래 나열된 메트릭 중 일부는 추가 설정이 필요합니다. 설정 가능한 모든 옵션은 샘플 postgres.d/conf.yaml을 참조하세요.

메트릭

postgresql.active_queries
(gauge)
Enabled with collect_activity_metrics. The number of active queries in this database. This metric (by default) is tagged with db, app, user.
postgresql.active_waiting_queries
(gauge)
Enabled with collect_activity_metrics. The number of waiting queries in this database in state active. This metric (by default) is tagged with db, app, user.
postgresql.activity.backend_xid_age
(gauge)
The age of the oldest backend's xid relative to latest stable xid. This metric (by default) is tagged with db, app, user.
Shown as transaction
postgresql.activity.backend_xmin_age
(gauge)
The age of the oldest backend's xmin horizon relative to latest stable xid. This metric (by default) is tagged with db, app, user.
Shown as transaction
postgresql.activity.xact_start_age
(gauge)
The age of the oldest active transactions. This metric (by default) is tagged with db, app, user.
Shown as second
postgresql.analyze.child_tables_done
(gauge)
Number of child tables scanned. This counter only advances when the phase is acquiring inherited sample rows. This metric is tagged with db, table, child_relation, phase.
postgresql.analyze.child_tables_total
(gauge)
Number of child tables. This metric is tagged with db, table, child_relation, phase.
postgresql.analyze.ext_stats_computed
(gauge)
Number of extended statistics computed. This counter only advances when the phase is computing extended statistics. This metric is tagged with db, table, child_relation, phase.
postgresql.analyze.ext_stats_total
(gauge)
Number of extended statistics. This metric is tagged with db, table, child_relation, phase.
postgresql.analyze.sample_blks_scanned
(gauge)
Number of heap blocks scanned. This metric is tagged with db, table, child_relation, phase.
Shown as block
postgresql.analyze.sample_blks_total
(gauge)
Total number of heap blocks that will be sampled. This metric is tagged with db, table, child_relation, phase.
Shown as block
postgresql.analyzed
(count)
Enabled with relations. The number of times this table has been manually analyzed. This metric is tagged with db, schema, table.
postgresql.autoanalyzed
(count)
Enabled with relations. The number of times this table has been analyzed by the autovacuum daemon. This metric is tagged with db, schema, table.
postgresql.autovacuumed
(count)
Enabled with relations. The number of times this table has been vacuumed by the autovacuum daemon. This metric is tagged with db, schema, table.
postgresql.before_xid_wraparound
(gauge)
The number of transactions that can occur until a transaction wraparound. This metric is tagged with db.
Shown as transaction
postgresql.bgwriter.buffers_alloc
(count)
The number of buffers allocated
postgresql.bgwriter.buffers_backend
(count)
The number of buffers written directly by a backend.
Shown as buffer
postgresql.bgwriter.buffers_backend_fsync
(count)
The of times a backend had to execute its own fsync call instead of the background writer.
postgresql.bgwriter.buffers_checkpoint
(count)
The number of buffers written during checkpoints.
postgresql.bgwriter.buffers_clean
(count)
The number of buffers written by the background writer.
postgresql.bgwriter.checkpoints_requested
(count)
The number of requested checkpoints that were performed.
postgresql.bgwriter.checkpoints_timed
(count)
The number of scheduled checkpoints that were performed.
postgresql.bgwriter.maxwritten_clean
(count)
The number of times the background writer stopped a cleaning scan due to writing too many buffers.
postgresql.bgwriter.sync_time
(count)
The total amount of checkpoint processing time spent synchronizing files to disk.
Shown as millisecond
postgresql.bgwriter.write_time
(count)
The total amount of checkpoint processing time spent writing files to disk.
Shown as millisecond
postgresql.blk_read_time
(count)
Time spent reading data file blocks by backends in this database if trackiotiming is enabled. This metric is tagged with db.
Shown as millisecond
postgresql.blk_write_time
(count)
Time spent writing data file blocks by backends in this database if trackiotiming is enabled. This metric is tagged with db.
Shown as millisecond
postgresql.buffer_hit
(gauge)
The number of times disk blocks were found in the buffer cache, preventing the need to read from the database. This metric is tagged with db.
Shown as hit
postgresql.buffercache.dirty_buffers
(gauge)
Number of dirty shared buffers. pg_buffercache extension needs to be installed. This metric is tagged by db, schema and relation.
Shown as buffer
postgresql.buffercache.pinning_backends
(gauge)
Number of backends pinning shared buffers. pg_buffercache extension needs to be installed. This metric is tagged by db, schema and relation.
postgresql.buffercache.unused_buffers
(gauge)
Number of unused shared buffers. pg_buffercache extension needs to be installed.
Shown as buffer
postgresql.buffercache.usage_count
(gauge)
Sum of shared buffers' usagecount. pgbuffercache extension needs to be installed. This metric is tagged by db, schema and relation.
postgresql.buffercache.used_buffers
(gauge)
Number of shared buffers. pg_buffercache extension needs to be installed. This metric is tagged by db, schema and relation.
Shown as buffer
postgresql.checksums.checksum_failures
(count)
The number of checksum failures in this database. This metric is tagged with db.
postgresql.checksums.enabled
(count)
Whether database checksums are enabled. Value is always 1 and tagged with enabled:true or enabled:false. This metric is tagged with db.
postgresql.cluster_vacuum.heap_blks_scanned
(gauge)
Number of heap blocks scanned. This counter only advances when the phase is seq scanning heap. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, command, phase, index.
Shown as block
postgresql.cluster_vacuum.heap_blks_total
(gauge)
Total number of heap blocks in the table. This number is reported as of the beginning of seq scanning heap. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, command, phase, index.
Shown as block
postgresql.cluster_vacuum.heap_tuples_scanned
(gauge)
Number of heap tuples scanned. This counter only advances when the phase is seq scanning heap, index scanning heap or writing new heap. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, command, phase, index.
postgresql.cluster_vacuum.heap_tuples_written
(gauge)
Number of heap tuples written. This counter only advances when the phase is seq scanning heap, index scanning heap or writing new heap. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, command, phase, index.
postgresql.cluster_vacuum.index_rebuild_count
(gauge)
Number of indexes rebuilt. This counter only advances when the phase is rebuilding index. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, command, phase, index.
postgresql.commits
(gauge)
The number of transactions that have been committed in this database. This metric is tagged with db.
Shown as transaction
postgresql.conflicts.bufferpin
(count)
Number of queries in this database that have been canceled due to pinned buffers. Buffer pin conflicts will occur when the walreceiver process tries to apply a buffer cleanup like HOT chain pruning. This require a complete lock of the buffer and any query pinning the buffer will conflict with the cleaning. This metric is tagged with db.
Shown as query
postgresql.conflicts.deadlock
(count)
Number of queries in this database that have been canceled due to deadlocks. Deadlock conflicts will happen when the walreceiver tries to apply a buffer like HOT chain pruning. If the conflict takes more than deadlock_timeout seconds, a deadlock check will be triggered and conflicting queries will be canceled until the buffer is unpinned. This metric is tagged with db.
Shown as query
postgresql.conflicts.lock
(count)
Number of queries in this database that have been canceled due to lock timeouts. This will occur when the walreceiver process tries to apply a change requiring an ACCESS EXCLUSIVE lock while a query on the replica is reading the table. The conflicting query will be killed after waiting up to maxstandbystreaming_delay seconds. This metric is tagged with db.
Shown as query
postgresql.conflicts.snapshot
(count)
Number of queries in this database that have been canceled due to old snapshots. Snapshot conflict will occur when a VACUUM is replayed, removing tuples currently read on a standby. This metric is tagged with db.
Shown as query
postgresql.conflicts.tablespace
(count)
Number of queries in this database that have been canceled due to dropped tablespaces. This will occur when a temp_tablespace is dropped while being used on a standby. This metric is tagged with db.
Shown as query
postgresql.connections
(gauge)
The number of active connections to this database. If DBM is enabled, this metric is tagged with state, app, db and user
Shown as connection
postgresql.control.checkpoint_delay
(gauge)
The time since the last checkpoint.
Shown as second
postgresql.control.timeline_id
(gauge)
The current timeline id.
postgresql.create_index.blocks_done
(gauge)
Number of blocks already processed in the current phase. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.
postgresql.create_index.blocks_total
(gauge)
Total number of blocks to be processed in the current phase. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.
postgresql.create_index.lockers_done
(gauge)
Number of lockers already waited for. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.
postgresql.create_index.lockers_total
(gauge)
Total number of lockers to wait for, when applicable. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.
postgresql.create_index.partitions_done
(gauge)
When creating an index on a partitioned table, this column is set to the number of partitions on which the index has been created. This field is 0 during a REINDEX. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.
postgresql.create_index.partitions_total
(gauge)
When creating an index on a partitioned table, this column is set to the total number of partitions on which the index is to be created. This field is 0 during a REINDEX. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.
postgresql.create_index.tuples_done
(gauge)
Number of tuples already processed in the current phase. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.
postgresql.create_index.tuples_total
(gauge)
Total number of tuples to be processed in the current phase. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.
postgresql.database_size
(gauge)
The disk space used by this database. This metric is tagged with db.
Shown as byte
postgresql.db.count
(gauge)
The number of available databases.
Shown as item
postgresql.dead_rows
(gauge)
Enabled with relations. The estimated number of dead rows. This metric is tagged with db, schema, table.
Shown as row
postgresql.deadlocks
(gauge)
The rate of deadlocks detected in this database. This metric is tagged with db.
Shown as lock
postgresql.deadlocks.count
(count)
The number of deadlocks detected in this database. This metric is tagged with db.
Shown as lock
postgresql.disk_read
(gauge)
The number of disk blocks read in this database. This metric is tagged with db.
Shown as block
postgresql.function.calls
(rate)
Enabled with collect_function_metrics. The number of calls made to a function. This metric is tagged with db, schema, function.
postgresql.function.self_time
(rate)
Enabled with collect_function_metrics. Total time spent in this function itself, not including other functions called by it. This metric is tagged with db, schema, function.
postgresql.function.total_time
(rate)
Enabled with collect_function_metrics. Total time spent in this function and all other functions called by it. This metric is tagged with db, schema, function.
postgresql.heap_blocks_hit
(gauge)
Enabled with relations. The number of buffer hits in this table. This metric is tagged with db, schema, table.
Shown as hit
postgresql.heap_blocks_read
(gauge)
Enabled with relations. The number of disk blocks read from this table. This metric is tagged with db, schema, table.
Shown as block
postgresql.index_bloat
(gauge)
Enabled with collect_bloat_metrics. The estimated percentage of index bloat. This metric is tagged with db, schema, table, index.
Shown as percent
postgresql.index_blocks_hit
(gauge)
Enabled with relations. The number of buffer hits in all indexes on this table. This metric is tagged with db, schema, table.
Shown as hit
postgresql.index_blocks_read
(gauge)
Enabled with relations. The number of disk blocks read from all indexes on this table. This metric is tagged with db, schema, table.
Shown as block
postgresql.index_rel_rows_fetched
(gauge)
Enabled with relations. The number of live rows fetched by index scans. This metric is tagged with db, schema, table.
Shown as row
postgresql.index_rel_scans
(gauge)
Enabled with relations. The overall number of index scans initiated on this table. This metric is tagged with db, schema, table.
Shown as scan
postgresql.index_rows_fetched
(gauge)
Enabled with relations. The number of live rows fetched by index scans. This metric is tagged with db, schema, table, index.
Shown as row
postgresql.index_rows_read
(gauge)
Enabled with relations. The number of index entries returned by scans on this index. This metric is tagged with db, schema, table, index.
Shown as row
postgresql.index_scans
(gauge)
Enabled with relations. The number of index scans initiated on this table. This metric is tagged with db, schema, table, index
Shown as scan
postgresql.index_size
(gauge)
Enabled with relations. The total disk space used by indexes attached to the specified table. This metric is tagged with db, schema, table.
Shown as byte
postgresql.individual_index_size
(gauge)
The disk space used by a specified index. This metric is tagged with db, schema, table, index.
Shown as byte
postgresql.io.evictions
(count)
The number of times a block has been written out from a shared or local buffer in order to make it available for another use. This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)
Shown as millisecond
postgresql.io.extend_time
(count)
The time spent in extend operations (if trackiotiming is enabled, otherwise zero). This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)
Shown as millisecond
postgresql.io.extends
(count)
The number of relation extend operations. This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)
postgresql.io.fsync_time
(count)
The time spent in fsync operations (if trackiotiming is enabled, otherwise zero). This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)
Shown as millisecond
postgresql.io.fsyncs
(count)
The number of fsync calls. This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)
postgresql.io.hits
(count)
The number of times a desired block was found in a shared buffer. This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)
Shown as millisecond
postgresql.io.read_time
(count)
The time spent in read operations (if trackiotiming is enabled, otherwise zero). This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)
Shown as millisecond
postgresql.io.reads
(count)
The number of read operations. This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)
postgresql.io.write_time
(count)
The time spent in write operations (if trackiotiming is enabled, otherwise zero). This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)
Shown as millisecond
postgresql.io.writes
(count)
The number of write operations. This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)
postgresql.last_analyze_age
(gauge)
Last time at which this table was manually analyzed. This metric is tagged with db, schema, table.
Shown as second
postgresql.last_autoanalyze_age
(gauge)
Last time at which this table was analyzed by the autovacuum daemon. This metric is tagged with db, schema, table.
Shown as second
postgresql.last_autovacuum_age
(gauge)
Last time at which this table was vacuumed by the autovacuum daemon. This metric is tagged with db, schema, table.
Shown as second
postgresql.last_vacuum_age
(gauge)
Last time at which this table was manually vacuumed (not counting VACUUM FULL). This metric is tagged with db, schema, table.
Shown as second
postgresql.live_rows
(gauge)
Enabled with relations. The estimated number of live rows. This metric is tagged with db, schema, table.
Shown as row
postgresql.locks
(gauge)
Enabled with relations. The number of locks active for this database. This metric is tagged with db, lockmode, locktype, schema, table, granted.
Shown as lock
postgresql.max_connections
(gauge)
The maximum number of client connections allowed to this database.
Shown as connection
postgresql.percent_usage_connections
(gauge)
The number of connections to this database as a fraction of the maximum number of allowed connections.
Shown as fraction
postgresql.pg_stat_statements.dealloc
(count)
The number of times pgstatstatements had to evict least executed queries because pgstatstatements.max was reached.
postgresql.queries.blk_read_time
(count)
Total time spent reading blocks per query_signature, db, and user. (DBM only)
Shown as nanosecond
postgresql.queries.blk_write_time
(count)
Total time spent writing blocks per query_signature, db, and user. (DBM only)
Shown as nanosecond
postgresql.queries.count
(count)
The total query execution count per query_signature, db, and user. (DBM only)
Shown as query
postgresql.queries.duration.max
(gauge)
The age of the longest running query per user, db and app. (DBM only)
Shown as nanosecond
postgresql.queries.duration.sum
(gauge)
The sum of the age of all running queries per user, db and app. (DBM only)
Shown as nanosecond
postgresql.queries.local_blks_dirtied
(count)
Total number of local blocks dirtied per query_signature, db, and user. (DBM only)
Shown as block
postgresql.queries.local_blks_hit
(count)
Total number of local block cache hits per query_signature, db, and user. (DBM only)
Shown as block
postgresql.queries.local_blks_read
(count)
Total number of local blocks read per query_signature, db, and user. (DBM only)
Shown as block
postgresql.queries.local_blks_written
(count)
Total number of local blocks written per query_signature, db, and user. (DBM only)
Shown as block
postgresql.queries.rows
(count)
The total number of rows retrieved or affected per query_signature, db, and user. (DBM only)
Shown as row
postgresql.queries.shared_blks_dirtied
(count)
Total number of shared blocks dirtied per query_signature, db, and user. (DBM only)
Shown as block
postgresql.queries.shared_blks_hit
(count)
Total number of shared block cache hits per query_signature, db, and user. (DBM only)
Shown as block
postgresql.queries.shared_blks_read
(count)
Total number of shared blocks read per query_signature, db, and user. (DBM only)
Shown as block
postgresql.queries.shared_blks_written
(count)
Total number of shared blocks written per query_signature, db, and user. (DBM only)
Shown as block
postgresql.queries.temp_blks_read
(count)
Total number of temp blocks read per query_signature, db, and user. (DBM only)
Shown as block
postgresql.queries.temp_blks_written
(count)
Total number of temp blocks written per query_signature, db, and user. (DBM only)
Shown as block
postgresql.queries.time
(count)
The total query execution time per query_signature, db, and user. (DBM only)
Shown as nanosecond
postgresql.relation.all_visible
(gauge)
Number of pages that are marked as all visible in the table's visibility map. This is only an estimation used by the planner and is updated by VACUUM or ANALYZE. This metric is tagged with db, schema, table, partition_of
postgresql.relation.pages
(gauge)
Size of a table in pages (1 page == 8KB by default). This is only an estimation used by the planner and is updated by VACUUM or ANALYZE. This metric is tagged with db, schema, table, partition_of.
postgresql.relation.tuples
(gauge)
Number of live rows in the table. This is only an estimation used by the planner and is updated by VACUUM or ANALYZE. If the table has never been vacuumed or analyze, -1 will be reported. This metric is tagged with db, schema, table, partition_of
postgresql.relation.xmin
(gauge)
Transaction ID of the latest relation's modification in pg_class. This metric is tagged with db, schema, table
postgresql.relation_size
(gauge)
The disk space used by the specified table. TOAST data, indexes, free space map and visibility map are not included. This metric is tagged with db, schema, table.
Shown as byte
postgresql.replication.backend_xmin_age
(gauge)
The age of the standby server's xmin horizon (relative to latest stable xid) reported by hotstandbyfeedback.
postgresql.replication.wal_flush_lag
(gauge)
Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written and flushed it (but not yet applied it). This can be used to gauge the delay that synchronous_commit level on incurred while committing if this server was configured as a synchronous standby. Only available with postgresql 10 and newer.
Shown as second
postgresql.replication.wal_replay_lag
(gauge)
Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written, flushed and applied it. This can be used to gauge the delay that synchronouscommit level remoteapply incurred while committing if this server was configured as a synchronous standby. Only available with postgresql 10 and newer.
Shown as second
postgresql.replication.wal_write_lag
(gauge)
Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written it (but not yet flushed it or applied it). This can be used to gauge the delay that synchronouscommit level remotewrite incurred while committing if this server was configured as a synchronous standby. Only available with postgresql 10 and newer.
Shown as second
postgresql.replication_delay
(gauge)
The current replication delay in seconds. Only available with postgresql 9.1 and newer
Shown as second
postgresql.replication_delay_bytes
(gauge)
The current replication delay in bytes. Only available with postgresql 9.2 and newer
Shown as byte
postgresql.replication_slot.catalog_xmin_age
(gauge)
The age of the oldest transaction affecting the system catalogs that this slot needs the database to retain. VACUUM cannot remove catalog tuples deleted by any later transaction. This metric is tagged with slotname, slottype, slotpersistence, slotstate.
Shown as transaction
postgresql.replication_slot.confirmed_flush_delay_bytes
(gauge)
The delay in bytes between the current WAL position and last position this slot's consumer confirmed. This is only available for logical replication slots. This metric is tagged with slotname, slottype, slotpersistence, slotstate.
Shown as byte
postgresql.replication_slot.restart_delay_bytes
(gauge)
The amount of WAL bytes that the consumer of this slot may require and won't be automatically removed during checkpoints unless it exceeds maxslotwalkeepsize parameter. Nothing is reported if there's no WAL reservation for this slot. This metric is tagged with slotname, slottype, slotpersistence, slotstate.
Shown as byte
postgresql.replication_slot.spill_bytes
(count)
Amount of decoded transaction data spilled to disk while performing decoding of changes from WAL for this slot. This and other spill counters can be used to gauge the I/O occurred during logical decoding and allow tuning logicaldecodingworkmem. Extracted from pgstatreplicationslots. Only available with PostgreSQL 14 and newer. This metric is tagged with slotname, slottype, slot_state.
Shown as byte
postgresql.replication_slot.spill_count
(count)
Number of times transactions were spilled to disk while decoding changes from WAL for this slot. This counter is incremented each time a transaction is spilled, and the same transaction may be spilled multiple times. Extracted from pgstatreplicationslots. Only available with PostgreSQL 14 and newer. This metric is tagged with slotname, slottype, slotstate.
postgresql.replication_slot.spill_txns
(count)
Number of transactions spilled to disk once the memory used by logical decoding to decode changes from WAL has exceeded logicaldecodingworkmem. The counter gets incremented for both top-level transactions and subtransactions. Extracted from pgstatreplicationslots. Only available with PostgreSQL 14 and newer. This metric is tagged with slotname, slottype, slot_state.
Shown as transaction
postgresql.replication_slot.stream_bytes
(count)
Amount of transaction data decoded for streaming in-progress transactions to the decoding output plugin while decoding changes from WAL for this slot. Extracted from pgstatreplicationslots. Only available with PostgreSQL 14 and newer. This metric is tagged with slotname, slottype, slotstate.
Shown as byte
postgresql.replication_slot.stream_count
(count)
Number of times in-progress transactions were streamed to the decoding output plugin while decoding changes from WAL for this slot. Extracted from pgstatreplicationslots. Only available with PostgreSQL 14 and newer. This metric is tagged with slotname, slottype, slotstate.
postgresql.replication_slot.stream_txns
(count)
Number of in-progress transactions streamed to the decoding output plugin after the memory used by logical decoding to decode changes from WAL for this slot has exceeded logicaldecodingworkmem. Extracted from pgstatreplicationslots. Only available with PostgreSQL 14 and newer. This metric is tagged with slotname, slottype, slot_state.
Shown as transaction
postgresql.replication_slot.total_bytes
(count)
Amount of transaction data decoded for sending transactions to the decoding output plugin while decoding changes from WAL for this slot. Extracted from pgstatreplicationslots. Only available with PostgreSQL 14 and newer. This metric is tagged with slotname, slottype, slotstate.
Shown as byte
postgresql.replication_slot.total_txns
(count)
Number of decoded transactions sent to the decoding output plugin for this slot. Extracted from pgstatreplicationslots. Only available with PostgreSQL 14 and newer. This metric is tagged with slotname, slottype, slotstate.
Shown as transaction
postgresql.replication_slot.xmin_age
(gauge)
The age of the oldest transaction that this slot needs the database to retain. Only physical replication slot will have a xmin. Orphaned replication slot (no consumer or consumer is not connected) will prevent the xmin horizon from progressing. This metric is tagged with slotname, slottype, slotpersistence, slotstate.
Shown as transaction
postgresql.rollbacks
(gauge)
The number of transactions that have been rolled back in this database. This metric is tagged with db.
Shown as transaction
postgresql.rows_deleted
(gauge)
Enabled with relations. The number of rows deleted by queries in this database. This metric is tagged with db.
Shown as row
postgresql.rows_fetched
(gauge)
The number of rows fetched by queries in this database. This metric is tagged with db.
Shown as row
postgresql.rows_hot_updated
(gauge)
Enabled with relations. The number of rows HOT updated, meaning no separate index update was needed. This metric is tagged with db, schema, table.
Shown as row
postgresql.rows_inserted
(gauge)
Enabled with relations. The number of rows inserted by queries in this database. This metric is tagged with db.
Shown as row
postgresql.rows_returned
(gauge)
The number of rows returned by queries in this database. This metric is tagged with db.
Shown as row
postgresql.rows_updated
(gauge)
Enabled with relations. The number of rows updated by queries in this database. This metric is tagged with db.
Shown as row
postgresql.running
(gauge)
The number of instances running.
postgresql.seq_rows_read
(gauge)
Enabled with relations. The number of live rows fetched by sequential scans. This metric is tagged with db, schema, table.
Shown as row
postgresql.seq_scans
(gauge)
Enabled with relations. The number of sequential scans initiated on this table. This metric is tagged with db, schema, table.
Shown as scan
postgresql.sessions.abandoned
(count)
Number of database sessions to this database that were terminated because connection to the client was lost. This metric is tagged with db.
Shown as session
postgresql.sessions.active_time
(count)
Time spent executing SQL statements in this database, in milliseconds (this corresponds to the states active and fastpath function call in pgstatactivity). This metric is tagged with db.
Shown as millisecond
postgresql.sessions.count
(count)
Total number of sessions established to this database. This metric is tagged with db.
Shown as session
postgresql.sessions.fatal
(count)
Number of database sessions to this database that were terminated by fatal errors. This metric is tagged with db.
Shown as session
postgresql.sessions.idle_in_transaction_time
(count)
Time spent idling while in a transaction in this database, in milliseconds (this corresponds to the states idle in transaction and idle in transaction (aborted) in pgstatactivity). This metric is tagged with db.
Shown as millisecond
postgresql.sessions.killed
(count)
Number of database sessions to this database that were terminated by operator intervention. This metric is tagged with db.
Shown as session
postgresql.sessions.session_time
(count)
Time spent by database sessions in this database, in milliseconds (note that statistics are only updated when the state of a session changes, so if sessions have been idle for a long time, this idle time won't be included). This metric is tagged with db.
Shown as millisecond
postgresql.slru.blks_exists
(count)
Number of blocks checked for existence for SLRU (simple least-recently-used) cache. Only CommitTs and MultiXactOffset caches are checking if blocks are already present on disk. This metric is tagged with slru_name.
Shown as block
postgresql.slru.blks_hit
(count)
Number of times disk blocks were found already in the SLRU (simple least-recently-used), so that a read was not necessary (this only includes hits in the SLRU, not the operating system's file system cache). This metric is tagged with slru_name.
Shown as block
postgresql.slru.blks_read
(count)
Number of disk blocks read for SLRU (simple least-recently-used) cache. SLRU caches are created with a fixed number of pages. When all pages are used, the least recently used block is dumped on disk to create space. Access to the evicted block will require data to be read from the disk and loaded back in an SLRU cache page, increasing the block read count. This metric is tagged with slru_name.
Shown as block
postgresql.slru.blks_written
(count)
Number of disk blocks written for SLRU (simple least-recently-used) cache. SLRU caches are created with a fixed number of pages. When all pages are used, the least recently used block is dumped on disk to create space. A block eviction doesn't necessarily generate disk write as the block could have been written in a previous eviction. This metric is tagged with slru_name.
Shown as block
postgresql.slru.blks_zeroed
(count)
Number of blocks zeroed during initializations of SLRU (simple least-recently-used) cache. SLRU caches are created with a fixed number of pages. For Subtrans, Xact and CommitTs caches, the global transactionId is used to get the page number. Thus, it will increase with the transaction throughput. This metric is tagged with slru_name.
Shown as block
postgresql.slru.flushes
(count)
Number of flush of dirty data for SLRU (simple least-recently-used) cache. CommitTs, MultiXact, Subtrans, Xact caches flush will happen during checkpoint. MultiXact cache flush may happen during vacuum. This metric is tagged with slru_name.
postgresql.slru.truncates
(count)
Number of truncates for SLRU (simple least-recently-used) cache. For CommitTs, Xact and MultiXact, truncates will happen when the frozenID progresses. For Subtrans, a truncate can occur during restartpoint and a checkpoint. This metric is tagged with slru_name.
postgresql.snapshot.xip_count
(gauge)
Report the number of active transactions based on pgsnapshotxip(pgcurrentsnapshot()).
postgresql.snapshot.xmax
(gauge)
Report the next transaction ID that will be assigned based on pgsnapshotxmax(pgcurrentsnapshot()).
postgresql.snapshot.xmin
(gauge)
Report the lowest transaction ID still active based on pgsnapshotxmin(pgcurrentsnapshot()). All transaction IDs less than xmin are either committed and visible, or rolled back and dead.
postgresql.subscription.apply_error
(count)
Number of errors that occurred while applying changes. Extracted from pgstatsubscriptionstats. Only available on PostgreSQL 15 or higher. This metric is tagged with subscriptionname.
postgresql.subscription.last_msg_receipt_age
(gauge)
Age of receipt time of the last message received from origin WAL sender. Extracted from pgstatsubscription. Only available on PostgreSQL 12 or higher. This metric is tagged with subscription_name.
Shown as second
postgresql.subscription.last_msg_send_age
(gauge)
Age of last message received from origin WAL sender. Extracted from pgstatsubscription. Only available on PostgreSQL 12 or higher. This metric is tagged with subscription_name.
Shown as second
postgresql.subscription.latest_end_age
(gauge)
Age of last write-ahead log location reported to origin WAL sender. Extracted from pgstatsubscription. Only available on PostgreSQL 12 or higher. This metric is tagged with subscription_name.
Shown as second
postgresql.subscription.state
(gauge)
State of a subscription per relation and subscription. Extracted from pgsubscriptionrel. Only available on PostgreSQL 14 or higher. This metric is tagged with subscription_name, relation, state.
postgresql.subscription.sync_error
(count)
Number of errors that occurred during the initial table synchronization. Extracted from pgstatsubscriptionstats. Only available on PostgreSQL 15 or higher. This metric is tagged with subscriptionname.
postgresql.table.count
(gauge)
The number of user tables in this database. This metric is tagged with db, schema.
Shown as table
postgresql.table_bloat
(gauge)
Enabled with collect_bloat_metrics. The estimated percentage of table bloat. This metric is tagged with db, schema, table.
Shown as percent
postgresql.table_size
(gauge)
Enabled with relations. The disk space used by the specified table with TOAST data. Free space map and visibility map are not included. This metric is tagged with db, schema, table.
Shown as byte
postgresql.temp_bytes
(gauge)
The amount of data written to temporary files by queries in this database. This metric is tagged with db.
Shown as byte
postgresql.temp_files
(gauge)
The number of temporary files created by queries in this database. This metric is tagged with db.
Shown as file
postgresql.toast.autovacuumed
(count)
Enabled with relations. The number of times the toast table of a relation has been autovacuumed. This metric is tagged with db, schema, table.
postgresql.toast.dead_rows
(gauge)
Enabled with relations. The number of dead rows on the toast table of a relation. This metric is tagged with db, schema, table.
postgresql.toast.index_scans
(count)
Enabled with relations. The number of index scans done on the toast table of a relation. This metric is tagged with db, schema, table.
postgresql.toast.last_autovacuum_age
(gauge)
Last time at which the toast table of this table was vacuumed by the autovacuum daemon. This metric is tagged with db, schema, table.
Shown as second
postgresql.toast.last_vacuum_age
(gauge)
Last time at which the toast table of this table was manually vacuumed (not counting VACUUM FULL). This metric is tagged with db, schema, table.
Shown as second
postgresql.toast.live_rows
(gauge)
Enabled with relations. The number of live rows on the toast table of a relation. This metric is tagged with db, schema, table.
postgresql.toast.rows_deleted
(count)
Enabled with relations. The number of deleted rows on the toast table of a relation. This metric is tagged with db, schema, table.
postgresql.toast.rows_fetched
(count)
Enabled with relations. The number of fetched rows on the toast table of a relation. This metric is tagged with db, schema, table.
postgresql.toast.rows_inserted
(count)
Enabled with relations. The number of inserted rows on the toast table of a relation. This metric is tagged with db, schema, table.
postgresql.toast.vacuumed
(count)
Enabled with relations. The number times the toast table of a relation has been vacuumed. This metric is tagged with db, schema, table.
postgresql.toast_blocks_hit
(gauge)
Enabled with relations. The number of buffer hits in this table's TOAST table. This metric is tagged with db, schema, table.
Shown as hit
postgresql.toast_blocks_read
(gauge)
Enabled with relations. The number of disk blocks read from this table's TOAST table. This metric is tagged with db, schema, table.
Shown as block
postgresql.toast_index_blocks_hit
(gauge)
Enabled with relations. The number of buffer hits in this table's TOAST table index. This metric is tagged with db, schema, table.
Shown as block
postgresql.toast_index_blocks_read
(gauge)
Enabled with relations. The number of disk blocks read from this table's TOAST table index. This metric is tagged with db, schema, table.
Shown as block
postgresql.toast_size
(gauge)
The total disk space used by the toast table attached to the specified table. This metric is tagged with db, schema, table.
Shown as byte
postgresql.total_size
(gauge)
Enabled with relations. The total disk space used by the table, including indexes and TOAST data. This metric is tagged with db, schema, table.
Shown as byte
postgresql.transactions.duration.max
(gauge)
The age of the longest running transaction per user, db and app. (DBM only)
Shown as nanosecond
postgresql.transactions.duration.sum
(gauge)
The sum of the age of all running transactions per user, db and app. (DBM only)
Shown as nanosecond
postgresql.transactions.idle_in_transaction
(gauge)
Enabled with collect_activity_metrics. The number of 'idle in transaction' transactions in this database. This metric (by default) is tagged with db, app, user.
Shown as transaction
postgresql.transactions.open
(gauge)
Enabled with collect_activity_metrics. The number of open transactions in this database. This metric (by default) is tagged with db, app, user.
Shown as transaction
postgresql.uptime
(gauge)
The uptime of the server in seconds.
Shown as second
postgresql.vacuum.heap_blks_scanned
(gauge)
Number of heap blocks scanned. Because the visibility map is used to optimize scans, some blocks will be skipped without inspection; skipped blocks are included in this total, so that this number will eventually become equal to heapblkstotal when the vacuum is complete. This counter only advances when the phase is scanning heap. This metric is tagged with db, table, phase.
Shown as block
postgresql.vacuum.heap_blks_total
(gauge)
Total number of heap blocks in the table. This number is reported as of the beginning of the scan; blocks added later will not be (and need not be) visited by this VACUUM. This metric is tagged with db, table, phase.
Shown as block
postgresql.vacuum.heap_blks_vacuumed
(gauge)
Number of heap blocks vacuumed. Unless the table has no indexes, this counter only advances when the phase is vacuuming heap. Blocks that contain no dead tuples are skipped, so the counter may sometimes skip forward in large increments. This metric is tagged with db, table, phase.
Shown as block
postgresql.vacuum.index_vacuum_count
(gauge)
Number of completed index vacuum cycles. This metric is tagged with db, table, phase.
Shown as block
postgresql.vacuum.max_dead_tuples
(gauge)
Number of dead tuples that we can store before needing to perform an index vacuum cycle, based on maintenanceworkmem. This metric is tagged with db, table, phase.
postgresql.vacuum.num_dead_tuples
(gauge)
Number of dead tuples collected since the last index vacuum cycle. This metric is tagged with db, table, phase.
postgresql.vacuumed
(count)
Enabled with relations. The number of times this table has been manually vacuumed. This metric is tagged with db, schema, table.
postgresql.waiting_queries
(gauge)
Enabled with collect_activity_metrics. The number of waiting queries in this database. This metric (by default) is tagged with db, app, user.
postgresql.wal.buffers_full
(count)
Number of times WAL data was written to disk because WAL buffers became full. WAL changes are stored in WAL buffers first. If the buffer is full, WAL insertions will be blocked until buffer is flushed. The size of this buffer is set by walbuffers configuration. By default, it will use 3% of the sharedbuffers value.
postgresql.wal.bytes
(count)
Total amount of WAL generated in bytes.
Shown as byte
postgresql.wal.full_page_images
(count)
Total number of WAL full page images generated. Full page write will happen when a block is modified for the first time after a checkpoint.
Shown as page
postgresql.wal.records
(count)
Total number of WAL records generated.
Shown as record
postgresql.wal.sync
(count)
Number of times WAL files were synced to disk.
postgresql.wal.sync_time
(count)
Total amount of time spent syncing WAL files to disk, in milliseconds (if trackwaliotiming is enabled, fsync is on, and walsyncmethod is either fdatasync, fsync or fsyncwritethrough, otherwise zero).
Shown as millisecond
postgresql.wal.write
(count)
Number of times WAL buffers were written out to disk.
Shown as write
postgresql.wal.write_time
(count)
Total amount of time spent writing WAL buffers to disk, in milliseconds (if trackwalio_timing is enabled, otherwise zero).
Shown as millisecond
postgresql.wal_age
(gauge)
Enabled with collect_wal_metrics. The age in seconds of the oldest WAL file.
Shown as second
postgresql.wal_count
(gauge)
The number WAL files on disk.
postgresql.wal_receiver.connected
(gauge)
The status of the WAL receiver. This metric will be set to 1 with a 'status:disconnected' tag if the instance doesn't have a running WAL receiver. Otherwise it will use status value from pgstatwal_receiver. This metric is tagged with status.
postgresql.wal_receiver.last_msg_receipt_age
(gauge)
Time since the reception of the last message from the WAL sender. This metric is tagged with status.
Shown as second
postgresql.wal_receiver.last_msg_send_age
(gauge)
The age of the latest message's send time received from the WAL sender. This metric is tagged with status.
Shown as second
postgresql.wal_receiver.latest_end_age
(gauge)
Time since the reception of the last message from the WAL sender with an WAL location update. This metric is tagged with status.
Shown as second
postgresql.wal_receiver.received_timeline
(gauge)
Timeline number of last write-ahead log location received and flushed to disk, the initial value of this field being the timeline number of the first log location used when WAL receiver is started. This metric is tagged with status.
postgresql.wal_size
(gauge)
The sum of all WAL files on disk.
Shown as byte

에이전트 버전 7.32.0 이상의 경우, 데이터베이스 모니터링를 활성화한 경우 postgresql.connections 메트릭에 state, app, dbuser 태그가 지정됩니다.

이벤트

PostgreSQL 점검에는 이벤트가 포함되어 있지 않습니다.

서비스 점검

postgres.can_connect
Returns CRITICAL if the Agent is unable to connect to the monitored PostgreSQL instance. Returns OK otherwise.
Statuses: ok, critical

트러블슈팅

도움이 필요하신가요? Datadog 지원팀에 문의하세요.

참고 자료

기타 유용한 문서, 링크 및 기사:

FAQ

블로그 게시물

PREVIEWING: aliciascott/DOCS-9725-Cloudcraft