jool-exporter 21.6.15__tar.gz → 26.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jool-exporter-21.6.15 → jool_exporter-26.2.3}/PKG-INFO +15 -9
- {jool-exporter-21.6.15 → jool_exporter-26.2.3}/jool_exporter.egg-info/PKG-INFO +15 -9
- {jool-exporter-21.6.15 → jool_exporter-26.2.3}/jool_exporter.egg-info/entry_points.txt +0 -1
- {jool-exporter-21.6.15 → jool_exporter-26.2.3}/jool_exporter.py +33 -7
- {jool-exporter-21.6.15 → jool_exporter-26.2.3}/setup.py +2 -6
- {jool-exporter-21.6.15 → jool_exporter-26.2.3}/LICENSE +0 -0
- {jool-exporter-21.6.15 → jool_exporter-26.2.3}/README.md +0 -0
- {jool-exporter-21.6.15 → jool_exporter-26.2.3}/jool_exporter.egg-info/SOURCES.txt +0 -0
- {jool-exporter-21.6.15 → jool_exporter-26.2.3}/jool_exporter.egg-info/dependency_links.txt +0 -0
- {jool-exporter-21.6.15 → jool_exporter-26.2.3}/jool_exporter.egg-info/requires.txt +0 -0
- {jool-exporter-21.6.15 → jool_exporter-26.2.3}/jool_exporter.egg-info/top_level.txt +0 -0
- {jool-exporter-21.6.15 → jool_exporter-26.2.3}/setup.cfg +0 -0
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: jool-exporter
|
|
3
|
-
Version:
|
|
3
|
+
Version: 26.2.3
|
|
4
4
|
Summary: Export `jool stats display` for prometheus
|
|
5
5
|
Home-page: http://github.com/cooperlees/jool-exporter
|
|
6
6
|
Author: Cooper Lees
|
|
7
7
|
Author-email: me@cooperlees.com
|
|
8
|
-
License: BSD
|
|
9
|
-
Platform: UNKNOWN
|
|
8
|
+
License: BSD-3-Clause
|
|
10
9
|
Classifier: Development Status :: 3 - Alpha
|
|
11
|
-
Classifier: License :: OSI Approved :: BSD License
|
|
12
10
|
Classifier: Programming Language :: Python :: 3
|
|
13
11
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
12
|
Requires-Python: >=3.8
|
|
17
13
|
Description-Content-Type: text/markdown
|
|
18
14
|
License-File: LICENSE
|
|
15
|
+
Requires-Dist: prometheus_client
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: author-email
|
|
18
|
+
Dynamic: classifier
|
|
19
|
+
Dynamic: description
|
|
20
|
+
Dynamic: description-content-type
|
|
21
|
+
Dynamic: home-page
|
|
22
|
+
Dynamic: license
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
Dynamic: requires-dist
|
|
25
|
+
Dynamic: requires-python
|
|
26
|
+
Dynamic: summary
|
|
19
27
|
|
|
20
28
|
# jool-exporter
|
|
21
29
|
|
|
@@ -174,5 +182,3 @@ We use Facebook's [ptr](https://github.com/facebookincubator/ptr) for testing.
|
|
|
174
182
|
It is driven by config in setup.py.
|
|
175
183
|
|
|
176
184
|
|
|
177
|
-
|
|
178
|
-
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: jool-exporter
|
|
3
|
-
Version:
|
|
3
|
+
Version: 26.2.3
|
|
4
4
|
Summary: Export `jool stats display` for prometheus
|
|
5
5
|
Home-page: http://github.com/cooperlees/jool-exporter
|
|
6
6
|
Author: Cooper Lees
|
|
7
7
|
Author-email: me@cooperlees.com
|
|
8
|
-
License: BSD
|
|
9
|
-
Platform: UNKNOWN
|
|
8
|
+
License: BSD-3-Clause
|
|
10
9
|
Classifier: Development Status :: 3 - Alpha
|
|
11
|
-
Classifier: License :: OSI Approved :: BSD License
|
|
12
10
|
Classifier: Programming Language :: Python :: 3
|
|
13
11
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
12
|
Requires-Python: >=3.8
|
|
17
13
|
Description-Content-Type: text/markdown
|
|
18
14
|
License-File: LICENSE
|
|
15
|
+
Requires-Dist: prometheus_client
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: author-email
|
|
18
|
+
Dynamic: classifier
|
|
19
|
+
Dynamic: description
|
|
20
|
+
Dynamic: description-content-type
|
|
21
|
+
Dynamic: home-page
|
|
22
|
+
Dynamic: license
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
Dynamic: requires-dist
|
|
25
|
+
Dynamic: requires-python
|
|
26
|
+
Dynamic: summary
|
|
19
27
|
|
|
20
28
|
# jool-exporter
|
|
21
29
|
|
|
@@ -174,5 +182,3 @@ We use Facebook's [ptr](https://github.com/facebookincubator/ptr) for testing.
|
|
|
174
182
|
It is driven by config in setup.py.
|
|
175
183
|
|
|
176
184
|
|
|
177
|
-
|
|
178
|
-
|
|
@@ -14,19 +14,26 @@ from socket import getfqdn
|
|
|
14
14
|
from subprocess import CompletedProcess, PIPE, run
|
|
15
15
|
from typing import Generator, Union
|
|
16
16
|
|
|
17
|
-
from prometheus_client import start_http_server
|
|
18
|
-
from prometheus_client.core import GaugeMetricFamily, REGISTRY
|
|
19
|
-
|
|
17
|
+
from prometheus_client import start_http_server
|
|
18
|
+
from prometheus_client.core import GaugeMetricFamily, REGISTRY
|
|
19
|
+
from prometheus_client.registry import Collector
|
|
20
20
|
|
|
21
|
+
DEFAULT_CLI = "jool"
|
|
22
|
+
DEFAULT_INSTANCE = "default"
|
|
23
|
+
DEFAULT_ADDR = "0.0.0.0"
|
|
21
24
|
DEFAULT_PORT = 6971
|
|
22
25
|
HOSTNAME = getfqdn()
|
|
23
26
|
LOG = logging.getLogger(__name__)
|
|
24
27
|
|
|
25
28
|
|
|
26
|
-
class JoolCollector:
|
|
29
|
+
class JoolCollector(Collector):
|
|
27
30
|
key_prefix = "jool"
|
|
28
31
|
labels = ["hostname"]
|
|
29
32
|
|
|
33
|
+
def __init__(self, args: argparse.Namespace):
|
|
34
|
+
super().__init__()
|
|
35
|
+
self.args = args
|
|
36
|
+
|
|
30
37
|
def _handle_counter(
|
|
31
38
|
self, category: str, value: float, explanation: str
|
|
32
39
|
) -> GaugeMetricFamily:
|
|
@@ -62,7 +69,8 @@ class JoolCollector:
|
|
|
62
69
|
|
|
63
70
|
def run_jool(self) -> Union[str, CompletedProcess]:
|
|
64
71
|
cmd = [
|
|
65
|
-
|
|
72
|
+
self.args.cli,
|
|
73
|
+
f"-i {self.args.instance}",
|
|
66
74
|
"stats",
|
|
67
75
|
"display",
|
|
68
76
|
"--csv",
|
|
@@ -89,6 +97,12 @@ def main() -> int:
|
|
|
89
97
|
parser = argparse.ArgumentParser(
|
|
90
98
|
description="Export `jool stats display` for prometheus"
|
|
91
99
|
)
|
|
100
|
+
parser.add_argument(
|
|
101
|
+
"-a",
|
|
102
|
+
"--addr",
|
|
103
|
+
default=DEFAULT_ADDR,
|
|
104
|
+
help=f"Address to bind socket to [Default = {DEFAULT_ADDR}]",
|
|
105
|
+
)
|
|
92
106
|
parser.add_argument(
|
|
93
107
|
"-d", "--debug", action="store_true", help="Verbose debug output"
|
|
94
108
|
)
|
|
@@ -99,12 +113,24 @@ def main() -> int:
|
|
|
99
113
|
default=DEFAULT_PORT,
|
|
100
114
|
help=f"Port to run webserver on [Default = {DEFAULT_PORT}]",
|
|
101
115
|
)
|
|
116
|
+
parser.add_argument(
|
|
117
|
+
"-i",
|
|
118
|
+
"--instance",
|
|
119
|
+
default=DEFAULT_INSTANCE,
|
|
120
|
+
help=f"Instance to listen to [Default = {DEFAULT_INSTANCE}]",
|
|
121
|
+
)
|
|
122
|
+
parser.add_argument(
|
|
123
|
+
"-c",
|
|
124
|
+
"--cli",
|
|
125
|
+
default=DEFAULT_CLI,
|
|
126
|
+
help=f"Cli to use (for instance jool or jool_siit) [Default = {DEFAULT_CLI}]",
|
|
127
|
+
)
|
|
102
128
|
args = parser.parse_args()
|
|
103
129
|
_handle_debug(args.debug)
|
|
104
130
|
|
|
105
131
|
LOG.info(f"Starting {sys.argv[0]}")
|
|
106
|
-
start_http_server(args.port)
|
|
107
|
-
REGISTRY.register(JoolCollector())
|
|
132
|
+
start_http_server(args.port, args.addr)
|
|
133
|
+
REGISTRY.register(JoolCollector(args))
|
|
108
134
|
LOG.info(f"jool prometheus exporter - listening on {args.port}")
|
|
109
135
|
try:
|
|
110
136
|
while True:
|
|
@@ -7,7 +7,6 @@ from pathlib import Path
|
|
|
7
7
|
|
|
8
8
|
from setuptools import setup
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
ptr_params = {
|
|
12
11
|
"entry_point_module": "jool_exporter",
|
|
13
12
|
"test_suite": "jool_exporter_tests",
|
|
@@ -33,7 +32,7 @@ def get_long_desc() -> str:
|
|
|
33
32
|
|
|
34
33
|
setup(
|
|
35
34
|
name="jool-exporter",
|
|
36
|
-
version="
|
|
35
|
+
version="26.2.3",
|
|
37
36
|
description="Export `jool stats display` for prometheus",
|
|
38
37
|
long_description=get_long_desc(),
|
|
39
38
|
long_description_content_type="text/markdown",
|
|
@@ -41,14 +40,11 @@ setup(
|
|
|
41
40
|
url="http://github.com/cooperlees/jool-exporter",
|
|
42
41
|
author="Cooper Lees",
|
|
43
42
|
author_email="me@cooperlees.com",
|
|
44
|
-
license="BSD",
|
|
43
|
+
license="BSD-3-Clause",
|
|
45
44
|
classifiers=[
|
|
46
45
|
"Development Status :: 3 - Alpha",
|
|
47
|
-
"License :: OSI Approved :: BSD License",
|
|
48
46
|
"Programming Language :: Python :: 3",
|
|
49
47
|
"Programming Language :: Python :: 3 :: Only",
|
|
50
|
-
"Programming Language :: Python :: 3.8",
|
|
51
|
-
"Programming Language :: Python :: 3.9",
|
|
52
48
|
],
|
|
53
49
|
python_requires=">=3.8",
|
|
54
50
|
entry_points={"console_scripts": ["jool-exporter = jool_exporter:main"]},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|