gpt4 book ai didi

python - 如何使用 sentry-sdk 在 html 模板中获取 Sentry 引用 ID?

转载 作者:行者123 更新时间:2023-12-05 08:03:50 24 4
gpt4 key购买 nike

raven已弃用我需要一种替代方法来在我的 html 模板中显示 Sentry 引用 ID。

以前的版本从 example 看起来像这样:

<p>You've encountered an error, oh noes!</p>
{% if request.sentry.id %}
<p>
If you need assistance, you may reference this error as
<strong>{{ request.sentry.id }}</strong>.
</p>
{% endif %}

我现在该怎么做?我尝试使用 sentry_sdk.capture_exception()sentry_sdk.last_event_id()方法。第一个在我的模板中返回 None,第二个看起来是我正在寻找的。

最佳答案

Sentry 有一个新的用户反馈功能。

这是文档:https://docs.sentry.io/platforms/python/guides/django/enriching-events/user-feedback/

关于python - 如何使用 sentry-sdk 在 html 模板中获取 Sentry 引用 ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71236229/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com