• EnglishEspañol日本語한국어Português
  • ログイン今すぐ開始

Custom instrumentation

New Relic collects and reports information on web transactions and non-web transactions, such as background tasks. New Relic normally produces complete information automatically, without any need to modify your application code. However, if you are not using a supported framework, you may need to add custom instrumentation.

Custom instrumentation is also useful to:

  • Add detail to your transaction traces.
  • Block instrumentation on selected transactions you do not want instrumented.
  • Instrument a part of your code that New Relic simply is not picking up.

Custom instrumentation that creates a new transaction collects both metric timeslice and event data. Custom instrumentation for already instrumented transactions collects only metric timeslice data.

重要

Do not use brackets [suffix] at the end of your transaction name. New Relic automatically strips brackets from the name. Instead, use parentheses (suffix) or other symbols if needed.

When to use custom instrumentation

Custom instrumentation allows you to track interactions that are not captured by New Relic's automatic instrumentation. Custom instrumentation can also add detail to your transaction traces, to help you identify key issues.

New Relic collects data from many frameworks automatically. If you are using a supported framework, you should not need custom instrumentation to collect metric timeslices, events, and traces.

However, if you encounter any of these situations, you may need custom instrumentation:

  • Transactions do not appear in the UI.
  • Transaction traces include large blocks of application code time without full detail.

If you are using a supported framework, but are not seeing transaction on the APM Transactions page, get support at support.newrelic.com to ensure the framework instrumentation is working.

Implement custom instrumentation

Each agent implements custom instrumentation differently:

Grouping issues

A metric grouping issue occurs when an account sends too many differently-named metric timeslices to New Relic, and those individual web transactions are not properly aggregated. For example, rather than a single /user/controlpanel/ metric name, you might see /user/controlpanel/alice, /user/controlpanel/bob, and /user/controlpanel/carol.

Custom instrumentation can cause metric grouping issues if you introduce too many uniquely-named metric timeslices that New Relic cannot effectively group. If you send thousands of metrics, New Relic may apply rules to reduce the number of transactions.

Copyright © 2024 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.