Skip to content

Sample Application

Kieron Lanning edited this page Feb 18, 2025 · 1 revision

Sample Application

The sample app shows a basic usage of an a multi-target telemetry interface for a weather-reporting service hosted in .NET Aspire Host.

There is also a basic series of Unit-tests showing who to assert against the telemetry being called with specific

Running the Dashboard and Viewing Telemetry

To use application and view it's telemetry, simply open the solution and run the .NET Aspire Sample.AppHost project. Once loaded, you can click the link in the endpoint column of the running application to load a Scalar-based UI where you can interact with the application.

Step Image
Open the project and find the Endpoint column, click the link to the running application. .NET Aspire Dashboard showing the running application
Scroll down to the endpoint you want to test, and click the Test Request button. Showing the Scalar Endpoint view
Press the Scalar Play Button (Play) button a few times to sent the request. It's a good idea to send a lot of requests to see how the telemetry appears in the dashboard. This includes randomly simulated failures. Showing the Scalar Play button to send a request to the service.

The resulting telemetry will appear in the various sections of the .NET Aspire dashboard. Here are some examples:

Dashboard view Image
Dashboard failures in the project list. Failures visible in the .NET Aspire project list
Console logs view of the running service. Console logs view
Structured logs view of the running service. Structured logs view
Traces view. Traces view
Traces view, with Activity and associated ActivityEvents and properties. Activity and ActivityEvent details
Metrics view, with the sample apps metrics highlighted. Metrics view
Metrics histogram view. Metrics histogram view
Clone this wiki locally