Using metrics data
Metrics data is used to monitor counts such as CPU and memory consumption or the length of an HTTP queue. This information can be used to analyze resources needed by services and can scale the services accordingly.
With metrics data, we get some counts. Such counts can be used for scaling services, based on memory or CPU consumption, or the length of an HTTP queue.
Let’s check the built-in metrics data before we add custom metrics.
Monitoring built-in .NET metrics
As mentioned, .NET offers much built-in metrics data that can be monitored using the dotnet counters
.NET tool (install it via dotnet tool install dotnet-counters -g
as a global tool), and many counts are already available from the .NET Aspire dashboard by opening the Metrics view. Figure 11.5 shows the .NET-managed heap size of the games API service at a time the bot played several games in parallel:
Figure 11.5 – Metrics
With many applications, you...