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

[AIRFLOW-4741] Include Sentry into core Airflow #5407

Merged
merged 6 commits into from
Sep 24, 2019
Merged

Conversation

tiopi
Copy link
Contributor

@tiopi tiopi commented Jun 11, 2019

Make sure you have checked all steps below.

Jira

  • My PR addresses the following Airflow Jira issues and references them in the PR title:

https://issues.apache.org/jira/browse/AIRFLOW-4741

Description

  • Here are some details about my PR, including screenshots of any UI changes:
    This PR is to add Sentry SDK functionality to Airflow. The functionality includes adding tags per task event and breadcrumbs of previous tasks that ran on the DAG.

Differences between #5416 and #5407:
#5416: PR focuses on adding Sentry functionality to specific DAGs. This is achieved by adding a sentry hook to the contrib folder. Users can then simply call the hook with their SENTRY_DSN for each DAG.
#5407: PR focuses on adding Sentry to the Airflow ecosystem. Its aim is to handle all errors within airflow (Scheduler, worker, DAGs, tasks). (This is the continuation of #5382, which I closed by accident.)

Tests

  • My PR adds unit tests for sentry.py.

Commits

  • My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • In case of new functionality, my PR adds documentation under error.rst.

Code Quality

  • Passes flake8

@pgagnon
Copy link
Contributor

pgagnon commented Jun 12, 2019

@tiopi CI is sad due to a couple of pylint errors: https://travis-ci.org/apache/airflow/jobs/544497697

edit: Wrong mentions. Sorry! My github UI bugged out. 😥

@codecov-io
Copy link

codecov-io commented Jun 14, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@7506c95). Click here to learn what that means.
The diff coverage is 87.34%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5407   +/-   ##
=========================================
  Coverage          ?   79.82%           
=========================================
  Files             ?      609           
  Lines             ?    35126           
  Branches          ?        0           
=========================================
  Hits              ?    28040           
  Misses            ?     7086           
  Partials          ?        0
Impacted Files Coverage Δ
airflow/models/taskinstance.py 93.75% <100%> (ø)
airflow/models/dag.py 91.7% <60%> (ø)
airflow/sentry.py 88.88% <88.88%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7506c95...fe0af33. Read the comment docs.

@tiopi tiopi force-pushed the add_sentry branch 2 times, most recently from 38378a9 to 6dd09d5 Compare June 14, 2019 19:53
@tiopi
Copy link
Contributor Author

tiopi commented Jun 14, 2019

@tiopi CI is sad due to a couple of pylint errors: https://travis-ci.org/apache/airflow/jobs/544497697

edit: Wrong mentions. Sorry! My github UI bugged out. 😥

I got the tests to finally pass!

@tiopi tiopi force-pushed the add_sentry branch 2 times, most recently from a070b4b to b7a1c76 Compare June 17, 2019 22:46
Copy link
Contributor

@pgagnon pgagnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursory glance.

docs/errors.rst Outdated Show resolved Hide resolved
scripts/ci/pylint_todo.txt Outdated Show resolved Hide resolved
@tiopi tiopi force-pushed the add_sentry branch 2 times, most recently from 7cdf31f to 069d34d Compare June 18, 2019 22:57
airflow/config_templates/default_airflow.cfg Outdated Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
airflow/sentry.py Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
@tiopi tiopi force-pushed the add_sentry branch 5 times, most recently from 83cd366 to 7f296b0 Compare July 2, 2019 07:57
@houqp
Copy link
Member

houqp commented Jul 18, 2019

Is this PR still blocked on any requested change? If so, I would like to help so it can be merged for our internal use.

@ashb
Copy link
Member

ashb commented Jul 18, 2019

It's blocked on me finding the time to review it (but a lot of my available time has been taking up with Release Management work).

setup.py Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
@tiopi tiopi force-pushed the add_sentry branch 2 times, most recently from 374c344 to ec878b2 Compare July 23, 2019 22:11
@houqp
Copy link
Member

houqp commented Aug 5, 2019

Looks like all review feedbacks have been addressed, any blocker I could help resolve to get it merged?

@tiopi tiopi force-pushed the add_sentry branch 2 times, most recently from 326af63 to 99ada8c Compare August 16, 2019 07:46
@tiopi
Copy link
Contributor Author

tiopi commented Aug 21, 2019

cc @jmcarp @ashb

Copy link
Contributor

@pgagnon pgagnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done a couple of passes on this and it's LGTM to me at this point barring a minor doc nit.

@ashb WDYT?

docs/errors.rst Show resolved Hide resolved
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it took me so long to review this.

I have some questions about the data we sent to Sentry that I think would be cleared up by some example screenshots.

airflow/sentry.py Outdated Show resolved Hide resolved
airflow/sentry.py Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
docs/errors.rst Outdated Show resolved Hide resolved
@houqp
Copy link
Member

houqp commented Sep 18, 2019

we are almost there! @tiopi let me know if there is anything I can help to get it over the finish line.

airflow/models/taskinstance.py Outdated Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
docs/errors.rst Outdated Show resolved Hide resolved
docs/errors.rst Show resolved Hide resolved
docs/errors.rst Outdated Show resolved Hide resolved
airflow/sentry.py Outdated Show resolved Hide resolved
Osmar Coronel and others added 5 commits September 23, 2019 12:37
This commit intends to add Sentry to the core functionality of
Airflow. It takes an approach like Statsd for simple integration.
The commit makes use of tagging and breadcrumbs for more error
information. Add testing for tagging and breadcrumbs. Add
documentation for Airflow Error tracking.
@tiopi tiopi requested a review from ashb September 23, 2019 20:14
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took many months (sorry!) but we got there in the end!

@ashb ashb merged commit dc3bfe4 into apache:master Sep 24, 2019
@houqp
Copy link
Member

houqp commented Sep 24, 2019

great job @tiopi!

ashb pushed a commit to ashb/airflow that referenced this pull request Oct 14, 2019
This commit intends to add Sentry to the core functionality of
Airflow. It takes an approach like Statsd for simple integration.
The commit makes use of tagging and breadcrumbs for more error
information.

(cherry picked from commit dc3bfe4)
adityav pushed a commit to adityav/airflow that referenced this pull request Oct 14, 2019
This commit intends to add Sentry to the core functionality of
Airflow. It takes an approach like Statsd for simple integration.
The commit makes use of tagging and breadcrumbs for more error
information.

(cherry picked from commit dc3bfe4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants