chapter six

6 Integration testing and monitoring

 

This chapter covers

  • Understanding application telemetry and how Aspire processes logs, metrics, and traces
  • Seeing how Aspire manages health checks
  • Setting up and running integration tests in Aspire
  • Using different testing frameworks for integration tests
  • Testing the user interfaces of applications hosted by Aspire

In this chapter, we make our application resilient by testing it before deployment to production and monitoring it while it’s running in production. We'll start with monitoring because the relevant dependencies are already included in the standard Aspire Starter Project template on which our application is based.

Monitoring applications is crucial for several reasons. It allows us to detect problems such as errors, failures, performance bottlenecks, and security breaches early, and early detection enables proactive responses, minimizing effects on users and the business.

Monitoring also helps ensure that our applications are reliable and available. By tracking uptime, response times, and error rates, we can identify areas for improvement and take steps to improve reliability and availability.

Monitoring can also help us use hardware resources efficiently by providing insights into the performance of our applications and infrastructure. By analyzing metrics such as CPU use, memory use, and response times, we can identify performance bottlenecks, optimize resource allocation, and improve overall system performanc

6.1 Components of monitoring systems

6.1.1 Logging

6.1.2 Metrics

6.1.3 Traces

6.2 Monitoring Aspire applications

6.3 Configuring the telemetry

6.4 Viewing information in the dashboard

6.5 Health checks in Aspire

6.5.1 Service statuses in Aspire's dashboard

6.5.2 How health checks are configured inside Aspire apps

6.5.3 Mapping health-check endpoints

6.5.4 Monitoring app health in production

6.6 Setting up integration tests in Aspire

6.6.1 Adding a test project

6.6.2 Installing required dependencies for testing

6.6.3 Adding Aspire integration tests

6.6.4 Using different testing frameworks

6.6.5 Expanding test functionality

6.6.6 What about component testing?

6.7 Summary