简体   繁体   中英

Rails is not sending custom metrics to NewRelic

I'm trying to send custom metrics to NewRelic insights, but unfortunately it is not working for my Rails app that is currently sending default data to New Relic.

Steps to reproduce

I just logged in the console of the working application and ran the following command:

NewRelic::Agent.record_metric('/Custom/MyCategory/MyMetric', 5)

Unfortunately it never appeared in the Insights Data Explorer.

The configuration in the application is the following:

common: &default_settings
  license_key: <MY_KEY>
  app_name: my_app
  log_level: info

development:
  <<: *default_settings
  app_name: executive_alerts (development)
  monitor_mode: false

test:
  <<: *default_settings
  app_name: executive_alerts (test)
  monitor_mode: false

staging:
  <<: *default_settings
  app_name: executive_alerts (staging)

production:
  <<: *default_settings

Thank you!

From the documentation for the New Relic agent:

Change your command from:

NewRelic::Agent.record_metric('/Custom/MyCategory/MyMetric', 5)

to:

NewRelic::Agent.record_metric('Custom/MyCategory/MyMetric', 5)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM