Not triggered DSS scenarios monitoring

Dataiku DSS Homepage
  • scenario last run time
  • load frequency
daily tag on scenario
client = dataiku.api_client()  
projects = client.list_projects()
for project in projects:

if 'projectStatus' in project and project['projectStatus'] == 'In production':
prj = client.get_project(project['projectKey'])
scenario_list = prj.list_scenarios()
for scenario in scenario_list:
scenario_handler = prj.get_scenario(scenario['id'])
last_run = scenario_handler.get_last_runs(limit=1)
date_diff = datetime.today() - last_run[0].get_start_time()
baseline = 1 if scenario['tags'][0] == 'daily' else 30
if date_diff.days - baseline >= 1:
message += "Following scenario has not run in required time interval \n"
message += ":red_circle: *" + scenario['name'] + "* in " + project['projectKey'] + " Project \n"
message += "*Run frequency:* " + scenario['tags'][0] + "\n"
message += "*Last run time:* " + last_run[0].get_start_time().strftime("%d-%m-%Y %H:%M:%S") + "\n"
message += "Scenario has not been running in last *" + str(date_diff.days) + "* days! Please check. \n"
message += "------------------------------------------------\n"
scenario_obj = Scenario()
scenario_obj.set_scenario_variables(info_message=message)
if not last_run:
not_run_msg = 'Following scenario has not run yet in Production. Please check if that is ok. \n'
not_run_msg += ":question: *" + scenario['name'] + "* in " + project['projectKey'] + " Project \n"
not_run_msg += "*Run frequency:* " + scenario['tags'][0] + "\n"
not_run_msg += "---------------------------------------------\n"
DSS Scenario reporter setup
Not triggered scenario Slack message

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tomáš Sobotík

Tomáš Sobotík

Lead data engineer @Tietoevry. Currently obsessed by cloud technologies and solutions in relation to data & analytics. ☁️ ❄️