Skip to content

Add args to LOG_RECEIVED (fixes #6885)#6898

Merged
thedrow merged 2 commits intocelery:masterfrom
daveisfera:master
Aug 17, 2021
Merged

Add args to LOG_RECEIVED (fixes #6885)#6898
thedrow merged 2 commits intocelery:masterfrom
daveisfera:master

Conversation

@daveisfera
Copy link
Copy Markdown
Contributor

Description

Add args to the context that's logged with LOG_RECEIVED (like LOG_REJECTED)

Fixed #6885

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Aug 5, 2021

This pull request fixes 2 alerts when merging 359bb27 into ebeb4a4 - view on LGTM.com

fixed alerts:

  • 2 for Wrong name for an argument in a call

auvipy
auvipy previously requested changes Aug 6, 2021
Copy link
Copy Markdown
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

please check the test failures

@daveisfera
Copy link
Copy Markdown
Contributor Author

Are there instructions on how to run the tests locally?

@daveisfera
Copy link
Copy Markdown
Contributor Author

Sorry for the delay. I still haven't fixed my local setup to work with the GitHub password changes, so I couldn't push changes and just ended up doing it through the web UI, so hopefully the tests will pass now.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 17, 2021

Codecov Report

Merging #6898 (574e0ca) into master (ebeb4a4) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6898      +/-   ##
==========================================
- Coverage   89.23%   89.20%   -0.03%     
==========================================
  Files         138      138              
  Lines       16626    16654      +28     
  Branches     2099     2106       +7     
==========================================
+ Hits        14836    14857      +21     
- Misses       1571     1577       +6     
- Partials      219      220       +1     
Flag Coverage Δ
unittests 89.20% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
celery/app/trace.py 98.58% <ø> (ø)
celery/worker/strategy.py 92.00% <100.00%> (+0.08%) ⬆️
celery/bin/base.py 44.38% <0.00%> (-2.61%) ⬇️
celery/backends/asynchronous.py 60.18% <0.00%> (-0.47%) ⬇️
celery/bin/call.py 88.88% <0.00%> (ø)
celery/worker/request.py 96.89% <0.00%> (ø)
celery/app/task.py 94.66% <0.00%> (+0.01%) ⬆️
celery/backends/base.py 93.42% <0.00%> (+0.02%) ⬆️
celery/local.py 91.31% <0.00%> (+0.55%) ⬆️
celery/backends/consul.py 83.05% <0.00%> (+17.01%) ⬆️

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 ebeb4a4...574e0ca. Read the comment docs.

@thedrow thedrow merged commit ad99471 into celery:master Aug 17, 2021
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Aug 17, 2021

This pull request fixes 2 alerts when merging 574e0ca into 2ac3310 - view on LGTM.com

fixed alerts:

  • 2 for Wrong name for an argument in a call

jeyrce pushed a commit to jeyrce/celery that referenced this pull request Aug 25, 2021
* Add args and kwargs to LOG_RECEIVED and LOG_SUCCESS

* Add kwargs and args to test
@amitoj9
Copy link
Copy Markdown

amitoj9 commented May 17, 2022

hey @daveisfera is there a way to get rid of args n kwargs from getting logged ?

@daveisfera
Copy link
Copy Markdown
Contributor Author

Should be possible by customizing the logger config. I haven't done that myself (because I wanted the args and kwargs to be logged), but it should be possible

@anitalaw
Copy link
Copy Markdown

anitalaw commented May 8, 2023

@daveisfera @thedrow @auvipy (and all) - apologies if this is the wrong place to post this. In celery 4.x the "received" logs will show the task's ETA if available. Example:
INFO Received task: exampleTaskName[8b68c9be-d3c3-4352-b3bc-8749ed5a5c0c] ETA:[2022-10-11 21:09:20.919008+00:00]. However 5.x is no longer there. I'm seeing that you have to add eta: req.eta to the context dict, and also overwrite LOG_RECEIVED in my app. Is there another way? Should this be a request in the celery repo. Thanks for the help!

@auvipy
Copy link
Copy Markdown
Member

auvipy commented Jun 7, 2023

@daveisfera @thedrow @auvipy (and all) - apologies if this is the wrong place to post this. In celery 4.x the "received" logs will show the task's ETA if available. Example: INFO Received task: exampleTaskName[8b68c9be-d3c3-4352-b3bc-8749ed5a5c0c] ETA:[2022-10-11 21:09:20.919008+00:00]. However 5.x is no longer there. I'm seeing that you have to add eta: req.eta to the context dict, and also overwrite LOG_RECEIVED in my app. Is there another way? Should this be a request in the celery repo. Thanks for the help!

we got a new PR here #8301 please check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include args in Received (like Rejected)

4 participants