tiopi commented on a change in pull request #5407: [AIRFLOW-4741] Include Sentry into core Airflow URL: https://github.com/apache/airflow/pull/5407#discussion_r299270418
########## File path: airflow/sentry.py ########## @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from typing import Any + +from airflow import configuration as conf +from airflow.utils.db import provide_session +from airflow.utils.log.logging_mixin import LoggingMixin + + +log = LoggingMixin().log + + +class DummySentry: + """ + Blank class for Sentry. + """ + + @classmethod + def add_tagging(cls, task_instance): + pass + + @classmethod + def add_breadcrumbs(cls, session=None): + pass + + +@provide_session +def get_task_instance(task, execution_date, session=None): Review comment: * The breadcrumb initially was meant to recreate the dag for the specific task. However, I see more value in adding more information and adding more tasks to the breadcrumbs. * I was doing `message` field for the reason that if there were lots of upstream tasks, the messages would not take as much space as the data table does. However, I do see more value in `data`. * I was thinking about passing all tasks that have completed (Success or Failure) into the breadcrumbs, but ended up going with only upstream tasks as a starting point since they are the ones that affect the current task the most. However, I changed it to include all tasks that have completed. * Refactoring of `get_task_instance` to `get_task_instances` is done! ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
