是的,您可以收集所谓的自定义参数、指标或使用自定义事件。
这是 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