Skip to content

Commit 607cd75

Browse files
committed
Merge the upstream branch
2 parents c1b5087 + 1dc2104 commit 607cd75

File tree

1,469 files changed

+2720
-529327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,469 files changed

+2720
-529327
lines changed

.circleci/config.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
version: 2.1
3+
4+
orbs:
5+
prometheus: prometheus/[email protected]
6+
7+
executors:
8+
# This must match .promu.yml.
9+
golang:
10+
docker:
11+
- image: circleci/golang:1.16
12+
13+
jobs:
14+
test:
15+
executor: golang
16+
17+
steps:
18+
- prometheus/setup_environment
19+
- run: make
20+
- prometheus/store_artifact:
21+
file: postgres_exporter
22+
23+
integration:
24+
docker:
25+
- image: circleci/golang:1.16
26+
- image: << parameters.postgres_image >>
27+
environment:
28+
POSTGRES_DB: circle_test
29+
POSTGRES_USER: postgres
30+
POSTGRES_PASSWORD: test
31+
32+
parameters:
33+
postgres_image:
34+
type: string
35+
36+
environment:
37+
DATA_SOURCE_NAME: 'postgresql://postgres:test@localhost:5432/circle_test?sslmode=disable'
38+
GOOPTS: '-v -tags integration'
39+
40+
steps:
41+
- checkout
42+
- setup_remote_docker
43+
- run: docker version
44+
- run: make build
45+
- run: make test
46+
47+
workflows:
48+
version: 2
49+
postgres_exporter:
50+
jobs:
51+
- test:
52+
filters:
53+
tags:
54+
only: /.*/
55+
- integration:
56+
matrix:
57+
parameters:
58+
postgres_image:
59+
- circleci/postgres:9.4
60+
- circleci/postgres:9.5
61+
- circleci/postgres:9.6
62+
- circleci/postgres:10
63+
- circleci/postgres:11
64+
- circleci/postgres:12
65+
- circleci/postgres:13
66+
- prometheus/build:
67+
name: build
68+
filters:
69+
tags:
70+
only: /.*/
71+
- prometheus/publish_master:
72+
context: org-context
73+
docker_hub_organization: prometheuscommunity
74+
quay_io_organization: prometheuscommunity
75+
requires:
76+
- test
77+
- build
78+
filters:
79+
branches:
80+
only: master
81+
- prometheus/publish_release:
82+
context: org-context
83+
docker_hub_organization: prometheuscommunity
84+
quay_io_organization: prometheuscommunity
85+
requires:
86+
- test
87+
- build
88+
filters:
89+
tags:
90+
only: /^v.*/
91+
branches:
92+
ignore: /.*/

.dockerignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@
1919
/.metrics.*.added
2020
/.metrics.*.removed
2121
/tools/src
22+
/vendor

.golangci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
issues:
3+
exclude-rules:
4+
- path: _test.go
5+
linters:
6+
- errcheck
7+
8+
linters-settings:
9+
errcheck:
10+
exclude: scripts/errcheck_excludes.txt

.promu.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
go:
2+
# This must match .circle/config.yml.
3+
version: 1.16
4+
repository:
5+
path: github.com/prometheus-community/postgres_exporter
6+
build:
7+
binaries:
8+
- name: postgres_exporter
9+
path: ./cmd/postgres_exporter
10+
flags: -a -tags 'netgo static_build'
11+
ldflags: |
12+
-X github.com/prometheus/common/version.Version={{.Version}}
13+
-X github.com/prometheus/common/version.Revision={{.Revision}}
14+
-X github.com/prometheus/common/version.Branch={{.Branch}}
15+
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
16+
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
17+
tarball:
18+
files:
19+
- LICENSE
20+
- NOTICE

.travis.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
## 0.9.0 / 2021-03-01
2+
3+
First release under the Prometheus Community organisation.
4+
5+
* [CHANGE] Update build to use standard Prometheus promu/Dockerfile
6+
* [ENHANCEMENT] Remove duplicate column in queries.yml #433
7+
* [ENHANCEMENT] Add query for 'pg_replication_slots' #465
8+
* [ENHANCEMENT] Allow a custom prefix for metric namespace #387
9+
* [ENHANCEMENT] Improve PostgreSQL replication lag detection #395
10+
* [ENHANCEMENT] Support connstring syntax when discovering databases #473
11+
* [ENHANCEMENT] Detect SIReadLock locks in the pg_locks metric #421
12+
* [BUGFIX] Fix pg_database_size_bytes metric in queries.yaml #357
13+
* [BUGFIX] Don't ignore errors in parseUserQueries #362
14+
* [BUGFIX] Fix queries.yaml for AWS RDS #370
15+
* [BUGFIX] Recover when connection cannot be established at startup #415
16+
* [BUGFIX] Don't retry if an error occurs #426
17+
* [BUGFIX] Do not panic on incorrect env #457
18+
19+
## 0.8.0 / 2019-11-25
20+
21+
* Add a build info metric (#323)
22+
* Re-add pg_stat_bgwriter metrics which were accidentally removed in the previous version. (resolves #336)
23+
* Export pg_stat_archiver metrics (#324)
24+
* Add support for 'DATA_SOURCE_URI_FILE' envvar.
25+
* Resolve #329
26+
* Added new field "master" to queries.yaml. (credit to @sfalkon)
27+
- If "master" is true, query will be call only on once database in instance
28+
* Change queries.yaml for work with autoDiscoveryDatabases options (credit to @sfalkon)
29+
- added current database name to metrics because any database in cluster maybe have the same table names
30+
- added "master" field for query instance metrics.
31+
32+
## 0.7.0 / 2019-11-01
33+
34+
Introduces some more significant changes, hence the minor version bump in
35+
such a short time frame.
36+
37+
* Rename pg_database_size to pg_database_size_bytes in queries.yml.
38+
* Add pg_stat_statements to sample queries.yml file.
39+
* Add support for optional namespace caching. (#319)
40+
* Fix some autodiscovery problems (#314) (resolves #308)
41+
* Yaml parsing refactor (#299)
42+
* Don't stop generating fingerprint while encountering value with "=" sign (#318)
43+
(may resolve problems with passwords and special characters).
44+
45+
## 0.6.0 / 2019-10-30
46+
47+
* Add SQL for grant connect (#303)
48+
* Expose pg_current_wal_lsn_bytes (#307)
49+
* [minor] fix landing page content-type (#305)
50+
* Updated lib/pg driver to 1.2.0 in order to support stronger SCRAM-SHA-256 authentication. This drops support for Go < 1.11 and PostgreSQL < 9.4. (#304)
51+
* Provide more helpful default values for tables that have never been vacuumed (#310)
52+
* Add retries to getServer() (#316)
53+
* Fix pg_up metric returns last calculated value without explicit resetting (#291)
54+
* Discover only databases that are not templates and allow connections (#297)
55+
* Add --exclude-databases option (#298)
56+
57+
## 0.5.1 / 2019-07-09
58+
59+
* Add application_name as a label for pg_stat_replication metrics (#285).
60+
61+
## 0.5.0 / 2019-07-03
62+
63+
It's been far too long since I've done a release and we have a lot of accumulated changes.
64+
65+
* Docker image now runs as a non-root user named "postgres_exporter"
66+
* Add `--auto-discover-databases` option, which automatically discovers and scrapes all databases.
67+
* Add support for boolean data types as metrics
68+
* Replication lag is now expressed as a float and not truncated to an integer.
69+
* When default metrics are disabled, no version metrics are collected anymore either.
70+
* BUGFIX: Fix exporter panic when postgres server goes down.
71+
* Add support for collecting metrics from multiple servers.
72+
* PostgreSQL 11 is now supported in the integration tests.
73+
74+
## 0.4.7 / 2018-10-02
75+
76+
* Added a query for v9.1 pg_stat_activity.
77+
* Add `--constantLabels` flag to allow applying fixed constant labels to metrics.
78+
* queries.yml: dd pg_statio_user_tables.
79+
* Support 'B' suffix in units.
80+
81+
## 0.4.6 / 2018-04-15
82+
83+
* Fix issue #173 - 32 and 64mb unit sizes were not supported in pg_settings.
84+
85+
## 0.4.5 / 2018-02-27
86+
87+
* Add commandline flag to disable default metrics (thanks @hsun-cnnxty)
88+
89+
## 0.4.4 / 2018-03-21
90+
91+
* Bugfix for 0.4.3 which broke pg_up (it would always be 0).
92+
* pg_up is now refreshed based on database Ping() every scrape.
93+
* Re-release of 0.4.4 to fix version numbering.
94+
95+
## 0.4.2 / 2018-02-19
96+
97+
* Adds the following environment variables for overriding defaults:
98+
* `PG_EXPORTER_WEB_LISTEN_ADDRESS`
99+
* `PG_EXPORTER_WEB_TELEMETRY_PATH`
100+
* `PG_EXPORTER_EXTEND_QUERY_PATH`
101+
102+
* Add Content-Type to HTTP landing page.
103+
* Fix Makefile to produce .exe binaries for Windows.
104+
105+
## 0.4.1 / 2017-11-30
106+
107+
* No code changes to v0.4.0 for the exporter.
108+
* First release switching to tar-file based distribution.
109+
* First release with Windows and Darwin cross-builds.\\
110+
111+
## 0.4.0 / 2017-11-29
112+
113+
* Fix panic due to inconsistent label cardinality when using queries.yaml with
114+
queries which return extra columns.
115+
* Add metric for whether the user queries YAML file parsed correctly. This also
116+
includes the filename and SHA256 sum allowing tracking of updates.
117+
* Add pg_up metric to indicate whether the exporter was able to connect and
118+
Ping() the PG instance before a scrape.
119+
* Fix broken link in landing page for `/metrics`
120+
121+
## 0.3.0 / 2017-10-23
122+
123+
* Add support for PostgreSQL 10.
124+
125+
## 0.2.3 / 2017-09-07
126+
127+
* Add support for the 16kB unit when decoding pg_settings. (#101)
128+
129+
## 0.2.2 / 2017-08-04
130+
131+
* Fix DSN logging. The exporter previously never actually logged the DSN when
132+
database connections failed. This was also masking a logic error which could
133+
potentially lead to a crash when DSN was unparseable, though no actual
134+
crash could be produced in testing.
135+
136+
## 0.2.1 / 2017-06-07
137+
138+
* Ignore functions that cannot be executed during replication recovery (#52)
139+
* Add a `-version` flag finally.
140+
* Add confirmed_flush_lsn to pg_stat_replication.
141+
142+
## 0.2.0 / 2017-04-18
143+
144+
* Major change - use pg_settings to retrieve runtime variables. Adds >180
145+
new metrics and descriptions (big thanks to Matt Bostock for this work).
146+
147+
Removes the following metrics:
148+
```
149+
pg_runtime_variable_max_connections
150+
pg_runtime_variable_max_files_per_process
151+
pg_runtime_variable_max_function_args
152+
pg_runtime_variable_max_identifier_length
153+
pg_runtime_variable_max_index_keys
154+
pg_runtime_variable_max_locks_per_transaction
155+
pg_runtime_variable_max_pred_locks_per_transaction
156+
pg_runtime_variable_max_prepared_transactions
157+
pg_runtime_variable_max_standby_archive_delay_milliseconds
158+
pg_runtime_variable_max_standby_streaming_delay_milliseconds
159+
pg_runtime_variable_max_wal_senders
160+
```
161+
162+
They are replaced by equivalent names under `pg_settings` with the exception of
163+
```
164+
pg_runtime_variable_max_standby_archive_delay_milliseconds
165+
pg_runtime_variable_max_standby_streaming_delay_milliseconds
166+
```
167+
which are replaced with
168+
```
169+
pg_settings_max_standby_archive_delay_seconds
170+
pg_settings_max_standby_streaming_delay_seconds
171+
```
172+
173+
## 0.1.3 / 2017-02-21
174+
175+
* Update the Go build to 1.7.5 to include a fix for NAT handling.
176+
* Fix passwords leaking in DB url error message on connection failure.
177+
178+
## 0.1.2 / 2017-02-07
179+
180+
* Use a connection pool of size 1 to reduce memory churn on target database.
181+
182+
## 0.1.1 / 2016-11-29
183+
184+
* Fix pg_stat_replication metrics not being collected due to semantic version
185+
filter problem.
186+
187+
## 0.1.0 / 2016-11-21
188+
189+
* Change default port to 9187.
190+
* Fix regressions with pg_stat_replication on older versions of Postgres.
191+
* Add pg_static metric to store version strings as labels.
192+
* Much more thorough testing structure.
193+
* Move to semantic versioning for releases and docker image publications.
194+
195+
## 0.0.1 / 2016-06-03
196+
197+
Initial release for publication.

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Prometheus Community Code of Conduct
2+
3+
Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).

0 commit comments

Comments
 (0)