新遗物监视的应用程序可以明确地从内部生成事件警报吗?

发布于 2025-02-01 07:47:44 字数 303 浏览 1 评论 0原文

我正在使用New Relic(Heroku附加组件)来监视Rails应用程序。该应用中有一个地方检测到“这永远不应该发生”的情况,无法通过New Relic的监视轻易检测到,我希望能够使用新的遗物通知/警报/其他任何东西以立即发出耀斑那个代码路径。有没有一种方法可以明确触发应用程序中的警报,这样我就不必为事件警报添加另一个宝石/插件?

(这似乎类似于这个2013年的问题从来没有确切地回答,现在的评论中的链接现在是陈旧的))

I'm using New Relic (Heroku add-on) to monitor a Rails app. There is a place in the app that detects a "this should never happen" condition that's not easily detectable via New Relic's monitoring, and I'd like to be able to use New Relic notifications/alerts/whatever to immediately send up a flare in that code path. Is there a way to explicitly trigger an alert from within an app, so that I don't have to add another gem/plugin just for incident alerts?

(This seems similar to this 2013 question that was never definitively answered and whose links in comments are now stale)

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

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

发布评论

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

评论(2

不交电费瞎发啥光 2025-02-08 07:47:44

我会做这样的事情:

begin
  this_should_never_happen
rescue Exception
  if defined?(NewRelic)
    error = StandardError.new('Boom!')
    NewRelic::Agent.notice_error(error)
  end
end

I'd do something like this:

begin
  this_should_never_happen
rescue Exception
  if defined?(NewRelic)
    error = StandardError.new('Boom!')
    NewRelic::Agent.notice_error(error)
  end
end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文