new Relic - 如何传递自定义字符串
new Relic -how to pass custom Strings
我想在 new Relic 中设置一个标签,并让它显示在新的遗迹仪表板上。例如。我想在伪代码中做这样的事情:
newRelic.setString("status","Disabled");
我能做到吗?
是的,您可以收集所谓的自定义参数、指标或使用自定义事件。
这是 ruby 代码的示例,但以下内容也适用于 Java 库。
class Cart
def checkout()
amount = compute_cart_total # computes the amount to charge the customer
::NewRelic::Agent.record_metric('Custom/Cart/charge_amount', amount)
charge_customer(amount)
...
end
end
https://docs.newrelic.com/docs/apm/other-features/metrics/custom-metrics
https://docs.newrelic.com/docs/apm/other-features/attributes/collecting-custom-attributes
我想在 new Relic 中设置一个标签,并让它显示在新的遗迹仪表板上。例如。我想在伪代码中做这样的事情:
newRelic.setString("status","Disabled");
我能做到吗?
是的,您可以收集所谓的自定义参数、指标或使用自定义事件。
这是 ruby 代码的示例,但以下内容也适用于 Java 库。
class Cart
def checkout()
amount = compute_cart_total # computes the amount to charge the customer
::NewRelic::Agent.record_metric('Custom/Cart/charge_amount', amount)
charge_customer(amount)
...
end
end
https://docs.newrelic.com/docs/apm/other-features/metrics/custom-metrics
https://docs.newrelic.com/docs/apm/other-features/attributes/collecting-custom-attributes