NixOS/infra

prometheus-nixos-exporter traces on rhea

mweinelt opened this issue · 0 comments

The following trace is visible every 15 seconds when Prometheus queries.

Traceback (most recent call last):
  File "/nix/store/p1zbyfrpj3hq50mxh5hmxl3kqpa2b1am-python3-3.11.6/lib/python3.11/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/57qzqalpdgk4p2rjys669wn8lkbw99mm-python3-3.11.6-env/lib/python3.11/site-packages/prometheus_client/exposition.py", line 129, in prometheus_app
    status, headers, output = _bake_output(registry, accept_header, accept_encoding_header, params, disable_compression)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/57qzqalpdgk4p2rjys669wn8lkbw99mm-python3-3.11.6-env/lib/python3.11/site-packages/prometheus_client/exposition.py", line 105, in _bake_output
    output = encoder(registry)
             ^^^^^^^^^^^^^^^^^
  File "/nix/store/57qzqalpdgk4p2rjys669wn8lkbw99mm-python3-3.11.6-env/lib/python3.11/site-packages/prometheus_client/openmetrics/exposition.py", line 21, in generate_latest
    for metric in registry.collect():
  File "/nix/store/57qzqalpdgk4p2rjys669wn8lkbw99mm-python3-3.11.6-env/lib/python3.11/site-packages/prometheus_client/registry.py", line 97, in collect
    yield from collector.collect()
  File "/nix/store/lvxc959d2rvl6qxwkzx72nfjcgsabh6x-nixos-exporter.py", line 21, in collect
    self.get_time("/run/current-system"))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/lvxc959d2rvl6qxwkzx72nfjcgsabh6x-nixos-exporter.py", line 50, in get_time
    return parsed[0]['registrationTime']
           ~~~~~~^^^
KeyError: 0