gpbackup_exporter

May 12, 2026 · View on GitHub

gpbackup_exporter is a Prometheus exporter for collecting metrics from gpbackup history database (gpbackup_history.db).

Metrics

Backup metrics

MetricDescriptionLabelsAdditional Info
gpbackup_backup_statusbackup statusbackup_type, database_name, object_filtering, plugin, timestampValues description:
0 - success,
1 - failure.
gpbackup_backup_deletion_statusbackup deletion statusbackup_type, database_name, date_deleted, object_filtering, plugin, timestampValues description:
0 - backup still exists,
1 - backup was successfully deleted,
2 - the deletion is in progress,
3 - last delete attempt failed to delete backup from plugin storage,
4 - last delete attempt failed to delete backup from local storage.
gpbackup_backup_infobackup infobackup_dir, backup_ver, backup_type, compression_type, database_name, database_ver, object_filtering, plugin, plugin_ver, timestamp, with_statisticValues description:
1 - info about backup is exist.
gpbackup_backup_duration_secondsbackup duration in secondsbackup_type, database_name, end_time, object_filtering, plugin, timestamp

Last backup metrics

MetricDescriptionLabelsAdditional Info
gpbackup_backup_since_last_completion_secondsseconds since the last completed backupbackup_type, database_name

Exporter metrics

MetricDescriptionLabelsAdditional Info
gpbackup_exporter_build_infoinformation about gpbackup exporterbranch, goarch, goos, goversion, revision, tags, version
gpbackup_exporter_statusgpbackup exporter data collection status for a specific databasedatabase_nameValues description:
0 — exporter marked this database as not collected,
1 — information successfully fetched from history database.

Getting Started

Available configuration flags:

./gpbackup_exporter --help
usage: gpbackup_exporter [<flags>]


Flags:
  -h, --[no-]help                Show context-sensitive help (also try --help-long and --help-man).
      --web.telemetry-path="/metrics"  
                                 Path under which to expose metrics.
      --web.listen-address=:19854 ...  
                                 Addresses on which to expose metrics and web interface. Repeatable for multiple addresses. Examples: `:9100` or `[::1]:9100` for http, `vsock://:9100` for vsock
      --web.config.file=""       Path to configuration file that can enable TLS or authentication. See: https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md
      --collect.interval=600     Collecting metrics interval in seconds.
      --collect.depth=0          Metrics depth collection in days. Metrics for backup older than this interval will not be collected. 0 - disable.
      --gpbackup.history-file=""  
                                 Path to gpbackup_history.db.
      --gpbackup.db-include="" ...  
                                 Specific db for collecting metrics. Can be specified several times.
      --gpbackup.db-exclude="" ...  
                                 Specific db to exclude from collecting metrics. Can be specified several times.
      --gpbackup.backup-type=""  Specific backup type for collecting metrics. One of: [full, incremental, data-only, metadata-only].
      --[no-]gpbackup.collect-deleted  
                                 Collecting metrics for deleted backups.
      --[no-]gpbackup.collect-failed  
                                 Collecting metrics for failed backups.
      --log.level=info           Only log messages with the given severity or above. One of: [debug, info, warn, error]
      --log.format=logfmt        Output format of log messages. One of: [logfmt, json]
      --[no-]version             Show application version.

Additional description of flags.

It's necessary to specify the gpbackup_history.db file location via --gpbackup.history-file flag.

By default, metrics a collected only for active backups. The flag --gpbackup.collect-deleted allows to collect metrics for deleted backups. The flag --gpbackup.collect-failed allows to collect metrics for failed backups.

Custom database for collecting metrics can be specified via --gpbackup.db-include flag. You can specify several databases.
For example, --gpbackup.db-include=demo1 --gpbackup.db-include=demo2.
For this case, metrics will be collected only for demo1 and demo2 databases.

Custom database to exclude from collecting metrics can be specified via --gpbackup.db-exclude flag. You can specify several databases.
For example, --gpbackup.db-exclude=demo1 --gpbackup.db-exclude=demo2.
For this case, metrics will not be collected for demo1 and demo2 databases.
If the same database is specified for include and exclude flags, then metrics for this database will not be collected. The flag --gpbackup.db-exclude has a higher priority.
For example, --gpbackup.db-include=demo1 --gpbackup.db-exclude=demo1.
For this case, metrics will not be collected for demo1 database.

Custom backup type for collecting metrics can be specified via --gpbackup.backup-type flag. Valid values: full, incremental, data-only, metadata-only.
For example, --gpbackup.backup-type=full.
For this case, metrics will be collected only for full backups.

Custom metrics depth collection in days can be specified via --collect.depth flag. Since gpbackup doesn't have regular options for removing info about outdated backups from history file, it is possible to limit the depth of collection metrics.
For example, --collect.depth=14.
For this case, metrics will be collected for backups not older then 14 days from current time.
Value 0 - disable this functionality.

When --log.level=debug is specified - information of values and labels for metrics is printing to the log.

The flag --web.config.file allows to specify the path to the configuration for TLS and/or basic authentication.

Running

./gpbackup_exporter \
    --gpbackup.history-file=/data/master/gpseg-1/gpbackup_history.db \
    --gpbackup.collect-deleted \
    --gpbackup.collect-failed

After starting, metrics are available at http://localhost:19854/metrics.

About

gpbackup_exporter is part of the Apache Cloudberry Backup (Incubating) toolset. It is based on the original gpbackup_exporter project.