• Stars
    star
    152
  • Rank 244,685 (Top 5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

postgres exporter for prometheus

PG Exporter

Prometheus exporter for PostgreSQL metrics. Bring ultimate observability to your favorite PostgreSQL!

PG Exporter is the core component for Pigsty, Which is the battery-included open-source distribution for PostgreSQL with HA deployment & ultimate observability. Check Demo for details.

Latest binaries & rpms can be found on release page. Supported pg version: PostgreSQL 9.4+ & Pgbouncer 1.8+. Default collectors definition is compatible with PostgreSQL 10,11,12,13,14.

The latest stable pg_exporter version is 0.5.0.

Note that default metrics are overhauled on 0.4 You can still use an old version of pg_exporter.yml to keep metrics consistency.

Features

  • Support Pigsty, the battery-include PostgreSQL distribution with ultimate observability.
  • Support both Postgres & Pgbouncer (Pgbouncer is detected when target dbname is pgbouncer)
  • Flexible: Almost all metrics are defined in customizable conf files with SQL collector.
  • Schedule: Fine-grained execution control: Timeout, Cache, Skip, Fatality, etc...
  • Dynamic Planning: Define multiple branches for a collector. Install specific branch when server & exporter meet certain conditions.
  • Rich self-monitoring metrics about pg_exporter itself.
  • Auto-discovery multiple databases, and run database level collectors
  • Tested and verified in a real-world production environment for several years (10K+ cores)
  • Metrics Overwhelming!

Quick Start

To run this exporter, you will need two things:

  • Where to scrape: A Postgres or pgbouncer URL given via PG_EXPORTER_URL or --url.
  • What to scrape: A path to config file or directory, by default ./pg_exporter.yml or /etc/pg_exporter.yml
export PG_EXPORTER_URL='postgres://postgres:password@localhost:5432/postgres'
export PG_EXPORTER_CONFIG='/path/to/conf/file/or/dir'
pg_exporter

pg_exporter only built-in with 3 metrics: pg_up,pg_version , and pg_in_recovery. All other metrics are defined in configuration files . You could use the pre-defined configuration file: pg_exporter.yml or use separated metric query in conf dir.

Demo

Wanna see what pg_exporter can do?

Check this out, It's an entire monitoring system based on pg_exporter!

Pigsty -- Postgres in Graphic STYle

Run

Parameters could be given via command-line args or environment variables.

usage: pg_exporter [<flags>]

Flags:
  --help                        Show context-sensitive help (also try --help-long and --help-man).
  --url=URL                     postgres target url
  --config=CONFIG               path to config dir or file
  --label=""                    constant lables:comma separated list of label=value pair
  --tag=""                      tags,comma separated list of server tag
  --disable-cache               force not using cache
  --disable-intro               disable collector level introspection metrics
  --auto-discovery              automatically scrape all database for given server
  --exclude-database="template0,template1,postgres"
                                excluded databases when enabling auto-discovery
  --include-database=""         included databases when enabling auto-discovery
  --namespace=""                prefix of built-in metrics, (pg|pgbouncer) by default
  --fail-fast                   fail fast instead of waiting during start-up
  --web.listen-address=":9630"  prometheus web server listen address
  --web.telemetry-path="/metrics"
                                URL path under which to expose metrics.
  --connect-timeout=5           connection timeout in seconds
  --dry-run                     dry run and print raw configs
  --explain                     explain server planned queries
  --version                     Show application version.
  --log.level="info"            Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal]
  --log.format="logger:stderr"  Set the log target and format. Example: "logger:syslog?appname=bob&local=7" or "logger:stdout?json=true"
  • --url or PG_EXPORTER_URL defines where to scrape, it should be a valid DSN or URL. (note that sslmode=disable must be specifed explicitly for database that does not using SSL)
  • --config or PG_EXPORTER_CONFIG defines how to scrape. It could be a single YAML file or a directory containing a series of separated YAML configs, which config will be loaded in alphabetic order.
  • --label or PG_EXPORTER_LABEL defines constant labels that are added to all metrics. It should be a comma-separated list of label=value pairs.
  • --tag or PG_EXPORTER_TAG will mark this exporter with given tags. Tags are a comma-separated-value list of strings. which could be used for query filtering and execution control.
  • --disable-cache or PG_EXPORTER_DISABLE_CACHE will disable metric cache.
  • --auto-discovery or PG_EXPORTER_AUTO_DISCOVERY will automatically spawn peripheral servers for other databases in the target PostgreSQL server. except for those listed in --exclude-database. (Not implemented yet)
  • --exclude-database or PG_EXPORTER_EXCLUDE_DATABASE is a comma-separated list of the database name. Which are not scrapped when --auto-discovery is enabled
  • --namespace or PG_EXPORTER_NAMESPACE defined internal metrics prefix, by default pg|pgbouncer.
  • --fail-fast or PG_EXPORTER_FAIL_FAST is a flag. During start-up, pg_exporter will wait if the target is down. with --fail-fast=true, pg_exporter will fail instead of waiting on the start-up procedure if the target is down
  • --listen-address or PG_EXPORTER_LISTEN_ADDRESS is the endpoint that exposes metrics
  • --metric-path or PG_EXPORTER_TELEMETRY_PATH` is the URL path under which to expose metrics.
  • --connect-timeout or PG_EXPORTER_CONNECT_TIMEOUT is the timeout for connecting to the target.
  • --dry-run will print configuration files
  • --explain will actually connect to the target server and plan queries for it. Then explain which queries are installed.

API

Here are pg_exporter REST APIs

# Fetch metrics (metrics path depends on parameters)
curl localhost:9630/metrics

# Reload configuration
curl localhost:9630/reload

# Explain configuration
curl localhost:9630/explain

# Print Statistics
curl localhost:9630/stat

# Aliveness health check (200 up, 503 down)
curl localhost:9630/up
curl localhost:9630/health
curl localhost:9630/liveness
curl localhost:9630/readiness

# traffic route health check

### 200 if not in recovery, 404 if in recovery, 503 if server is down
curl localhost:9630/primary
curl localhost:9630/leader
curl localhost:9630/master
curl localhost:9630/read-write
curl localhost:9630/rw

### 200 if in recovery, 404 if not in recovery, 503 if server is down
curl localhost:9630/replica
curl localhost:9630/standby
curl localhost:9630/slave
curl localhost:9630/read-only
curl localhost:9630/ro

### 200 if server is ready for read traffic (including primary), 503 if server is down
curl localhost:9630/read

Build

Build on your local machine:

go build

To build a static stand-alone binary for docker scratch

CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o pg_exporter

To build a docker image, use:

make docker

Or download the latest prebuilt binaries from release pages.

Deployment

A Redhat 7 / CentOS 7 rpm is shipped on release page. Includes:

Configuration

Configs lie in the core of pg_exporter. Actually, this project contains more lines of YAML than go.

Current pg_exporter is shipped with the following metrics collector definition files

Note

Supported version: PostgreSQL 10, 11, 12, 13, 14

But you can still get PostgreSQL 9.4, 9.5, 9.6 support by switching to the older version collector definition

pg_exporter will generate approximately 200~300 metrics for a completely new database cluster. For a real-world database with 10 ~ 100 tables, it may generate several 1k ~ 10k metrics. You may need to modify or disable some database-level metrics on a database with several thousand or more tables in order to complete the scrape in time.

Config files are using YAML format, there are lots of examples in the conf dir. and here is a sample config.

#################################################################
#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“#
#โ”ƒ PostgreSQL/Pgbouncer Metric Collector Definition            โ”ƒ#
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ซ#
#โ”ƒ Author:   Vonng ([email protected])                   โ”ƒ#
#โ”ƒ Desc  :   pg_exporter metrics collector definition          โ”ƒ#
#โ”ƒ Ver   :   PostgreSQL 10~14 pgbouncer 1.9+                   โ”ƒ#
#โ”ƒ Ctime :   2019-12-09                                        โ”ƒ#
#โ”ƒ Mtime :   2022-04-27                                        โ”ƒ#
#โ”ƒ Copyright (C) 2019-2022 Ruohang Feng                        โ”ƒ#
#โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”›#
#################################################################



#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
#โ”ƒ 1. Configuration File
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ The configuration file for pg_exporter is a YAML file.
#โ”ƒ Default configuration are retrieved via following precedence:
#โ”ƒ     1. command line args:      --config=<config path>
#โ”ƒ     2. environment variables:  PG_EXPORTER_CONFIG=<config path>
#โ”ƒ     3. pg_exporter.yml        (Current directory)
#โ”ƒ     4. /etc/pg_exporter.yml   (etc config file)
#โ”ƒ     5. /etc/pg_exporter       (etc config dir)
#โ”ฃโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
#โ”ƒ 2. Config Format
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ pg_exporter config could be a single YAML file, or a directory containing a series of separated YAML files.
#โ”ƒ each YAML config file is consist of one or more metrics Collector definition. Which are top-level objects
#โ”ƒ If a directory is provided, all YAML in that directory will be merged in alphabetic order.
#โ”ƒ Collector definition examples are shown below.
#โ”ฃโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
#โ”ƒ 3. Collector Example
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ  # Here is an example of a metrics collector definition
#โ”ƒ  pg_primary_only:       <---- Collector branch name. Must be UNIQUE among the entire configuration
#โ”ƒ    name: pg             <---- Collector namespace, used as METRIC PREFIX, set to branch name by default, can be override
#โ”ƒ                               the Same namespace may contain multiple collector branches. It's the user's responsibility
#โ”ƒ                               to make sure that AT MOST ONE collector is picked for each namespace.
#โ”ƒ
#โ”ƒ    desc: PostgreSQL basic information (on primary)                 <---- Collector description
#โ”ƒ    query: |                                                        <---- SQL string
#โ”ƒ
#โ”ƒ      SELECT extract(EPOCH FROM CURRENT_TIMESTAMP)                  AS timestamp,
#โ”ƒ             pg_current_wal_lsn() - '0/0'                           AS lsn,
#โ”ƒ             pg_current_wal_insert_lsn() - '0/0'                    AS insert_lsn,
#โ”ƒ             pg_current_wal_lsn() - '0/0'                           AS write_lsn,
#โ”ƒ             pg_current_wal_flush_lsn() - '0/0'                     AS flush_lsn,
#โ”ƒ             extract(EPOCH FROM now() - pg_postmaster_start_time()) AS uptime,
#โ”ƒ             extract(EPOCH FROM now() - pg_conf_load_time())        AS conf_reload_time,
#โ”ƒ             pg_is_in_backup()                                      AS is_in_backup,
#โ”ƒ             extract(EPOCH FROM now() - pg_backup_start_time())     AS backup_time;
#โ”ƒ
#โ”ƒ                             <---- [OPTIONAL] metadata fields, control collector behavior
#โ”ƒ    ttl: 10                  <---- Cache TTL: in seconds, how long will pg_exporter cache this collector's query result.
#โ”ƒ    timeout: 0.1             <---- Query Timeout: in seconds, query that exceed this limit will be canceled.
#โ”ƒ    min_version: 100000      <---- minimal supported version, boundary IS included. In server version number format,
#โ”ƒ    max_version: 130000      <---- maximal supported version, boundary NOT included, In server version number format
#โ”ƒ    fatal: false             <---- Collector marked `fatal` fails, the entire scrape will abort immediately and marked as failed
#โ”ƒ    skip: false              <---- Collector marked `skip` will not be installed during the planning procedure
#โ”ƒ
#โ”ƒ    tags: [cluster, primary] <---- list of strings, which could be:
#โ”ƒ                               * 'cluster' marks this query as cluster level, so it will only execute once for the same PostgreSQL Server
#โ”ƒ                               * 'primary' or 'master'  mark this query can only run on a primary instance (WILL NOT execute if pg_is_in_recovery())
#โ”ƒ                               * 'standby' or 'replica' mark this query can only run on a replica instance (WILL execute if pg_is_in_recovery())
#โ”ƒ                             some special tag prefix have special interpretation:
#โ”ƒ                               * 'dbname:<dbname>' means this query will ONLY be executed on database with name '<dbname>'
#โ”ƒ                               * 'username:<user>' means this query will only be executed when connect with user '<user>'
#โ”ƒ                               * 'extension:<extname>' means this query will only be executed when extension '<extname>' is installed
#โ”ƒ                               * 'schema:<nspname>' means this query will only by executed when schema '<nspname>' exist
#โ”ƒ                               * 'not:<negtag>' means this query WILL NOT be executed when exporter is tagged with '<negtag>'
#โ”ƒ                               * '<tag>' means this query WILL be executed when exporter is tagged with '<tag>'
#โ”ƒ                               ( <tag> could not be cluster,primary,standby,master,replica,etc...)
#โ”ƒ
#โ”ƒ
#โ”ƒ    metrics:                 <---- List of returned columns, each column must have a `name` and `usage`, `rename` and `description` are optional
#โ”ƒ      - timestamp:           <---- Column name, should be exactly the same as returned column name
#โ”ƒ          usage: GAUGE       <---- Metric type, `usage` could be
#โ”ƒ                                    * DISCARD: completely ignoring this field
#โ”ƒ                                    * LABEL:   use columnName=columnValue as a label in metric
#โ”ƒ                                    * GAUGE:   Mark column as a gauge metric, full name will be '<query.name>_<column.name>'
#โ”ƒ                                    * COUNTER: Same as above, except it is a counter rather than a gauge.
#โ”ƒ          rename: ts         <---- [OPTIONAL] Alias, optional, the alias will be used instead of the column name
#โ”ƒ          description: xxxx  <---- [OPTIONAL] Description of the column, will be used as a metric description
#โ”ƒ          default: 0         <---- [OPTIONAL] Default value, will be used when column is NULL
#โ”ƒ          scale:   1000      <---- [OPTIONAL] Scale the value by this factor
#โ”ƒ      - lsn:
#โ”ƒ          usage: COUNTER
#โ”ƒ          description: log sequence number, current write location (on primary)
#โ”ƒ      - insert_lsn:
#โ”ƒ          usage: COUNTER
#โ”ƒ          description: primary only, location of current wal inserting
#โ”ƒ      - write_lsn:
#โ”ƒ          usage: COUNTER
#โ”ƒ          description: primary only, location of current wal writing
#โ”ƒ      - flush_lsn:
#โ”ƒ          usage: COUNTER
#โ”ƒ          description: primary only, location of current wal syncing
#โ”ƒ      - uptime:
#โ”ƒ          usage: GAUGE
#โ”ƒ          description: seconds since postmaster start
#โ”ƒ      - conf_reload_time:
#โ”ƒ          usage: GAUGE
#โ”ƒ          description: seconds since last configuration reload
#โ”ƒ      - is_in_backup:
#โ”ƒ          usage: GAUGE
#โ”ƒ          description: 1 if backup is in progress
#โ”ƒ      - backup_time:
#โ”ƒ          usage: GAUGE
#โ”ƒ          description: seconds since the current backup start. null if don't have one
#โ”ƒ
#โ”ƒ
#โ”ฃโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
#โ”ƒ 4. Collector Presets
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ pg_exporter is shipped with a series of preset collectors (already numbered and ordered by filename)
#โ”ƒ
#โ”ƒ 1xx  Basic metrics:        basic info, metadata, settings
#โ”ƒ 2xx  Replication metrics:  replication, walreceiver, downstream, sync standby, slots, subscription
#โ”ƒ 3xx  Persist metrics:      size, wal, background writer, checkpoint, recovery, cache, shmem usage
#โ”ƒ 4xx  Activity metrics:     backend count group by state, wait event, locks, xacts, queries
#โ”ƒ 5xx  Progress metrics:     clustering, vacuuming, indexing, basebackup, copy
#โ”ƒ 6xx  Database metrics:     pg_database, publication, subscription
#โ”ƒ 7xx  Object metrics:       pg_class, table, index, function, sequence, default partition
#โ”ƒ 8xx  Optional metrics:     optional metrics collector (disable by default, slow queries)
#โ”ƒ 9xx  Pgbouncer metrics:    metrics from pgbouncer admin database `pgbouncer`
#โ”ƒ
#โ”ƒ 100-599 Metrics for entire database cluster  (scrape once)
#โ”ƒ 600-899 Metrics for single database instance (scrape for each database ,except for pg_db itself)
#โ”ƒ
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ 5. Cache TTL
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ Cache can be used for reducing query overhead, it can be enabled by setting a non-zero value for `ttl`
#โ”ƒ It is highly recommended to use cache to avoid duplicate scrapes. Especially when you got multiple Prometheus
#โ”ƒ scraping the same instance with slow monitoring queries. Setting `ttl` to zero or leaving blank will disable
#โ”ƒ result caching, which is the default behavior
#โ”ƒ
#โ”ƒ TTL has to be smaller than your scrape interval. 15s scrape interval and 10s TTL is a good start for
#โ”ƒ production environment. Some expensive monitoring queries (such as size/bloat check) will have longer `ttl`
#โ”ƒ which can also be used as a mechanism to achieve 'different scrape frequency'
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ 6. Query Timeout
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ Collectors can be configured with an optional Timeout. If the collector's query executes more than that
#โ”ƒ timeout, it will be canceled immediately. Setting the `timeout` to 0 or leaving blank will reset it to
#โ”ƒ default timeout 0.1 (100ms). Setting it to any negative number will disable the query timeout feature.
#โ”ƒ All queries have a default timeout of 100ms, if exceed, the query will be canceled immediately to avoid
#โ”ƒ avalanche. You can explicitly overwrite that option. but beware: in some extreme cases, if all your
#โ”ƒ timeout sum up greater your scrape/cache interval (usually 15s), the query may still be jammed.
#โ”ƒ or, you can just disable potential slow queries.
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ 7. Version Compatibility
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ Each collector has two optional version compatibility parameters: `min_version` and `max_version`.
#โ”ƒ These two parameters specify the version compatibility of the collector. If target postgres/pgbouncer
#โ”ƒ version is less than `min_version`, or higher than `max_version`, the collector will not be installed.
#โ”ƒ These two parameters are using PostgreSQL server version number format, which is a 6-digit integer
#โ”ƒ format as <major:2 digit><minor:2 digit>:<release: 2 digit>.
#โ”ƒ For example, 090600 stands for 9.6 and 120100 stands for 12.1
#โ”ƒ And beware that version compatibility range is left-inclusive right exclusive: [min, max), set to zero or
#โ”ƒ leaving blank will affect as -inf or +inf
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ 8. Fatality
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ If a collector is marked with `fatal` falls, the entire scrape operation will be marked as fail and key metrics
#โ”ƒ `pg_up` / `pgbouncer_up` will be reset to 0. It is always a good practice to set up AT LEAST ONE fatal
#โ”ƒ collector for pg_exporter. `pg.pg_primary_only` and `pgbouncer_list` are the default fatal collector.
#โ”ƒ
#โ”ƒ If a collector without `fatal` flag fails, it will increase global fail counters. But the scrape operation
#โ”ƒ will carry on. The entire scrape result will not be marked as faile, thus will not affect the `<xx>_up` metric.
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ 9. Skip
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ Collector with `skip` flag set to true will NOT be installed.
#โ”ƒ This could be a handy option to disable collectors
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ 10. Tags and Planning
#โ”ฃโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆโ”ˆ
#โ”ƒ Tags are designed for collector planning & schedule. It can be handy to customize which queries run
#โ”ƒ on which instances. And thus you can use one-single monolith config for multiple environments
#โ”ƒ
#โ”ƒ  Tags are a list of strings, each string could be:
#โ”ƒ  Pre-defined special tags
#โ”ƒ    * 'cluster' marks this collector as cluster level, so it will ONLY BE EXECUTED ONCE for the same PostgreSQL Server
#โ”ƒ    * 'primary' or 'master' mark this collector as primary-only, so it WILL NOT work iff pg_is_in_recovery()
#โ”ƒ    * 'standby' or 'replica' mark this collector as replica-only, so it WILL work iff pg_is_in_recovery()
#โ”ƒ  Special tag prefix which have different interpretation:
#โ”ƒ    * 'dbname:<dbname>' means this collector will ONLY work on database with name '<dbname>'
#โ”ƒ    * 'username:<user>' means this collector will ONLY work when connect with user '<user>'
#โ”ƒ    * 'extension:<extname>' means this collector will ONLY work when extension '<extname>' is installed
#โ”ƒ    * 'schema:<nspname>' means this collector will only work when schema '<nspname>' exists
#โ”ƒ  Customized positive tags (filter) and negative tags (taint)
#โ”ƒ    * 'not:<negtag>' means this collector WILL NOT work when exporter is tagged with '<negtag>'
#โ”ƒ    * '<tag>' means this query WILL work if exporter is tagged with '<tag>' (special tags not included)
#โ”ƒ
#โ”ƒ  pg_exporter will trigger the Planning procedure after connecting to the target. It will gather database facts
#โ”ƒ  and match them with tags and other metadata (such as supported version range). Collector will only
#โ”ƒ  be installed if and only if it is compatible with the target server.
#โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Dashboards

You could visualize these metrics via fancy grafana dashboards. There are lots of dashboards available based on pg_exporter, Check Pigsty for detail.

PG Overview

PG Cluster

PG Service

PG Instance

PG Instance Screenshot

PG Database

PG Database Screenshot

PG Query

About

Author: Vonng ([email protected])

License: Apache Apache License Version 2.0

More Repositories

1

ddia

ใ€ŠDesigning Data-Intensive Applicationใ€‹DDIAไธญๆ–‡็ฟป่ฏ‘
Python
20,253
star
2

pigsty

Battery-Included PostgreSQL Distro as a Free RDS Alternative
Shell
3,015
star
3

Capslock

Make Capslock Great Again!
HTML
1,351
star
4

ac

Aho-Corasick Automaton with Double Array Trie (Multi-pattern substitute in go)
Go
663
star
5

pg

PostgreSQL notes
Shell
449
star
6

adcode

ไธญๅ›ฝ่กŒๆ”ฟๅŒบๅˆ’ไปฃ็ ๏ผŒๅŒ…ๆ‹ฌไบ”็บง่กŒๆ”ฟๅŒบๅˆ’่ฏฆ็ป†ไปฃ็ ๏ผŒๅŽฟ็บงไปฅไธŠๅŒบๅˆ’ๅœฐ็†ๅ›ดๆ ใ€‚
Shell
259
star
7

worktime

Working Time Analysis based on WorkerLivesMatter / WorkingTime
Python
90
star
8

isd

NOAA Integrated surface database parser and analyze utils
PLpgSQL
46
star
9

Configuration

Configuration via Github
Shell
41
star
10

pgtpc

TPC B/C/H Benchmark for PostgreSQL
HCL
30
star
11

go-itunes-search

iTunes Search API for Golang
Go
19
star
12

hbase_fdw

PostgreSQL HBase FDW based on multicorn.
Python
10
star
13

Math

Math Notes
7
star
14

Vonng

home bio
7
star
15

blog

posts, notes, gists
Jupyter Notebook
7
star
16

sfz

PostgreSQL ShenFenZheng/่บซไปฝ่ฏ ๅญ˜ๅ‚จ่ฟ‡็จ‹
PLpgSQL
6
star
17

gospider

Spider Framework in Golang
Go
4
star
18

CSAPP

Computer System : A Programmer's Perspective 3rd Edition Notes
C
3
star
19

gopher

golang trinkets
Go
3
star
20

pigsty-doc

Documentation for Pigsty
HTML
3
star
21

datalets

Data analysis examples for pigsty
PLpgSQL
2
star
22

go-android-search

android app meta extractor written in Golang
HTML
2
star
23

vonng-echarts-panel

Dist version fo Vonng/grafana-echarts
2
star
24

pigsty-cli

pigsty command line tools
Go
2
star
25

dbrank

DBMS ranking data and visualization
Python
1
star
26

ad

Administration Division
Python
1
star
27

Library

My own code library
C++
1
star
28

pigsty.io

Pigsty Website Content
HTML
1
star
29

pigsty-site

official site of pigsty
CSS
1
star
30

pigsty-app

pigsty example applications
Python
1
star
31

oj-geocoder

oj-geocoder
Go
1
star