Automated reporting of failed tasks

1173
3
01-28-2021 11:40 PM
RobertSpál1
New Contributor III

Hi, we have a lot of notebooks on our notebook server that have scheduled tasks. Sometimes some of them fail and we have to manually check all to find out if some of them do. It would be really nice if there was some kind of reporting dashboard(could be very simple) that would show if there were failed tasks and if so which one failed.

Cheers!

Rob

3 Comments
by Anonymous User

It’s no dashboard, but if you are using try catch finally in your books you can wire in some logging components to capture the fails.  Then in the finally blocks, check the logs for errors and send an email or text message to whomever needs to know.  

jcarlson

Building off of your idea and @Anonymous User's comment, we actually built our own "Notebook Admin Dashboard". Here's what we did:

  1. Create a standalone table with the following fields:
    • Timestamp
    • Level / Severity
    • Message
    • Origin
  2. Add some try/catch/finally to your notebooks
  3. Implement a "logging" process on the basis of step 2
    • Instead of logging to a traditional text file, submit log as edits to the standalone table form step 1
    • We use a custom "add_log(message, level, origin)" function to submit ours to make the rest of the script a little cleaner and easy to read
  4. Create a dashboard that references the standalone table
    • Table rows as a list element
    • Side / header bar with selectors for severity / origin / time range
    • Indicators for a single-glance view of "how many errors in past 24 hours", etc

jCarlson_0-1611928985035.png

 

If you wanted to take it a step further, you can even add webhooks to the standalone table layer to send emails when there are certain edits.

RaviNarayanan
Status changed to: Under Consideration

Hi @RobertSpál1 Is this Notebooks in ArcGIS Enterprise or ArcGIS Online. Administrators have the ability to view all scheduled tasks via the Notebook server manager in ArcGIS Enterprise. A similar capability is not available in ArcGIS Online yet. We have an open issue for presenting tasks information for non-admin notebook users. Will add your thoughts/feedback to that issue.

Optionally you can use the ArcGIS API for Python in a notebook to view/manage your scheduled tasks: https://developers.arcgis.com/python/api-reference/arcgis.gis.tasks.html

Thanks @jcarlson  for your feedback and alternate suggestions.