用AWS X射线追踪Django的芹菜任务

2024-04-28 10:44:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图从Django应用程序中的芹菜任务中获取跟踪。我用的是AWS的X光片。我得到了正常HTTP调用、SQL数据库查询的跟踪,但没有芹菜任务或Redis的跟踪。已实现任务中的日志语句在X射线中可用。 在我的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")

我应该怎样做才能从芹菜任务和Redis中找到踪迹


Tags: djangofromcoreimportredisaws应用程序migrations