mweinelt / kea-exporter

Export Kea Metrics in the Prometheus Exposition Format
MIT License
34 stars 17 forks source link

Merge request 729 not in pypi version. cumultative-assigned-addresses still causes crash #22

Closed brokenjacobs closed 4 years ago

brokenjacobs commented 4 years ago

18 Is still a problem. If you install from pypi:

        self.metrics_dhcp4_ignore = [
            # sums of different packet types
            'pkt4-sent',
            'pkt4-received',
            # sums of subnet values
            'declined-addresses',
            'declined-reclaimed-addresses',
            'reclaimed-declined-addresses',
            'reclaimed-leases'
        ]

The merged patch is not in there. Does the release need to be re-uploaded?

brokenjacobs commented 4 years ago

For anyone else hitting this you can work around it temporarily by:

python3 -mpip install git+https://github.com/mweinelt/kea-exporter.git@c0dacea450a65b22bb5284df0a0d0d1ef3bdafdd
brokenjacobs commented 4 years ago

Pulling in the commit still doesn't work:

Traceback (most recent call last):
  File "/usr/bin/kea-exporter", line 11, in <module>
    load_entry_point('kea-exporter==0.4.1', 'console_scripts', 'kea-exporter')()
  File "/usr/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/kea_exporter/cli.py", line 22, in cli
    exporter.update()
  File "/usr/lib/python3.8/site-packages/kea_exporter/kea.py", line 506, in update
    metric_info = self.metrics_dhcp4_map[key]
KeyError: 'cumulative-assigned-addresses'

also there is typo on line 508: elif kea. dhcp_version is DHCPVersion.DHCP6: there should not be a space there

brokenjacobs commented 4 years ago

using the latest commit in git does work. However the issue still remains that this is not the version in pypi

mweinelt commented 4 years ago

Yes, I'm sorry I haven't gotten to do a release. I will set myself a reminder for the weekend.

mweinelt commented 4 years ago

also there is typo on line 508: elif kea. dhcp_version is DHCPVersion.DHCP6: there should not be a space there

Fixed in 8c87966ed2db415d09bfff605c5445b0f908cf12, will be part of the next release.

mweinelt commented 4 years ago

Release v0.4.2 just now on PyPi. https://pypi.org/project/kea-exporter/0.4.2/