This folder contains a pair of sample applications to demonstrate how to use the .NET Agent's distributed tracing APIs to link two instrumented services that communicate across a channel not automatically instrumented by the agent.
The agent is added to each application via the NewRelic.Agent
NuGet package.
The channel used for demonstration purposes is Azure Service Bus.
The custom distributed tracing APIs need access to a "carrier" for the tracing data being added to outgoing messages and recieved from incoming messages. For Azure Service Bus messages, the ApplicationProperties
key/value store is used. Refer to the example code for details.
In order to use this example, you will need the following:
- A New Relic APM license key
- An Azure Service Bus instance with at least one queue configured.
- The connection string for your Azure Service Bus instance
- The name of the queue you want to use.
Steps for testing:
- Create a
docker.env
file to set your specific values for your New Relic license key, sending and receiving application names, and Azure Service Bus connection string and queue name. docker-compose --env=docker.env build
docker-compose --env-docker.env up
The Sender and Receiver applications will each run for five minutes. You should see these applications linked in the Distributed Tracing UI in New Relic APM after a few minutes.