When you install new instances of the New Relic APM agents for C, Go, Java, Node.js, .NET, PHP, Python, or Ruby, standard distributed tracing is turned on by default.
This default distributed tracing for APM agents uses head-based sampling. This means that before any traces arrive at New Relic, we apply an algorithm to determine how many traces to accept and analyze. This default head-based sampling can give you basic insights into what's happening in your distributed systems.
We also offer Infinite Tracing, which we recommend because it can give you even greater visibility into your distributed systems. This option uses tail-based sampling, which means that we don't do any sampling until after we've gathered and analyzed 100 percent of your traces. Your traces are sent to a cloud-based trace observer which collects and analyzes your data, looking for helpful traces.
Whether you want to get distributed tracing by installing a new agent or need help turning on distributed tracing in an older agent, we have instructions to get you going:
- Set up tracing for new agents: Steps for head- and tail-based sampling
- Older APM agents: Tracing options if you have older APM agents
- Manual instrumentation: Tips if automatic instrumentation doesn't work
If you want to get more background before getting started, check out these topics:
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 distributed tracing. We'll get you through the APM agent installation to get head-based sampling going. Then, if you want to try out Infinite Tracing, you can take some additional steps.
This is the best approach to set up standard distributed tracing if you haven't installed any APM agents for your services yet, or if you want to instrument additional services.
You'll need a New Relic account to set up distributed tracing. If you don't already have one, you can quickly
create a free account.
Figure out which services you want to instrument so they each send trace data to New Relic. For each of the services you identify, you'll install the APM agent, following the tips in the next step.
You will install a new APM agent to get the default distributed tracing. We have installation assistants for a variety of languages to help you instrument each service.
You should run the installation assistant for each service you want to instrument to ensure that each installation has a unique application name.
To start the assistant, click the link for your language:
This quick-start approach with the installation assistant automatically enables distributed tracing for each service you run it on, but if you already have a APM agent that you want to participate in distributed tracing, you'll need to manually enable distributed tracing. See Options for older APM agents.
After you instrument each of your services with APM agents, generate some traffic in your application so we can capture some traces. Here are two ways to view your traces in the UI:
For more help finding your traces in the UI:
Standard distributed tracing for APM agents (above) uses adaptive sampling to capture up to 10 traces per minute, but if you want us to analyze all your data and find the most relevant traces, you can set up Infinite Tracing. This alternative to standard distributed tracing is available for all APM language agents except C SDK.
To learn more about this feature, see Infinite Tracing.
Before beginning, first ensure you meet the requirements.
The Infinite Tracing setup builds on the instrumentation steps above for standard distributed tracing. Make sure you've completed these before you got to the next step about 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.
Infinite Tracing configuration settings include the standard distributed tracing plus information about the trace observer. Find the settings for your language agent below:
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:
- Configure trace observer monitoring
- Configure span attribute trace filter
- Configure random trace filter
If you have older APM agents, use this section to figure out if the distributed tracing features you want are supported.
Following the compatibility information is a section showing the basic configuration settings to turn on standard distributed tracing. If your older agent supports Infinite Tracing and you want to set it up, see the steps above.
Find your language agents below to confirm if you can use your existing agents with distributed tracing:
Distributed tracing is enabled through configuration settings. Review the following agent-specific sections. For general help with agent configurations, see Configure the agent.
Server-side configuration is not available for Infinite Tracing.
If you need help with proxy configuration, see Proxy support.
Recommendation: Before performing any custom instrumentation, read:
If a service is not passing the trace header to other services, you can use the distributed tracing payload APIs to instrument the calling service and the called service. The calling service uses an API call to generate a payload, which is accepted by the called service.