9

我正在使用 Rails 5 来提供网站和 RESTful API,并使用 Newrelic ( newrelic_rpmgem) 来监控应用程序性能。

目前,gem 监控对一个应用程序名称的所有请求。

假设我的路线看起来像:

Rails.application.routes.draw do
  resources :users
  namespace :api do
    namespace :v1 do
      resources :users, only: :index
    end
  end
end

/users是 Web 应用程序api/users的路由,也是 API 的路由。现在,一旦我使用newrelic_rpm它,就不会看到 API 和 Web 之间的不同。

我想对报告进行更多分离,以便我可以将 Web 请求记录到特定的应用程序名称,例如:web_app以及 API 的另一个名称api_app

有什么帮助吗?

4

1 回答 1

5

You cannot do what you have outlined here with the current version of the New Relic agent. That's not how the agent works; that's not how New Relic works.

You have a single application whose performance should be considered as a whole. If you were able to route the performance data to different apps, how could you see that a problem in one app is affecting the other app? How can you correlate events and metrics when they are in separate apps?

More specifically, someone could attack app A and negatively impact app B, and that might appear in the performance data for app A, app B, or both. That's why this isn't supported: you don't put up artificial walls in the performance data for a single app running on a single server.

Use the agent the way it was intended, and use the New Relic transactions page in APM and the Web transactions analysis report to filter down to the transactions you care about. You can also use the Insights event explorer to filter and chart your Transaction data.

于 2017-05-03T23:31:24.757 回答