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

fix: Improve logging messages #298

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

attiyaIshaque
Copy link
Member

@attiyaIshaque attiyaIshaque commented Nov 21, 2024

Description

In this PR, we have enhanced the log messages and adjusted the log levels in the commerce-coordinator. Additionally, we need to review the retry criteria for various tasks triggered by the CT commerce flow to determine if any additional errors should be included in the retry logic.

@attiyaIshaque attiyaIshaque force-pushed the attiya/SONIC-745-improve-logging branch 3 times, most recently from 0b926dc to 375eabe Compare November 21, 2024 12:17
Copy link

github-actions bot commented Nov 21, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  commerce_coordinator/apps/commercetools
  clients.py
  tasks.py 102
  utils.py
  views.py
  commerce_coordinator/apps/commercetools/sub_messages
  tasks.py
  commerce_coordinator/apps/commercetools/tests
  test_clients.py
  test_tasks.py
  commerce_coordinator/apps/core
  clients.py
  views.py
  commerce_coordinator/apps/ecommerce
  clients.py
  commerce_coordinator/apps/lms
  clients.py
  tasks.py
  commerce_coordinator/apps/titan
  clients.py
Project Total  

This report was generated by python-coverage-comment-action

@attiyaIshaque attiyaIshaque force-pushed the attiya/SONIC-745-improve-logging branch from 375eabe to cd07f5d Compare November 21, 2024 12:33
@attiyaIshaque attiyaIshaque force-pushed the attiya/SONIC-745-improve-logging branch 3 times, most recently from 96bc7d1 to 2598127 Compare November 25, 2024 13:33
Copy link
Member

@aht007 aht007 left a comment

Choose a reason for hiding this comment

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

I see in the ticket ACs that we had to add appropriate errors such as CommerceToolsError to retries where needed. Have we verified that we don't need to change anything related to this?
Note for merging: please ensure on staging that we get appropriate error badges on DataDog.

commerce_coordinator/apps/commercetools/tasks.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/core/clients.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/lms/tasks.py Outdated Show resolved Hide resolved
@attiyaIshaque attiyaIshaque force-pushed the attiya/SONIC-745-improve-logging branch from 2598127 to a35b631 Compare December 5, 2024 12:04
@aht007
Copy link
Member

aht007 commented Dec 10, 2024

Please take a look into this recommendation from @shafqatfarhan as well: https://twou.slack.com/archives/C07UZC8DDSR/p1733148401861559

@attiyaIshaque attiyaIshaque force-pushed the attiya/SONIC-745-improve-logging branch from a35b631 to 5a68365 Compare December 12, 2024 09:22
@attiyaIshaque
Copy link
Member Author

Please take a look into this recommendation from @shafqatfarhan as well: https://twou.slack.com/archives/C07UZC8DDSR/p1733148401861559

I have addressed this in this PR.

Copy link
Member

@shafqatfarhan shafqatfarhan left a comment

Choose a reason for hiding this comment

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

  • Search in all CC's codebase for debug logs and check if those need to be updated to info/error logs. If not, then remove those debug logs
  • Add a retrying count warning log in all celery tasks
  • Check if all celery tasks are run in retires with all sorts of exceptions

commerce_coordinator/apps/commercetools/tasks.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/commercetools/tasks.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/commercetools/tasks.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/commercetools/tasks.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/commercetools/tasks.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/lms/clients.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/lms/clients.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/lms/clients.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/lms/tasks.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/lms/tasks.py Outdated Show resolved Hide resolved
@attiyaIshaque attiyaIshaque force-pushed the attiya/SONIC-745-improve-logging branch 2 times, most recently from 26e5b6f to 2acf8ce Compare January 2, 2025 09:41
Copy link
Member

@aht007 aht007 left a comment

Choose a reason for hiding this comment

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

This is picking up shape. Left some comments, we should be good once those are resolved

commerce_coordinator/apps/commercetools/tasks.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/core/middleware.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/lms/clients.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/lms/clients.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/lms/clients.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/lms/views.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/titan/clients.py Outdated Show resolved Hide resolved
commerce_coordinator/apps/titan/pipeline.py Outdated Show resolved Hide resolved
@attiyaIshaque attiyaIshaque force-pushed the attiya/SONIC-745-improve-logging branch 2 times, most recently from 7f4bfb9 to 64e28fa Compare January 6, 2025 16:40
Copy link
Member

@aht007 aht007 left a comment

Choose a reason for hiding this comment

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

@shafqatfarhan remind me if I am missing something but we had identified a potential error to add to retry logic in celery task while creating this ticket. I can't exactly remember that.

@attiyaIshaque attiyaIshaque force-pushed the attiya/SONIC-745-improve-logging branch 2 times, most recently from ce98bcd to 92bbe6c Compare January 8, 2025 10:28
@attiyaIshaque attiyaIshaque force-pushed the attiya/SONIC-745-improve-logging branch from 92bbe6c to 4e9e1db Compare January 8, 2025 10:47
Copy link
Member

@aht007 aht007 left a comment

Choose a reason for hiding this comment

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

Please test thoroughly on staging server.

@attiyaIshaque attiyaIshaque force-pushed the attiya/SONIC-745-improve-logging branch from 4e9e1db to b51d5ee Compare January 8, 2025 12:28
@attiyaIshaque attiyaIshaque merged commit 225355c into main Jan 8, 2025
8 checks passed
@attiyaIshaque attiyaIshaque deleted the attiya/SONIC-745-improve-logging branch January 8, 2025 12:46
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.

4 participants