【发布时间】:2020-08-17 11:12:09
【问题描述】:
我正在尝试从我的 Django 应用程序中的 Celery 任务中获取跟踪。我正在使用 AWS 的 X-Ray。我正在获取正常 HTTP 调用、SQL 数据库查询的跟踪,但不是 Celery 任务或 Redis。已实施任务中的日志语句在 X-Ray 中可用。
在我的AppConfig 实现中,我已经完成了通常的操作:
from aws_xray_sdk.core import patch_all
patch_all()
from aws_xray_sdk.core import xray_recorder
# Need a default segment to avoid issues when running migrations and other management commands
xray_recorder.begin_segment("migrations")
我应该如何从 Celery 任务和 Redis 中获取跟踪信息?
【问题讨论】:
标签: python amazon-web-services celery django-celery aws-xray