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

Add celery_logging_level #21506

Merged
merged 1 commit into from
Feb 19, 2022
Merged

Conversation

pingzh
Copy link
Contributor

@pingzh pingzh commented Feb 10, 2022

so that we don't need to change the log level for task execution if we want celery debug level log.

This allows us to control the log level separately.

test when with the celery_logging_level = DEBUG:

[2022-02-10 14:47:15,302: INFO/MainProcess] Task airflow.executors.celery_executor.execute_command[eff889b8-cdae-40f8-8548-f848d0828f66] received
[2022-02-10 14:47:15,302: DEBUG/MainProcess] TaskPool: Apply <function fast_trace_task at 0x160e8c790> (args:('airflow.executors.celery_executor.execute_command', 'eff889b8-cdae-40f8-8548-f848d0828f66', {'lang': 'py', 'task': 'airflow.executors.celery_executor.execute_command', 'id': 'eff889b8-cdae-40f8-8548-f848d0828f66', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'retries': 0, 'timelimit': [None, None], 'root_id': 'eff889b8-cdae-40f8-8548-f848d0828f66', 'parent_id': None, 'argsrepr': "[['airflow', 'run', '1_ping_lots_lost', 'run_after_loop', '2022-01-30T00:00:00+00:00', '--local', '--pool', 'default_pool', '-sd', '/Users/ping_zhang/airflow/dags/hi.py']]", 'kwargsrepr': '{}', 'origin': '[email protected]', 'redelivered': True, 'properties': {'correlation_id': 'eff889b8-cdae-40f8-8548-f848d0828f66', 'reply_to': '6cdc675b-bcc0-3a27-a68a-76a94d625eb6', 'delivery_mode': 2, 'delivery_info': {'exchange': '', 'routing_key': 'default'}, 'priority': 0, 'body_encoding': 'base64', 'delivery_tag': 'd672c17a-c2fc-4ff5-aa44-aac9b1bbbe84'}, 'reply_to': '6cdc675b-bcc0-3a27-a68a-76a94d625eb6',... kwargs:{})
[2022-02-10 14:47:15,310: INFO/MainProcess] Task airflow.executors.celery_executor.execute_command[97946e5a-8b48-460a-a0d6-c6acb7f9bebf] received
[2022-02-10 14:47:15,310: DEBUG/MainProcess] TaskPool: Apply <function fast_trace_task at 0x160e8c790> (args:('airflow.executors.celery_executor.execute_command', '97946e5a-8b48-460a-a0d6-c6acb7f9bebf', {'lang': 'py', 'task': 'airflow.executors.celery_executor.execute_command', 'id': '97946e5a-8b48-460a-a0d6-c6acb7f9bebf', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'retries': 0, 'timelimit': [None, None], 'root_id': '97946e5a-8b48-460a-a0d6-c6acb7f9bebf', 'parent_id': None, 'argsrepr': "[['airflow', 'run', '1_ping_lots_lost', 'run_after_loop', '2022-02-01T00:00:00+00:00', '--local', '--pool', 'default_pool', '-sd', '/Users/ping_zhang/airflow/dags/hi.py']]", 'kwargsrepr': '{}', 'origin': '[email protected]', 'redelivered': True, 'properties': {'correlation_id': '97946e5a-8b48-460a-a0d6-c6acb7f9bebf', 'reply_to': '6cdc675b-bcc0-3a27-a68a-76a94d625eb6', 'delivery_mode': 2, 'delivery_info': {'exchange': '', 'routing_key': 'default'}, 'priority': 0, 'body_encoding': 'base64', 'delivery_tag': 'a8fe536f-51c2-41d6-8eec-88ad1ed23a75'}, 'reply_to': '6cdc675b-bcc0-3a27-a68a-76a94d625eb6',... kwargs:{})
[2022-02-10 14:47:15,322: INFO/MainProcess] Task airflow.executors.celery_executor.execute_command[5b93b8e4-94a6-449f-8ef7-77b4dcbf34b8] received

^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@pingzh pingzh force-pushed the pingzh-able-to-config-celery-log branch from 73fe778 to ce91a47 Compare February 10, 2022 23:42
Copy link
Member

@KevinYang21 KevinYang21 left a comment

Choose a reason for hiding this comment

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

Do you mind provide a bit more context around why do we need this change? E.g. what celery log we would need from a different log level?

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

It is a bit breaking change. If someone had logging level set to WARNING, implementing this one will change celery logging level to INFO.

I think the logic should look a little different to account for that. The "celery_logging_level" should have no default and when it is missing, the "logging_level" should be used. This way it will be fully backwards-compatible.

@pingzh pingzh force-pushed the pingzh-able-to-config-celery-log branch from ce91a47 to 8667d56 Compare February 14, 2022 18:19
@pingzh
Copy link
Contributor Author

pingzh commented Feb 14, 2022

hi @potiuk , resolved your comment, please take a look thanks

@pingzh pingzh force-pushed the pingzh-able-to-config-celery-log branch from 8667d56 to a853c69 Compare February 14, 2022 20:13
@pingzh pingzh requested a review from potiuk February 15, 2022 20:44
@potiuk potiuk merged commit ecd85f8 into apache:main Feb 19, 2022
@pingzh pingzh deleted the pingzh-able-to-config-celery-log branch February 22, 2022 18:22
@jedcunningham jedcunningham added the type:new-feature Changelog: New Features label Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:CLI type:new-feature Changelog: New Features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants