chore: add more logging for alerts and reports (#21714)

This commit is contained in:
Phillip Kelley-Dotson 2022-10-13 12:53:02 -07:00 committed by GitHub
parent 2258fbf878
commit f4fa2e1115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -437,7 +437,11 @@ class BaseReportState:
"""
header_data = self._get_log_data()
header_data["error_text"] = message
logger.info("header_data info %s", header_data)
logger.info(
"header_data in notifications for alerts and reports %s, taskid, %s",
header_data,
self._execution_id,
)
notification_content = NotificationContent(
name=name, text=message, header_data=header_data
)
@ -690,6 +694,11 @@ class AsyncExecuteReportScheduleCommand(BaseCommand):
self, session: Session = None
) -> None:
# Validate/populate model exists
logger.info(
"session is validated: id %s, executionid: %s",
self._model_id,
self._execution_id,
)
self._model = ReportScheduleDAO.find_by_id(self._model_id, session=session)
if not self._model:
raise ReportScheduleNotFoundError()

View File

@ -76,6 +76,11 @@ def execute(report_schedule_id: int, scheduled_dttm: str) -> None:
try:
task_id = execute.request.id
scheduled_dttm_ = parser.parse(scheduled_dttm)
logger.info(
"Executing alert/report, task id: %s, scheduled_dttm: %s",
task_id,
scheduled_dttm,
)
AsyncExecuteReportScheduleCommand(
task_id,
report_schedule_id,