配置 Django Sentry 的服务器名称
我刚刚开始使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Sentry 已经通过(显然未记录的)
SENTRY_SITE
设置实现了我想要的功能。我只是在我的settings.py
文件中设置了以下内容:并且我可以从 Sentry 界面右侧的过滤器列表中对其进行过滤。
服务器名称不是用于此目的(大概对于具有大型设置的人来说,查看是否有大量错误来自特定服务器很有用,这可能表明配置问题),这就是站点过滤器的用途。
Sentry already does what I wanted, with the (apparently undocumented)
SENTRY_SITE
settings. I just set the following in mysettings.py
file: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.
现在他们有一个 选项 来设置这一点:
在 Web UI 中,可以使用
server_name
标签来过滤以此方式配置的实例的问题。Now they have an option to set this:
In web UI, one may use
server_name
tag to filter issues for an instance configured this way.