jool-exporter 20.12.20__py3-none-any.whl → 25.3.8__py3-none-any.whl

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.
@@ -1,21 +1,29 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: jool-exporter
3
- Version: 20.12.20
3
+ Version: 25.3.8
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
8
  License: BSD
9
- Platform: UNKNOWN
10
9
  Classifier: Development Status :: 3 - Alpha
11
10
  Classifier: License :: OSI Approved :: BSD License
12
11
  Classifier: Programming Language :: Python :: 3
13
12
  Classifier: Programming Language :: Python :: 3 :: Only
14
- Classifier: Programming Language :: Python :: 3.8
15
- Classifier: Programming Language :: Python :: 3.9
16
13
  Requires-Python: >=3.8
17
14
  Description-Content-Type: text/markdown
18
- Requires-Dist: prometheus-client
15
+ License-File: LICENSE
16
+ Requires-Dist: prometheus_client
17
+ Dynamic: author
18
+ Dynamic: author-email
19
+ Dynamic: classifier
20
+ Dynamic: description
21
+ Dynamic: description-content-type
22
+ Dynamic: home-page
23
+ Dynamic: license
24
+ Dynamic: requires-dist
25
+ Dynamic: requires-python
26
+ Dynamic: summary
19
27
 
20
28
  # jool-exporter
21
29
 
@@ -51,6 +59,8 @@ From GitHub:
51
59
  so does the jool-exporter process. It also need to ability to pass the capability to child
52
60
  processes.
53
61
 
62
+ - From version **4.1.5** jool will no longer require this capability to query stats
63
+
54
64
  The process can also just run was `root`, but running things listening externally as `root`
55
65
  is a bad security process.
56
66
 
@@ -172,5 +182,3 @@ We use Facebook's [ptr](https://github.com/facebookincubator/ptr) for testing.
172
182
  It is driven by config in setup.py.
173
183
 
174
184
 
175
-
176
-
@@ -0,0 +1,7 @@
1
+ jool_exporter.py,sha256=xJQqIbkojAqtU0WJOASQBbZrphXcPlAvXXhacHfqDyw,3582
2
+ jool_exporter-25.3.8.dist-info/LICENSE,sha256=Nk_wwh_-xaIa8gwgiHAnfZqw8O0AaIawc2Wle2JoUCg,1321
3
+ jool_exporter-25.3.8.dist-info/METADATA,sha256=EmRFsCzmS5JQQ082rq_Gy-NdCkIZJTkU5TIX6yccDh8,8193
4
+ jool_exporter-25.3.8.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
5
+ jool_exporter-25.3.8.dist-info/entry_points.txt,sha256=t84r-KaB7nTKr0GEpcUco1ueXh39-56igLzN49ME8vw,53
6
+ jool_exporter-25.3.8.dist-info/top_level.txt,sha256=SmhUI8tDD36vZuSOg0nbROONpGvBfjVH5AjwfnnVIlI,14
7
+ jool_exporter-25.3.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.36.2)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,3 +1,2 @@
1
1
  [console_scripts]
2
2
  jool-exporter = jool_exporter:main
3
-
jool_exporter.py CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
 
3
- # This source code is licensed under the MIT license found in the
3
+ # This source code is licensed under the BSD license found in the
4
4
  # LICENSE file in the root directory of this source tree.
5
5
  # coding=utf8
6
6
 
@@ -14,16 +14,18 @@ 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.core import GaugeMetricFamily, REGISTRY # type: ignore
18
- from prometheus_client import start_http_server # type: ignore
17
+ from prometheus_client import start_http_server
18
+ from prometheus_client.core import GaugeMetricFamily, REGISTRY
19
+ from prometheus_client.registry import Collector
19
20
 
20
21
 
22
+ DEFAULT_ADDR = "0.0.0.0"
21
23
  DEFAULT_PORT = 6971
22
24
  HOSTNAME = getfqdn()
23
25
  LOG = logging.getLogger(__name__)
24
26
 
25
27
 
26
- class JoolCollector:
28
+ class JoolCollector(Collector):
27
29
  key_prefix = "jool"
28
30
  labels = ["hostname"]
29
31
 
@@ -61,7 +63,15 @@ class JoolCollector:
61
63
  LOG.info(f"Collection finished in {run_time}s")
62
64
 
63
65
  def run_jool(self) -> Union[str, CompletedProcess]:
64
- cmd = ["jool", "stats", "display", "--csv", "--no-headers", "--explain"]
66
+ cmd = [
67
+ "jool",
68
+ "stats",
69
+ "display",
70
+ "--csv",
71
+ "--no-headers",
72
+ "--explain",
73
+ "--all",
74
+ ]
65
75
  cp = run(cmd, stderr=PIPE, stdout=PIPE, encoding="utf8")
66
76
  if cp.returncode:
67
77
  return cp
@@ -81,6 +91,12 @@ def main() -> int:
81
91
  parser = argparse.ArgumentParser(
82
92
  description="Export `jool stats display` for prometheus"
83
93
  )
94
+ parser.add_argument(
95
+ "-a",
96
+ "--addr",
97
+ default=DEFAULT_ADDR,
98
+ help=f"Address to bind socket to [Default = {DEFAULT_ADDR}]",
99
+ )
84
100
  parser.add_argument(
85
101
  "-d", "--debug", action="store_true", help="Verbose debug output"
86
102
  )
@@ -95,7 +111,7 @@ def main() -> int:
95
111
  _handle_debug(args.debug)
96
112
 
97
113
  LOG.info(f"Starting {sys.argv[0]}")
98
- start_http_server(args.port)
114
+ start_http_server(args.port, args.addr)
99
115
  REGISTRY.register(JoolCollector())
100
116
  LOG.info(f"jool prometheus exporter - listening on {args.port}")
101
117
  try:
@@ -1,7 +0,0 @@
1
- jool_exporter.py,sha256=GUnkdZ9GOsPrHHzwijqbZ0M7QQQzQGrlYAVgPtoRwJ4,3251
2
- jool_exporter-20.12.20.dist-info/LICENSE,sha256=Nk_wwh_-xaIa8gwgiHAnfZqw8O0AaIawc2Wle2JoUCg,1321
3
- jool_exporter-20.12.20.dist-info/METADATA,sha256=2r8dBC2G-5uKZSpbb3M_CgJSClisGeE2Np32CwUKNlw,7994
4
- jool_exporter-20.12.20.dist-info/WHEEL,sha256=OqRkF0eY5GHssMorFjlbTIq072vpHpF60fIQA6lS9xA,92
5
- jool_exporter-20.12.20.dist-info/entry_points.txt,sha256=QpzQw2sQ6T7pdUNvXMn1p8tBgElBe4PvCjKY2trUnVQ,54
6
- jool_exporter-20.12.20.dist-info/top_level.txt,sha256=SmhUI8tDD36vZuSOg0nbROONpGvBfjVH5AjwfnnVIlI,14
7
- jool_exporter-20.12.20.dist-info/RECORD,,