【问题标题】:new Relic -how to pass custom Stringsnew Relic - 如何传递自定义字符串
【发布时间】:2015-07-17 17:34:47
【问题描述】:

我想在new Relic 中设置一个标签,并让它显示在新的遗物仪表板上。例如。我想在伪代码中做这样的事情:

newRelic.setString("status","Disabled");

我能做到吗?

【问题讨论】:

    标签: newrelic newrelic-platform


    【解决方案1】:

    是的,您可以收集所谓的自定义参数、指标或使用自定义事件。

    这是一个 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

    【讨论】:

    • 会不会是这样的:NewRelic.addCustomParameter("userId", userId);
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-18
    • 1970-01-01
    • 2012-04-25
    • 1970-01-01
    相关资源
    最近更新 更多