Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting 24h to True and 1h to False is causing an error #79

Open
mlech-reef opened this issue May 28, 2023 · 0 comments
Open

Setting 24h to True and 1h to False is causing an error #79

mlech-reef opened this issue May 28, 2023 · 0 comments

Comments

@mlech-reef
Copy link

Describe the bug
Setting 24h to True and 1h to False is causing an error. See the traceback below.

To Reproduce
Set:

SENTRY_ISSUES_1H=False
SENTRY_ISSUES_24H=True
SENTRY_ISSUES_14D=False

Expected behavior
It should not cause an error.

Screenshots

maj 28 20:21:16 maciek-xps sentry-exporter[5355]: [2023-05-28 18:21:16 +0000] [10] [ERROR] Exception on /metrics/ [GET]
maj 28 20:21:16 maciek-xps sentry-exporter[5355]: Traceback (most recent call last):
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2073, in wsgi_app
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:     response = self.full_dispatch_request()
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1518, in full_dispatch_request
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:     rv = self.handle_user_exception(e)
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1516, in full_dispatch_request
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:     rv = self.dispatch_request()
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1502, in dispatch_request
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:   File "/usr/local/lib/python3.7/site-packages/flask_httpauth.py", line 172, in decorated
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:     return self.ensure_sync(f)(*args, **kwargs)
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:   File "/app/exporter.py", line 101, in sentry_exporter 
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:     REGISTRY.register(SentryCollector(sentry, ORG_SLUG, get_metric_config(), PROJECTS_SLUG))
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:   File "/usr/local/lib/python3.7/site-packages/prometheus_client/registry.py", line 26, in register
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:     names = self._get_names(collector)
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:   File "/usr/local/lib/python3.7/site-packages/prometheus_client/registry.py", line 66, in _get_names
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:     for metric in desc_func():
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:   File "/app/helpers/prometheus.py", line 217, in collect
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:     __data = self.__build_sentry_data()
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:   File "/app/helpers/prometheus.py", line 208, in __build_sentry_data
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:     api_data = self.__build_sentry_data_from_api()
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:   File "/app/helpers/prometheus.py", line 190, in __build_sentry_data_from_api
maj 28 20:21:16 maciek-xps sentry-exporter[5355]:     projects_issue_data[project.get("slug")][k].update({"24h": v})
maj 28 20:21:16 maciek-xps sentry-exporter[5355]: KeyError: 'prod'

Desktop (please complete the following information):

  • OS: ubuntu 22.04
  • Browser: curl 7.81.0

Additional context
N/A

@mlech-reef mlech-reef changed the title Setting 24h to True and 1h to False is causing an error. Setting 24h to True and 1h to False is causing an error May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant