greenstatic/bigbluebutton-exporter

ValueError: invalid literal for int() with base 10

fanfounet opened this issue · 2 comments

Hello,

On service start, bbb-exporter not start, in log i have
bbb-exporter | Traceback (most recent call last):
bbb-exporter | File "server.py", line 46, in
bbb-exporter | REGISTRY.register(collector)
bbb-exporter | File "/usr/local/lib/python3.8/site-packages/prometheus_client/registry.py", line 24, in register
bbb-exporter | names = self._get_names(collector)
bbb-exporter | File "/usr/local/lib/python3.8/site-packages/prometheus_client/registry.py", line 64, in _get_names
bbb-exporter | for metric in desc_func():
bbb-exporter | File "/app/collector.py", line 65, in collect
bbb-exporter | yield self.metric_participants(meetings)
bbb-exporter | File "/app/collector.py", line 119, in metric_participants
bbb-exporter | no_participants = reduce(lambda total, meeting: total + int(meeting['participantCount']), meetings, 0)
bbb-exporter | File "/app/collector.py", line 119, in
bbb-exporter | no_participants = reduce(lambda total, meeting: total + int(meeting['participantCount']), meetings, 0)
bbb-exporter | ValueError: invalid literal for int() with base 10: '1,976'

Can you help me ?

This seems to me like a bug. We probably expect an integer from BBB's API but instead we get a human formatted number (with a comma). I'll create a fix later today.

Sorry for the delay. Life.

The fix is available in the next exporter release (v0.7.0). I have gone ahead and created a preview build which you can test: greenstatic/bigbluebutton-exporter:v0.7.0-preview2

In your docker-compose.yaml simply replace the image field with the one above and let me know if you encounter any other issues.