You can instrument page load timing (sometimes referred to as real user monitoring or RUM) either automatically or manually with your .NET agent. To enable page load timing in the user interface, see Browser settings. Then follow the procedures in this section to set up page load timing.
To use page load timing with your .NET agent, make sure you have the latest release (version 2.0.0 or higher). For more information, see the .NET agent installation instructions.
text/html and also has
<head> tag within the page. The
The first time you enable auto-instrumentation, you may need to clean your asp.net cache directory so that aspx pages are recompiled. Use the following command:
With this injection, previously functioning pages may stop working if a
content-type is not set correctly. To correct, review and update the content-types in your app or disable auto-instrumentation.
There is a known issue in version 220.127.116.11 of the .NET agent which prevents auto-injection in certain specific cases. This issue only affects WebForms websites running in integrated pipeline mode, and only occurs when navigating to the website's root URL.
Manual instrumentation via agent API
If you cannot enable auto-instrumentation, you can still set up page load timing manually by using the New Relic .NET agent API and including appropriate code in your pages.
To download the NewRelic.Api.agent.dll, re-run the installation and reference the .dll:
- From the New Relic .NET agent directory, select the New Relic.Net agent section, then select API Assembly.
- NuGet: Install and reference the .dll by running
- To set up your web application to call the New Relic .NET agent API, add a reference to NewRelic.Api.Agent.dll to your project.
- Optional: If you are modifying the deployed application directory on the web server, copy NewRelic.Api.Agent.dll into the application's bin directory.
- Call the API in your
<head>tag. If a meta-tag with the
X-UA-COMPATIBLE http-equivattribute exists, set it after that meta tag.
- .NET Web Forms view engine
When using .NET Web Forms view engine, be sure to use
If you are using .NET ASP Web Forms with master pages, add the header manually by calling
GetBrowserTimingHeader()in your master page under the
<%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader() %>
- Other view engines such as Razor
<!DOCTYPE html> <html lang="en"> <head> @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()) ... </head> </html>
- .NET MVC
When using .NET MVC, call the
To disable instrumentation:
- Disable auto-instrumentation
To fully disable auto-instrumentation, edit newrelic.config and set the
autoInstrumentflag to false:
<!-- disable auto instrumentation --> <browserMonitoring autoInstrument="false"/>
If you change the flag or uninstall the .NET agent, be sure to flush your cache again so that references to the agent are removed from compiled files.
- Disable auto-instrumentation on a particular view
To disable auto-instrumentation only on a particular view, use the agent API call
DisableBrowserMonitoring(). Add this call in any view where scripts for page load timing are not needed or wanted. Put this API call as close as possible to the top of the view where you want it disabled.
- Disable instrumentation manually
To disable instrumentation manually for page load timing in individual webpages, use the
DisableBrowserMonitoring(System.Boolean)API call for the .NET agent API.
Page load timing footer
Make sure you have upgraded to the latest release of New Relic's .NET agent before setting up page load timing (sometimes referred to as real user monitoring or RUM).
If you are unable to view any page load timing data, see No page load timing data appears.
For more help
Additional documentation resources include:
- Instrumentation for page load timing and Page load timing process (overview of New Relic's page load timing feature)
- Troubleshooting page view monitoring (procedures for troubleshooting your setup for page load timing)
- New Relic for .NET (overview of compatibility and requirements, license key, installation)
- Apdex: Measuring user satisfaction (detailed information about how Apdex measures users' satisfaction with your app)