我正在使用newrelic的ruby sdk来开发自定义插件。当我运行示例应用程序时,在终端上显示数据已成功捕获。但是当我访问该网站时,它无法搜索指标,因此我无法查看报告的任何数据。
插件名称和everthing else显示但不在数据的位置。
这是代理文件的样子:
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
答案 0 :(得分:0)
请勿将Component
部分放在指标名称中。 SDK会自动为您添加。