aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2016-02-27 14:09:37 +0000
committerChristopher Baines <mail@cbaines.net>2016-02-27 14:09:37 +0000
commitdd8061fe191e5273612d28d594762430d766ceef (patch)
tree8c0c3d401725ef7a24b61dc94abb5024b346805b
parentd2bf12566103b5a4a25f82a43d45ca57f22e1bc2 (diff)
parent18b37c74c5138e0ddb9e520771e747f5121c66ab (diff)
downloadprometheus-pgbouncer-exporter-dd8061fe191e5273612d28d594762430d766ceef.tar
prometheus-pgbouncer-exporter-dd8061fe191e5273612d28d594762430d766ceef.tar.gz
Merge branch 'master' into debian
-rw-r--r--CHANGELOG47
-rw-r--r--prometheus_pgbouncer_exporter/cli.py28
-rw-r--r--prometheus_pgbouncer_exporter/collectors.py2
-rw-r--r--prometheus_pgbouncer_exporter/exposition.py2
-rw-r--r--prometheus_pgbouncer_exporter/utils.py2
5 files changed, 65 insertions, 16 deletions
diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644
index 0000000..bd6f3a1
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,47 @@
+prometheus-pgbouncer-exporter (1.5)
+
+ * Make the port and host configurable
+ * Remove default config file path
+ * Remove debian/
+ * Separate changelog
+ * Use add --pgbouncer to port and user options
+
+ -- Christopher Baines <mail@cbaines.net> Sat, 27 Feb 2016 13:37:52 +0000
+
+prometheus-pgbouncer-exporter (1.4)
+
+ * New release
+ - Add manpage
+
+ -- Christopher Baines <mail@cbaines.net> Wed, 17 Feb 2016 11:46:16 +0000
+
+prometheus-pgbouncer-exporter (1.3)
+
+ * New release
+ - Readme improvements
+
+ -- Christopher Baines <mail@cbaines.net> Mon, 15 Feb 2016 16:44:28 +0000
+
+prometheus-pgbouncer-exporter (1.2)
+
+ * New release
+ - Add extra documentation
+ - Add extra licence information
+ - Add --version argument
+ - Rename metrics, removing _count prefix
+
+ -- Christopher Baines <mail@cbaines.net> Sat, 16 Jan 2016 20:47:22 +0000
+
+prometheus-pgbouncer-exporter (1.1)
+
+ * New release
+ - Improve the .service file
+ - Fix a metric name
+
+ -- Christopher Baines <mail@cbaines.net> Tue, 05 Jan 2016 10:05:06 +0000
+
+prometheus-pgbouncer-exporter (1.0)
+
+ * Initial release
+
+ -- Christopher Baines <mail@cbaines.net> Sun, 27 Dec 2015 14:57:54 +0000
diff --git a/prometheus_pgbouncer_exporter/cli.py b/prometheus_pgbouncer_exporter/cli.py
index 5a78fc6..c6f4d24 100644
--- a/prometheus_pgbouncer_exporter/cli.py
+++ b/prometheus_pgbouncer_exporter/cli.py
@@ -32,9 +32,6 @@ from .collectors import StatsCollector, ListsCollector, PoolsCollector, \
def main():
p = configargparse.ArgParser(
prog="prometheus-pgbouncer-exporter",
- default_config_files=[
- '/etc/prometheus-pgbouncer-exporter/config',
- ],
)
p.add(
@@ -52,12 +49,26 @@ def main():
p.add(
'--port',
+ default='9127',
+ help="Port to connect to pgbouncer",
+ type=int,
+ env_var='PORT',
+ )
+ p.add(
+ '--host',
+ default='0.0.0.0',
+ help="Port to connect to pgbouncer",
+ env_var='HOST',
+ )
+
+ p.add(
+ '--pgbouncer-port',
default='6432',
help="Port to connect to pgbouncer",
env_var='PGBOUNCER_PORT',
)
p.add(
- '--user',
+ '--pgbouncer-user',
default='pgbouncer',
help="User to connect to pgbouncer with",
env_var='PGBOUNCER_USER',
@@ -87,7 +98,7 @@ def main():
logging.info(p.format_values())
- connection = get_connection(options.user, options.port)
+ connection = get_connection(options.pgbouncer_user, options.pgbouncer_port)
REGISTRY.register(StatsCollector(
connection=connection,
@@ -108,15 +119,12 @@ def main():
connection=connection,
))
- host = '0.0.0.0'
- port = 9127
-
httpd = HTTPServer(
- (host, port),
+ (options.host, options.port),
create_request_handler(options.licence_location),
)
- logging.info("Listing on port %s:%d" % (host, port))
+ logging.info("Listing on port %s:%d" % (options.host, options.port))
try:
httpd.serve_forever()
diff --git a/prometheus_pgbouncer_exporter/collectors.py b/prometheus_pgbouncer_exporter/collectors.py
index 424189d..222e79b 100644
--- a/prometheus_pgbouncer_exporter/collectors.py
+++ b/prometheus_pgbouncer_exporter/collectors.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python3
-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
diff --git a/prometheus_pgbouncer_exporter/exposition.py b/prometheus_pgbouncer_exporter/exposition.py
index 0774e9a..5eceb6c 100644
--- a/prometheus_pgbouncer_exporter/exposition.py
+++ b/prometheus_pgbouncer_exporter/exposition.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python3
-
# Copyright (C) 2015 Christopher Baines <mail@cbaines.net>
#
# This program is free software: you can redistribute it and/or modify
diff --git a/prometheus_pgbouncer_exporter/utils.py b/prometheus_pgbouncer_exporter/utils.py
index 6789290..12e9ddd 100644
--- a/prometheus_pgbouncer_exporter/utils.py
+++ b/prometheus_pgbouncer_exporter/utils.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python3
-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or