Skip to content

Commit 29eee7c

Browse files
authored
Merge branch 'master' into master
2 parents 7c95544 + 456ac72 commit 29eee7c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This package is available for Docker:
1313
# Start an example database
1414
docker run --net=host -it --rm -e POSTGRES_PASSWORD=password postgres
1515
# Connect to it
16-
docker run --net=host -e DATA_SOURCE_NAME="postgresql://postgres:password@localhost:5432/?sslmode=disable" wrouesnel/postgres_exporter
16+
docker run --net=host -e DATA_SOURCE_NAME="postgresql://postgres:password@localhost:5432/postgres?sslmode=disable" wrouesnel/postgres_exporter
1717
```
1818

1919
## Building and running
@@ -65,6 +65,9 @@ Package vendoring is handled with [`govendor`](https://github.com/kardianos/gove
6565
Set the log output target and format. e.g. `logger:syslog?appname=bob&local=7` or `logger:stdout?json=true`
6666
Defaults to `logger:stderr`.
6767

68+
* `constantLabels`
69+
Labels to set in all metrics. A list of `label=value` pairs, separated by commas.
70+
6871
### Environment Variables
6972

7073
The following environment variables configure the exporter:
@@ -101,6 +104,9 @@ The following environment variables configure the exporter:
101104
* `PG_EXPORTER_EXTEND_QUERY_PATH`
102105
Path to a YAML file containing custom queries to run. Check out [`queries.yaml`](queries.yaml)
103106
for examples of the format.
107+
108+
* `PG_EXPORTER_CONTANT_LABELS`
109+
Labels to set in all metrics. A list of `label=value` pairs, separated by commas.
104110

105111
Settings set by environment variables starting with `PG_` will be overwritten by the corresponding CLI flag if given.
106112

cmd/postgres_exporter/pg_setting.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (s *pgSetting) normaliseUnit() (val float64, unit string, err error) {
9696
return
9797
case "ms", "s", "min", "h", "d":
9898
unit = "seconds"
99-
case "kB", "MB", "GB", "TB", "8kB", "16kB", "32kB", "16MB", "32MB", "64MB":
99+
case "B", "kB", "MB", "GB", "TB", "8kB", "16kB", "32kB", "16MB", "32MB", "64MB":
100100
unit = "bytes"
101101
default:
102102
err = fmt.Errorf("Unknown unit for runtime variable: %q", s.unit)

0 commit comments

Comments
 (0)