jool-exporter 25.3.8__py3-none-any.whl → 26.2.3__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,13 +1,12 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: jool-exporter
3
- Version: 25.3.8
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
8
+ License: BSD-3-Clause
9
9
  Classifier: Development Status :: 3 - Alpha
10
- Classifier: License :: OSI Approved :: BSD License
11
10
  Classifier: Programming Language :: Python :: 3
12
11
  Classifier: Programming Language :: Python :: 3 :: Only
13
12
  Requires-Python: >=3.8
@@ -21,6 +20,7 @@ Dynamic: description
21
20
  Dynamic: description-content-type
22
21
  Dynamic: home-page
23
22
  Dynamic: license
23
+ Dynamic: license-file
24
24
  Dynamic: requires-dist
25
25
  Dynamic: requires-python
26
26
  Dynamic: summary
@@ -0,0 +1,7 @@
1
+ jool_exporter.py,sha256=1cj9mmU8_JPj79dO-AAQ0msMbBMhFAD1TYowexFdNHw,4134
2
+ jool_exporter-26.2.3.dist-info/licenses/LICENSE,sha256=Nk_wwh_-xaIa8gwgiHAnfZqw8O0AaIawc2Wle2JoUCg,1321
3
+ jool_exporter-26.2.3.dist-info/METADATA,sha256=sZUKclHcfHcC4Fo7NLiT9xuVNuUruID4W9wctQfySiA,8173
4
+ jool_exporter-26.2.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
5
+ jool_exporter-26.2.3.dist-info/entry_points.txt,sha256=t84r-KaB7nTKr0GEpcUco1ueXh39-56igLzN49ME8vw,53
6
+ jool_exporter-26.2.3.dist-info/top_level.txt,sha256=SmhUI8tDD36vZuSOg0nbROONpGvBfjVH5AjwfnnVIlI,14
7
+ jool_exporter-26.2.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
jool_exporter.py CHANGED
@@ -18,7 +18,8 @@ from prometheus_client import start_http_server
18
18
  from prometheus_client.core import GaugeMetricFamily, REGISTRY
19
19
  from prometheus_client.registry import Collector
20
20
 
21
-
21
+ DEFAULT_CLI = "jool"
22
+ DEFAULT_INSTANCE = "default"
22
23
  DEFAULT_ADDR = "0.0.0.0"
23
24
  DEFAULT_PORT = 6971
24
25
  HOSTNAME = getfqdn()
@@ -29,6 +30,10 @@ class JoolCollector(Collector):
29
30
  key_prefix = "jool"
30
31
  labels = ["hostname"]
31
32
 
33
+ def __init__(self, args: argparse.Namespace):
34
+ super().__init__()
35
+ self.args = args
36
+
32
37
  def _handle_counter(
33
38
  self, category: str, value: float, explanation: str
34
39
  ) -> GaugeMetricFamily:
@@ -64,7 +69,8 @@ class JoolCollector(Collector):
64
69
 
65
70
  def run_jool(self) -> Union[str, CompletedProcess]:
66
71
  cmd = [
67
- "jool",
72
+ self.args.cli,
73
+ f"-i {self.args.instance}",
68
74
  "stats",
69
75
  "display",
70
76
  "--csv",
@@ -107,12 +113,24 @@ def main() -> int:
107
113
  default=DEFAULT_PORT,
108
114
  help=f"Port to run webserver on [Default = {DEFAULT_PORT}]",
109
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
+ )
110
128
  args = parser.parse_args()
111
129
  _handle_debug(args.debug)
112
130
 
113
131
  LOG.info(f"Starting {sys.argv[0]}")
114
132
  start_http_server(args.port, args.addr)
115
- REGISTRY.register(JoolCollector())
133
+ REGISTRY.register(JoolCollector(args))
116
134
  LOG.info(f"jool prometheus exporter - listening on {args.port}")
117
135
  try:
118
136
  while True:
@@ -1,7 +0,0 @@
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,,