-
Notifications
You must be signed in to change notification settings - Fork 16.3k
[AIRFLOW-6065] Add Stackdriver Task Handler #6660
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
Conversation
a86098c to
6cab6ee
Compare
52cad3b to
6f55793
Compare
30bb377 to
9ebec28
Compare
Codecov Report
@@ Coverage Diff @@
## master #6660 +/- ##
==========================================
- Coverage 86.6% 86.16% -0.45%
==========================================
Files 873 874 +1
Lines 40725 40836 +111
==========================================
- Hits 35271 35186 -85
- Misses 5454 5650 +196
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to have both read and emit in the same class? I think it will be better if we have separate "Logging Handler" and separate LogReader - maybe deriving from the same base class. I think those two have fundamentally different purpose and should be separated.
Also it should be described how to configure reading the logs from stackdriver. This can be separated out to a completely separate PR BTW.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to avoid modifying the API, but in this change I would like to implement the current Airflow interface. Currently in Airflow the process of saving and reading is combined in one class.
If you want, you can configure another handler to read logs using task_log_reader option in airflow.cfg file.
https://github.com/apache/airflow/blob/master/airflow/config_templates/default_airflow.cfg#L191-L193
I agree that the log API needs improvement, but this is not the scope of this PR.
Can you look at my comment that discusses API issues?
#5177 (comment)
docs/howto/write-logs.rst
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| :class:`logging.config.dictConfig`. If your file is not importable, then you should set a :any:``PYTHONPATH`` environment. | |
| :class:`logging.config.dictConfig`. If your file is not in a standard import location, then you should set a :any:``PYTHONPATH`` | |
| environment. Airflow adds the ``config/`` folder inside ``AIRFLOW_HOME`` to the import path for this purpose. |
docs/howto/write-logs.rst
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the __init__ is needed here, as ~/airflow/config is already in the python path so can be imported as log_config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. In Python 2.7 this was required.
docs/howto/write-logs.rst
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've had problems in the past with the default config changing and people's installs breaking.
I think we should instead recommend people do this as
form copy import deepcopy
from airflow.config_templates.airflow_local_settings import DEFAULT_LOGGING_CONFIG
LOGGING_CONFIG = deepcopy(DEFAULT_LOGGING_CONFIG)
# Update LOGGING_CONFIG as needed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the description
9d75c52 to
b073090
Compare
|
Please rebase to latest master @mik-laj - we had a six drama on Travis but it's solved now. |
2f181f4 to
66cd96c
Compare
66cd96c to
ea1c391
Compare
|
If you are interested, you can work on integrating Web UI with Stackdriver. |
|
@mik-laj we have every week mini hackathon so if this is not urgent we are doing this every Thursday 8:00-9:30 with 5-6 people. Now we are working on enabling multiple remote loggers in Airflow, and we can also try to take this Stackdriver logs in Web UI. |
|
If you would like to work more on OOS then we are recruiting ;-) This is absolutely not urgent. This is just one of my ideas that I came up with while working on this PR. |
Make sure you have checked all steps below.
Jira
Description
Tests
Commits
Documentation