phsmith / rundeck_exporter

Rundeck Metrics Exporter
GNU General Public License v3.0
58 stars 25 forks source link

Upgrading to Rundeck 4.3.0 broke the exporter #50

Closed broferek closed 2 years ago

broferek commented 2 years ago

I recently upgraded to Rundeck 4.3.0 and can no longer make the exporter start. It runs in a Podman container.

Here is the stacktrace on which the exporter exits

Traceback (most recent call last):
  File "/usr/bin/rundeck_exporter.py", line 488, in <module>
    RundeckMetricsCollector.run()
  File "/usr/bin/rundeck_exporter.py", line 475, in run
    REGISTRY.register(RundeckMetricsCollector())
  File "/usr/local/lib/python3.10/site-packages/prometheus_client/registry.py", line 26, in register
    names = self._get_names(collector)
  File "/usr/local/lib/python3.10/site-packages/prometheus_client/registry.py", line 66, in _get_names
    for metric in desc_func():
  File "/usr/bin/rundeck_exporter.py", line 396, in collect
    if api_version >= self.args.rundeck_api_version < 25 \
TypeError: '>=' not supported between instances of 'str' and 'int'

I also tried to set the Rundeck API version in the env variable RUNDECK_API_VERSION however it didn't change anything.

I guess the api_version returned from /system/info is now considered as a string which makes the comparison fail.

broferek commented 2 years ago

I just tried to run the exporter from the source code and I can confirm that api_version belongs to the String class.

api_version has to be cast to an integer.

phsmith commented 2 years ago

@broferek Thanks for the contribution!

broferek commented 2 years ago

Thanks for the quick release, really appreciated @phsmith

2.4.10 works like a charm with Rundeck 4.3.0 !