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

chore: add more logging for alerts and reports #21714

Merged
merged 5 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion superset/reports/commands/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,11 @@ def send_error(self, name: str, message: str) -> None:
"""
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
)
Expand Down Expand Up @@ -690,6 +694,11 @@ def validate( # pylint: disable=arguments-differ
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()
5 changes: 5 additions & 0 deletions superset/tasks/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down