• /
  • EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

Distributed tracing for the .NET agent

Distributed tracing allows you to see the entire journey of your requests throughout a distributed system. For the .NET agent, we offer two types of distributed tracing (for more details, see How span sampling works):

  • Standard (head-based sampling): Before any traces arrive, we determine a set percentage of traces to accept and analyze. This gives you a solid starting point to see how tracing can help you. It is turned on by default in .NET agents 9.0.0.0 and higher.

  • Infinite Tracing (tail-based sampling): Our cloud-based service accepts all your traces and then sorts through them to find the most important. Infinite tracing analyzes all of your traces and gives you configuration options to sample the traces that matter most to you.

Whether you just want to try out standard distributed tracing (head-based sampling) or also want to set up Infinite Tracing (tail-based sampling), you need to start by setting up standard tracing.

Standard distributed tracing

This is the best approach to set up standard distributed tracing if you haven't installed any APM agents for your services yet.

When you install the New Relic .NET agent, standard distributed tracing is turned on by default. If you prefer to turn it off, see our configuration guide.

Identify services

Figure out which services touch your request so you can instrument each of them to send trace data to New Relic.

Instrument each service with an APM agent

For each service involved in your transactions, you'll perform separate installations of the agent. If some of your services use other languages, simply repeat the installation steps for those languages.

To start the installation routine, click the tile below. When you're finished installing each agent, return here to see tips for viewing your traces.

.NET
Start installation

View traces

After you instrument each of your services with APM agents, generate some traffic in your application so we can capture some traces. Here are some ways to view your traces in the UI:

For more help finding your traces in the UI:

Infinite Tracing

Standard distributed tracing for APM agents captures up to 10% of your traces, but if you want us to analyze all your data and find the most relevant traces, you can set up Infinite Tracing.

Before you start, first ensure you meet the requirements.

Complete the setup for standard distributed tracing

The Infinite Tracing setup builds on standard distributed tracing. So, make sure you've completed the steps above, and then continue with the trace observer setup.

Set up the trace observer

The trace observer is a New Relic AWS-based service that collects and analyzes all your traces. Follow the instructions in Set up trace observer. When you're done, return here with your trace observer information and continue with the next step to configure the agent.

Configure the agent for Infinite Tracing

Infinite Tracing configuration settings include the standard distributed tracing plus information about the trace observer. Note that server-side configuration is not available for Infinite Tracing.

If you need help with proxy configuration, see Proxy support.

(Optional) Customize Infinite Tracing

After you add the agent configuration settings, you should start seeing data in the New Relic UI. After you spend some time analyzing your data, you may want to adjust some of the features of Infinite Tracing:

Manual instrumentation (if automatic instrumentation doesn't work)

Recommendation: Before performing any custom instrumentation, read:

The .NET agent automatically sends tracing data across IPC channels (message queues, for example) when it auto-instruments a client for that channel (RabbitMQ.Client, for example). If your services communicate using an IPC mechanism that the agent doesn't automatically instrument, you need to use the agent's distributed tracing APIs to propagate the tracing data between services.

중요

In order for the manual tracing APIs to work, the communications channel you are using must support some kind of key-value pair storage (a "carrier") associated with the transmitted messages. This is sometimes called "headers" or a "property bag", but it will depend on whatever messaging library you are working with.

Here is an example that you can build and run to show how this works.

Copyright © 2024 New Relic Inc.

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