In this example, distributed traces are produced automatically using the SignalFx Tracing Library for .NET. Look at the HttpClient and ASP.NET Core application source code. Add the configuration of a CLR Profiler and the automatic instrumentation to the respective Dockerfile to automatically instrument a simple inventory system.
This multi-container application assumes you have Docker Compose installed and on your system. To build and run the example services, clone this repository, move to this folder and from there do the following:
docker build ../../../shared/applications/dotnet/aspnetcore-and-mongodb/src/AspNetCoreExample/ -t aspnetcore-and-mongodb-server-app
docker build ../../../shared/applications/dotnet/aspnetcore-and-mongodb/src/ClientExample/ -t aspnetcore-and-mongodb-client-app
docker-compose build
SPLUNK_ACCESS_TOKEN=<access_token> SPLUNK_REALM=<realm> docker-compose up
The value for SPLUNK_ACCESS_TOKEN
can be found
here.
Reference: docs.
The value for SPLUNK_REALM
can be found
here.
Reference: docs.
These commands will build the .NET projects and provide and coordinate their environments to create instrumented request activity to be reported to Splunk Observability. The traced activity is initiated by the ExampleClient running through a perpetual cycle of CRUD operations, which take place via the AspNetCoreExample ASP.NET Core application and its associated MongoDB driver.
You can find the collected traces in Splunk Observability Cloud: https://app.signalfx.com/#/apm?environments=YOURUSERNAME
Note: Processing might take some time.