FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(celery.py): add support for celery by ranrib · Pull Request #207 · epsagon/epsagon-python · GitHub

This repository was archived by the owner on Jun 13, 2023. It is now read-only.
/ epsagon-python Public archive

feat(celery.py): add support for celery - #207

Merged
ranrib merged 9 commits into
masterfrom
support-celery
Mar 1, 2020
Merged

feat(celery.py): add support for celery#207
ranrib merged 9 commits into
masterfrom
support-celery

Conversation

ranrib commented Feb 28, 2020

Copy link
Copy Markdown
Contributor

No description provided.

ranrib self-assigned this Feb 28, 2020
Comment thread epsagon/events/celery.py Outdated
Comment thread epsagon/events/celery.py Outdated
from ..utils import add_data_if_needed
from ..runners.celery import CeleryRunner

# Stores all events

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There is a risk of a memory leak here. We should add tests to make sure that it's getting empty whenever any Celery API is used.

Comment thread epsagon/events/celery.py Outdated
Comment thread epsagon/events/celery.py Outdated
Comment thread epsagon/events/celery.py
# Check if this is a known driver to update the resource details
driver_map = self.DRIVER_MAPPING.get(app_conn.transport.driver_type)
if driver_map:
self.resource['name'] = app_conn.hostname

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Sure there isn't a more specific field to use? (Like a 'topic')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There also "virtual host" I'm not quite sure whether to add it or not, but it is in the metadata if we would like to use it in future.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

OK

Comment thread epsagon/events/celery.py Outdated
"""
if 'task_id' in kwargs:
event_id = kwargs.get('task_id', '')
sender = kwargs.get('sender').name

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This can break, and this code is run outside try-except block

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

👍

Comment thread epsagon/events/celery.py
Comment thread epsagon/events/celery.py
Comment thread epsagon/events/celery.py Outdated
Comment thread epsagon/runners/celery.py
ranrib requested a review from ronyis March 1, 2020 08:58

ronyis left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

See one comment

Comment thread epsagon/events/celery.py
# Check if this is a known driver to update the resource details
driver_map = self.DRIVER_MAPPING.get(app_conn.transport.driver_type)
if driver_map:
self.resource['name'] = app_conn.hostname

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

OK

Comment thread epsagon/events/celery.py
# Comes from pre and post run, and failure signals
event_id = kwargs.get('task_id', '')
sender = kwargs.get('sender').name
sender = kwargs.get('sender').name if kwargs.get('sender') else ''

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Well, actually it may still not have a name attribute but up to you if we want to get that strict

ranrib merged commit 3524ff1 into master Mar 1, 2020
ranrib deleted the support-celery branch March 1, 2020 11:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL