﻿---
title: PostgreSQL bgwriter metricset
description: This is the bgwriter metricset of the PostgreSQL module. This is a default metricset. If the host module is unconfigured, this metricset is enabled by...
url: https://www.elastic.co/elastic/docs-builder/docs/2821/reference/beats/metricbeat/metricbeat-metricset-postgresql-bgwriter
products:
  - Beats
  - Metricbeat
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available
---

# PostgreSQL bgwriter metricset
This is the `bgwriter` metricset of the PostgreSQL module.
This is a default metricset. If the host module is unconfigured, this metricset is enabled by default.

## Fields

For a description of each field in the metricset, see the [exported fields](https://www.elastic.co/elastic/docs-builder/docs/2821/reference/beats/metricbeat/exported-fields-postgresql) section.
Here is an example document generated by this metricset:
```json
{
    "@timestamp": "2017-10-12T08:05:34.853Z",
    "event": {
        "dataset": "postgresql.bgwriter",
        "duration": 115000,
        "module": "postgresql"
    },
    "metricset": {
        "name": "bgwriter",
        "period": 10000
    },
    "postgresql": {
        "bgwriter": {
            "buffers": {
                "allocated": 273,
                "backend": 0,
                "backend_fsync": 0,
                "checkpoints": 8,
                "clean": 0,
                "clean_full": 0
            },
            "checkpoints": {
                "requested": 0,
                "scheduled": 4,
                "times": {
                    "sync": {
                        "ms": 9
                    },
                    "write": {
                        "ms": 804
                    }
                }
            },
            "stats_reset": "2021-03-05T18:39:17.954Z"
        }
    },
    "service": {
        "address": "192.168.128.2:5432",
        "type": "postgresql"
    }
}
```