0

我正在使用 newrelic 的 ruby​​ sdk 开发自定义插件。当我运行示例应用程序时,在终端上显示数据已成功捕获。但是当我访问该站点时,它无法搜索指标,因此我无法查看任何报告的数据。

插件名称和其他所有内容都会显示,但不会显示数据的去向。

这是代理文件的样子:

require "rubygems"
require "bundler/setup"

require "newrelic_plugin"

module ExampleAgent

  class Agent < NewRelic::Plugin::Agent::Base

    agent_guid "com.phytel.Product1"
    agent_version "1.0.1"
    agent_config_options :hostname  # frequency of the periodic functions
    agent_human_labels("Product1") { "Call Statuses" }

    def poll_cycle
      # x = Time.now.to_f * hertz * Math::PI * 2
      report_metric "Component/Status/Progressing",     "Value", 10
      report_metric "Component/Status/Scheduled",     "Value", 20
      report_metric "Component/Status/Busy",     "Value", 2
    end

  end

  #
  # Register this agent with the component.
  # The ExampleAgent is the name of the module that defines this
  # driver (the module must contain at least three classes - a
  # PollCycle, a Metric and an Agent class, as defined above).
  #
  NewRelic::Plugin::Setup.install_agent :example, ExampleAgent

  #
  # Launch the agent; this never returns.
  #
  NewRelic::Plugin::Run.setup_and_run

end

4

1 回答 1

0

不要将该Component部分放在您的指标名称中。SDK 会自动为您添加。

于 2014-12-23T04:30:32.700 回答