Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Exceptions occurring during check executions are not formatted - so not easily readable #535

Closed
vetinari opened this issue Jan 24, 2018 · 4 comments
Labels
feature Improvements, enhancement, functionality requested by users Revisit Relevant issue. Needs to be tackled as part of current stabilising work UI

Comments

@vetinari
Copy link
Contributor

With the merge of zalando-zmon/zmon-worker#310 we get a stack trace in the "value" field of a check like

"Traceback (most recent call last):\n  File \"/usr/local/lib/python2.7/dist-packages/zmon_worker-0.1-py2.7.egg/zmon_worker_monitor/zmon_worker/tasks/main.py\", line 1200, in _get_check_result_internal\n    result = safe_eval(cmd, eval_source='<check-command>', **ctx)\n  File \"/usr/local/lib/python2.7/dist-packages/zmon_worker-0.1-py2.7.egg/zmon_worker_monitor/zmon_worker/common/eval.py\", line 187, in safe_eval\n    return c()  # if a function will return another callable, we will not call it\n  File \"<check-command>\", line 3, in check\nKeyError: 'foo'\n"

This should be formatted nicely, so it's readable and not just one long line.

The stack trace above was created by running

def check():
    foo = {'bar': 'baz'}
    return foo['foo']

in trial run

@vetinari vetinari added the feature Improvements, enhancement, functionality requested by users label Jan 24, 2018
@vetinari
Copy link
Contributor Author

For exceptions in the alert it's in captures['exception']

@rajatparida86 rajatparida86 added the Revisit Relevant issue. Needs to be tackled as part of current stabilising work label Jul 17, 2018
@beverage
Copy link

@vetinari We cannot repro this - is it still an issue?

@rajatparida86 rajatparida86 removed the Revisit Relevant issue. Needs to be tackled as part of current stabilising work label Jul 17, 2018
@rajatparida86 rajatparida86 added the Revisit Relevant issue. Needs to be tackled as part of current stabilising work label Aug 1, 2018
@rajatparida86 rajatparida86 changed the title Format exceptions in the UI Exceptions occurring during check executions are not formatted - so not easily readable Aug 1, 2018
@beverage
Copy link

beverage commented Aug 1, 2018

Example:

https://zmon.zalando.net/#/trial-run?json=%7B%22entities%22:%5B%7B%22type%22:%22local%22,%22infrastructure_account%22:%22aws:<aws_account_id>%22%7D%5D,%22entities_exclude%22:%5B%5D,%22parameters%22:%7B%7D,%22interval%22:120,%22name%22:%22foo%22,%22description%22:%22bar%22,%22owning_team%22:%22Eagle%20Eye%22,%22check_command%22:%22def%20check():%5Cn%20%20%20%20return%205%2F0%22,%22alert_condition%22:%22True%22%7D

@arajain
Copy link
Contributor

arajain commented Sep 25, 2018

Fixed

@arajain arajain closed this as completed Sep 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Improvements, enhancement, functionality requested by users Revisit Relevant issue. Needs to be tackled as part of current stabilising work UI
Projects
None yet
Development

No branches or pull requests

5 participants