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 all periods to False is causing an error #78

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

Setting all periods to False is causing an error #78

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

Comments

@mlech-reef
Copy link

Describe the bug
Setting all periods to False is causing an error. See the traceback below.

SENTRY_ISSUES_1H=False
SENTRY_ISSUES_24H=False
SENTRY_ISSUES_14D=False

To Reproduce
Set:

SENTRY_ISSUES_1H=False
SENTRY_ISSUES_24H=False
SENTRY_ISSUES_14D=False

Expected behavior
If at least one is required, we should get a nice error message regarding misconfiguration.

Screenshots

maj 28 20:09:25 maciek-xps sentry-exporter[5355]: Traceback (most recent call last):                                                                                                                               
maj 28 20:09:25 maciek-xps sentry-exporter[5355]:   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2073, in wsgi_app                                                                             
maj 28 20:09:25 maciek-xps sentry-exporter[5355]:     response = self.full_dispatch_request()                                                                                                                      
maj 28 20:09:25 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:09:25 maciek-xps sentry-exporter[5355]:     rv = self.handle_user_exception(e)                                                                                                                           
maj 28 20:09:25 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:09:25 maciek-xps sentry-exporter[5355]:     rv = self.dispatch_request()                                                                                                                                 
maj 28 20:09:25 maciek-xps sentry-exporter[5355]:   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1502, in dispatch_request                                                                     
maj 28 20:09:25 maciek-xps sentry-exporter[5355]:     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)                                                                                 
maj 28 20:09:25 maciek-xps sentry-exporter[5355]:   File "/usr/local/lib/python3.7/site-packages/flask_httpauth.py", line 172, in decorated                                                                        
maj 28 20:09:25 maciek-xps sentry-exporter[5355]:     return self.ensure_sync(f)(*args, **kwargs)                                                                                                                  
maj 28 20:09:25 maciek-xps sentry-exporter[5355]:   File "/app/exporter.py", line 101, in sentry_exporter                                                                                                          
maj 28 20:09:25 maciek-xps sentry-exporter[5355]:     REGISTRY.register(SentryCollector(sentry, ORG_SLUG, get_metric_config(), PROJECTS_SLUG))                                                                     
maj 28 20:09:25 maciek-xps sentry-exporter[5355]:   File "/usr/local/lib/python3.7/site-packages/prometheus_client/registry.py", line 26, in register                                                              
maj 28 20:09:25 maciek-xps sentry-exporter[5355]:     names = self._get_names(collector)                                                                                                                           
maj 28 20:09:25 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:09:25 maciek-xps sentry-exporter[5355]:     for metric in desc_func():                                                                                                                                   
maj 28 20:09:25 maciek-xps sentry-exporter[5355]:   File "/app/helpers/prometheus.py", line 248, in collect                                                                                                        
maj 28 20:09:25 maciek-xps sentry-exporter[5355]:     project_issues_1h = project_issues.get(env).get("1h")                                                                                                        
maj 28 20:09:25 maciek-xps sentry-exporter[5355]: AttributeError: 'NoneType' object has no attribute 'get'

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 all periods to False is causing an error Setting all periods 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