liveBook · Manning

Monitoring

As explained in Building Distributed Applications that Work

Monitoring is the continuous collection and analysis of application and infrastructure signals to detect problems and assess operational behavior.

Monitoring collects and examines signals from a running application so problems can be found before they have a larger effect on users. For an online shop, uptime, response times, and error rates help reveal reliability problems; CPU and memory measurements help identify bottlenecks, plan capacity, and control infrastructure costs. Access logs, audit trails, and security events can also expose suspicious activity. section 6.0

Aspire uses OpenTelemetry to collect logs, metrics, and traces. Its vendor-agnostic tooling can process and export telemetry from distributed applications. In a standard Aspire Starter Project, the Service Defaults project already includes the monitoring dependencies; for an online shop, that project can be named OnlineShop.ServiceDefaults. section 6.2

The Service Defaults packages divide the work:

  • OpenTelemetry.Exporter.OpenTelemetryProtocol supplies the OTLP exporter for communication with collectors and observability backends. section 6.2
  • OpenTelemetry.Extensions.Hosting starts and stops tracing; the ASP.NET Core and HTTP instrumentation packages integrate middleware and collect HTTP telemetry. section 6.2
  • OpenTelemetry.Instrumentation.Runtime collects .NET runtime metrics, including garbage collection, memory use, and thread-pool measurements. section 6.2

After launching the application, use the Aspire dashboard to inspect services in one place. Console shows an individual service’s console logs; Structured shows structured logs across services; Traces and Metrics expose their respective telemetry. These views help investigate what happened, but they do not by themselves establish whether a service is working correctly right now. Health checks address that separate need. section 6.4 section 6.0

How Building Distributed Applications that Work covers it

How deep it goes
Names the included OpenTelemetry packages and dashboard views, but defers the mechanism for checking whether applications work correctly now.
Examples
Shows an online-shop Service Defaults project and Aspire dashboard tabs for console logs, structured logs, traces, and metrics.
What it assumes
Assumes an Aspire Starter Project with standard Service Defaults dependencies and introduces OpenTelemetry’s monitoring role.
What you can do after
Operates the Aspire dashboard to inspect telemetry across services and distinguish historical signals from current health checks.
How it connects
Connects monitoring to OpenTelemetry, logs, metrics, traces, health checks, and capacity planning.

Also explained in

Compare how 40 books explain monitoring →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Distributed Applications that Work. The section links point to the parts of the book it draws on.