tiopi commented on a change in pull request #5382: [AIRFLOW-4741] Include 
Sentry for Airflow
URL: https://github.com/apache/airflow/pull/5382#discussion_r291728704
 
 

 ##########
 File path: airflow/contrib/hooks/sentry_hook.py
 ##########
 @@ -0,0 +1,91 @@
+from airflow.hooks.base_hook import BaseHook
+from airflow.utils.db import provide_session
+from airflow.models import TaskInstance
+
+from sentry_sdk.integrations.celery import CeleryIntegration
+from sentry_sdk.integrations.logging import ignore_logger
+from sentry_sdk import configure_scope, add_breadcrumb, init
+
+original_task_init = TaskInstance.__init__
+original_clear_xcom = TaskInstance.clear_xcom_data
+SCOPE_TAGS = frozenset(("task_id", "dag_id", "execution_date", "ds", 
"operator"))
 
 Review comment:
   I removed ds, so it will only be execution_date and operator. These are to 
keep tags of tasks that fail. These tags are helpful to group and know whether 
the failure is due to an operator or perhaps just the execution date.

----------------------------------------------------------------
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

Reply via email to