Skip to content

Commit

Permalink
default / custom collector info
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmarsh authored Feb 14, 2023
1 parent 275e620 commit 600e4f0
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Instead, we leverage [pgx](https://github.com/jackc/pgx), which aims to be low-l

We also offer support for multi-target scraping (see below).


## Options

| Long Flag | ENV Flag | Default | Description |
Expand All @@ -24,6 +23,30 @@ We also offer support for multi-target scraping (see below).
| --application_name | $APP_NAME | postgres-exporter | The name of the application. |
| --default_isolation_level | $DEFAULT_ISOLATION_LEVEL | REPEATABLE_READ | The default isolation level for DB transactions |

## Features

Default Collectors for the following tables:
1. `pg_locks`
2. `pg_stat_activity`
3. `pg_stat_statements`
4. `pg_stat_user_indexes`
5. `pg_stat_user_tables`
6. `pg_statio_user_indexes`
7. `pg_statio_user_indexes`

Custom Collectors can be added like so, provided they satisfy our Collector interface:
```go
type Collector interface {
prometheus.Collector
Scrape(ch chan<- prometheus.Metric) error
}

...

exporter := exporter.MustNew(context.Background(), exporterOpts).
WithCustomCollectors(collectors...)
```

## Example Usage

### Single Target
Expand Down

0 comments on commit 600e4f0

Please sign in to comment.