配置 Django Sentry 的服务器名称

发布于 2024-12-22 23:57:57 字数 261 浏览 4 评论 0原文

我刚刚开始使用 Sentry,它很可爱。我有大约 10 个不同的网站,其中一些位于同一服务器上,其名称类似于 web12.example.com。这些服务器名称会传递到 Sentry 的接口,因此我可以根据错误来自哪个服务器进行过滤。按服务器过滤并不是特别有用 - 有用的是按站点过滤。

有没有办法将服务器名称更改为不是实际的服务器名称,而是(例如)错误来自的域名?

I've just got started with Sentry, which is lovely. I've got about 10 different sites, some of which live on the same servers, which have names like web12.example.com. These server names get passed through to Sentry's interface, so I can filter by which server the errors have come from. Filtering by server isn't particularly useful - what would be useful is filtering by site.

Is there a way to change the server name to not be the actual server name, but (for example) the domain name that the error came from?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

热情消退 2024-12-29 23:57:57

Sentry 已经通过(显然未记录的)SENTRY_SITE 设置实现了我想要的功能。我只是在我的 settings.py 文件中设置了以下内容:

SENTRY_SITE = u'My Site Name'

并且我可以从 Sentry 界面右侧的过滤器列表中对其进行过滤。

服务器名称不是用于此目的(大概对于具有大型设置的人来说,查看是否有大量错误来自特定服务器很有用,这可能表明配置问题),这就是站点过滤器的用途。

Sentry already does what I wanted, with the (apparently undocumented) SENTRY_SITE settings. I just set the following in my settings.py file:

SENTRY_SITE = u'My Site Name'

and I can filter on it from the filters list on the right-hand side of the Sentry interface.

Server name isn't intended for this purpose (presumably for people with large setups, it's useful to see if lots of errors are coming from a particularly server, which may be indicative of configuration issues), this is what the site filter is for.

城歌 2024-12-29 23:57:57

现在他们有一个 选项 来设置这一点:

sentry_sdk.init(
    <endpoint>,
    server_name='a_name_to_distinguish_instance',
    ...
)

在 Web UI 中,可以使用 server_name 标签来过滤以此方式配置的实例的问题。

Now they have an option to set this:

sentry_sdk.init(
    <endpoint>,
    server_name='a_name_to_distinguish_instance',
    ...
)

In web UI, one may use server_name tag to filter issues for an instance configured this way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文