diff --git a/docs/core/diagnostics/diagnostic-exception-summary.md b/docs/core/diagnostics/diagnostic-exception-summary.md new file mode 100644 index 0000000000000..accabc802e9a3 --- /dev/null +++ b/docs/core/diagnostics/diagnostic-exception-summary.md @@ -0,0 +1,54 @@ +--- +title: Exception summarization in C# +description: Learn the value proposition of exception summarization within diagnostic metrics for .NET app development. +ms.date: 10/30/2023 +--- + +# Exception summarization + +When you're trying to generate meaningful diagnostic messages for exceptions, maintaining the inclusion of pertinent information can pose a challenge. The standard exception message often lacks critical details that accompany the exception, while invoking the method yields an excess of state information. + +This article relies on the [Microsoft.Extensions.Diagnostics.ExceptionSummarization](https://www.nuget.org/packages/Microsoft.Extensions.Diagnostics.ExceptionSummarization) NuGet package. + +## The goal of exception summarization + +Metric tags typically support a limited number of distinct values, and as such they are not suitable to represent values which are highly variable, such as the result of `Exception.ToString`. An exception summary represents a low-cardinality version of an exception's information, suitable for such cases. + +The goal of exception summarization is twofold: + +- To reduce the cardinality associated with exception state such that exceptions can be reliably counted in metrics. This matters since metric dimensions have limited cardinality. +- To eliminate privacy-sensitive information from exception state such that some meaningful exception information can be added to logs. + +## Exception summarization API + +The interface offers methods for extracting crucial details from recognized exception types, thereby furnishing a singular `string` that serves as the foundation for crafting top-quality diagnostic messages. + +The method systematically traverses the roster of registered summarizers until it identifies a summarizer capable of handling the specific exception type. In the event that no summarizer is capable of recognizing the exception type, a meaningful default exception summary is provided instead. + +The result of the `Summarize` method returns an struct, and it contains the following properties: + +- : The summary description of the exception. +- : Intended for low-level diagnostic use, this property contains additional details about the exception and has a relatively high cardinality. This property may contain privacy-sensitive information. +- : The type of the exception, unless inner exceptions are present, in which case both outer and inner types are reflected. + +## Example exception summarization usage + +The following example demonstrates how to use the `IExceptionSummarizer` interface to retrieve a summary of an exception. + +:::code source="snippets/exception-summary/Program.cs"::: + +The preceding code: + +- Instantiates a new instance, chaining a call to the extension method. + - The `AddExceptionSummarizer` extension method accepts a delegate that is used to configure the `ExceptionSummarizerBuilder` instance. + - The `builder` is used to add the HTTP provider, which handles exceptions of type: + - + - + - + - +- Builds a new `ServiceProvider` instance from the `ServiceCollection` instance. +- Gets an instance of the `IExceptionSummarizer` interface from the `ServiceProvider` instance. +- Iterates over a collection of exceptions, calling the `Summarize` method on each exception and displaying the result. + +> [!NOTE] +> The primary focus in the design of all exception summarization implementations is to provide diagnostic convenience, rather than prioritizing the protection of personally identifiable information (PII). The doesn't contain sensitive information, but the might contain sensitive information depending on the implementation. diff --git a/docs/core/diagnostics/diagnostic-health-checks.md b/docs/core/diagnostics/diagnostic-health-checks.md new file mode 100644 index 0000000000000..c0ff5911608da --- /dev/null +++ b/docs/core/diagnostics/diagnostic-health-checks.md @@ -0,0 +1,82 @@ +--- +title: App health checks in C# +description: Learn how to use resource utilization and application lifetime health checks in .NET app development. +ms.date: 10/30/2023 +--- + +# .NET app health checks in C\# + +In a distributed system, health checks are periodic assessments of the status, availability, and performance of individual nodes or services. These checks ensure that the system functions correctly and efficiently. Health checks are essential for system reliability, and they are typically performed at regular intervals with the results analyzed for decision-making and corrective actions. + +The following heath check status results are possible: + +- +- +- + +## Resource utilization health checks + +To perform health checks on the resource utilization of your .NET apps, add a package reference to [Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization](https://www.nuget.org/packages/Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization). On an instance, chain a call from to . The following example demonstrates how to use the `AddResourceUtilizationHealthCheck` extension method to add a resource utilization health check to an `IServiceCollection` instance: + +:::code source="snippets/health-checks/Program.cs"::: + +The preceding code: + +- Creates a new instance. +- Adds resource monitoring by calling . +- Adds a health check for resource utilization by chaining a call from the call to the extension method. +- Builds the instance as the `app` variable. +- Gets an instance of the class from the service provider. +- Performs a health check and displays the result. +- Runs the application. + +> [!NOTE] +> The `Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization` library assumes that the consumer will register the dependent call to . If you don't register this, when resolving the `HealthCheckService` an exception is thrown. + +## Application lifetime health checks + +To perform health checks on the application lifetime events of , use the extension method available in the [Microsoft.Extensions.Diagnostics.HealthChecks.Common](https://www.nuget.org/packages/Microsoft.Extensions.Diagnostics.HealthChecks.Common) NuGet package. + +This provider will indicate that the application is healthy only when it is fully active. Until the lifetime object indicates the application has started, the provider will report the application as not healthy. When the application starts shutting down, the provider will report the application as unhealthy. + +The library exposes a enabling consumers to request a health check at any time. Consider the following `ExampleService` implementation: + +:::code source="snippets/lifetime-health-checks/ExampleLifecycle.cs"::: + +The preceding code: + +- Defines a new `ExampleLifecycle` class that implements the interface. +- Defines a primary constructor accepting the following parameters: + - An instance of the class. + - An instance of the class. +- Implements the interface, with each method invoking the `CheckHealthAsync` method. +- Defines a `ReadyAsync` method that invokes the `CheckHealthAsync` method. +- Defines a custom `CheckHealthAsync` method that captures the caller name and cancellation token, then requests a health check from the `HealthCheckService` instance. The `result` is then logged. + +The only time that the health check service will report a status of is after the app has started and before stopping is called. Please consider the following _Program.cs_: + +:::code source="snippets/lifetime-health-checks/Program.cs"::: + +The preceding code: + +- Creates a new instance assigning to as the `builder` variable. +- Registers the `ExampleService` as the app's only . +- Adds a health check for the application lifetime events of by chaining a call from the instance returned by the call to the extension method. + - The `healthChecksBuilder` instance can be used to add more health checks. +- Builds the instance as the `app` variable. +- Gets an `IHostedService` from the service provider, this is the `ExampleService` instance. +- Calls given two task references: + - The `DelayAndReportAsync` method, which delays for 500 milliseconds and then invokes the `ReadyAsync` method on the `ExampleService` instance, will evaluate the health check. + - The method, starts the `app`. + +The app outputs logs in the following order, reporting the health check status as it relates to the lifecycle events: + +1. `StartingAsync`: Unhealthy +1. `StartAsync`: Unhealthy +1. `StartedAsync`: Unhealthy +1. `ReadyAsync`: Healthy +1. `StoppingAsync`: Unhealthy +1. `StopAsync`: Unhealthy +1. `StoppedAsync`: Unhealthy + +In other words, this provider ensures that the application instance only receives traffic when it's ready. If you're developing web apps with ASP.NET Core, there's health checks middleware available. For more information, [Health checks in ASP.NET Core](/aspnet/core/host-and-deploy/health-checks). diff --git a/docs/core/diagnostics/diagnostic-resource-monitoring.md b/docs/core/diagnostics/diagnostic-resource-monitoring.md new file mode 100644 index 0000000000000..1141220de6f20 --- /dev/null +++ b/docs/core/diagnostics/diagnostic-resource-monitoring.md @@ -0,0 +1,66 @@ +--- +title: Diagnostic resource monitoring +description: Learn how to use the diagnostic resource monitoring library in .NET. +ms.date: 10/30/2023 +--- + +# Resource monitoring + +Resource monitoring involves the continuous measurement of resource utilization over a specified period. The [Microsoft.Extensions.Diagnostics.ResourceMonitoring](https://www.nuget.org/packages/Microsoft.Extensions.Diagnostics.ResourceMonitoring) NuGet package offers a collection of APIs tailored for monitoring the resource utilization of your .NET applications. + +The interface furnishes methods for retrieving real-time information concerning process resource utilization. This interface supports the retrieval of data related to CPU and memory usage and is currently compatible with both Windows and Linux platforms. All resource monitoring diagnostic information is published to OpenTelemetry by default, so there's no need to manually publish this yourself. + +## Example resource monitoring usage + +The following example demonstrates how to use the `IResourceMonitor` interface to retrieve information about the current process's CPU and memory usage. + +:::code source="snippets/resource-monitoring/Program.cs" id="setup"::: + +The preceding code: + +- Instantiates a new instance, chaining calls to the and extension methods. +- Builds a new instance from the `ServiceCollection` instance. +- Gets an instance of the interface from the `ServiceProvider` instance. + +> [!IMPORTANT] +> The package assumes that the consumer will register logging providers with the `Microsoft.Extensions.Logging` package. If you don't register logging, the call to `AddResourceMonitoring` will throw an exception. + +At this point, with the `IResourceMonitor` implementation you'll ask for resource utilization with the method. The `GetUtilization` method returns a instance that contains the following information: + +- : CPU usage as a percentage. +- : Memory usage as a percentage. +- : Memory usage in bytes. +- : System resources. + - : Guaranteed memory in bytes. + - : Maximum memory in bytes. + - : Guaranteed CPU in units. + - : Maximum CPU in units. + +## Extend resource monitoring with Spectre.Console + +Extending this example, you can leverage [Spectre.Console](https://www.nuget.org/packages/Spectre.Console), a well-regarded .NET library designed to simplify the development of visually appealing, cross-platform console applications. With Spectre, you'll be able to present resource utilization data in a tabular format. The following code illustrates the usage of the `IResourceMonitor` interface to access details regarding the CPU and memory usage of the current process, then presenting this data in a table: + +:::code source="snippets/resource-monitoring/Program.cs" id="monitor" highlight="27-28,33-37"::: + +The preceding code: + +- Creates a cancellation token source and a cancellation token. +- Creates a new `Table` instance, configuring it with a title, caption, and columns. +- Performs a live render of the `Table` instance, passing in a delegate that will be invoked every three seconds. +- Gets the current resource utilization information from the `IResourceMonitor` instance and displays it as a new row in the `Table` instance. + +The following is an example of the output from the preceding code: + +:::image type="content" source="media/resource-monitoring-output.png" lightbox="media/resource-monitoring-output.png" alt-text="Example Resource Monitoring app output."::: + +## Kubernetes probes + +In addition to resource monitoring, apps that exist within a Kubernetes cluster report their health through diagnostic probes. The [Microsoft.Extensions.Diagnostics.Probes](https://www.nuget.org/packages/Microsoft.Extensions.Diagnostics.Probes) NuGet package provides support for Kubernetes probes. It externalizes various [health checks](diagnostic-health-checks.md) that align with various Kubernetes probes, for example: + +- Liveness +- Readiness +- Startup + +The library communicates the apps current health to a Kubernetes hosting environment. If a process reports as being unhealthy, Kubernetes doesn't send it any traffic, providing the process time to recover or terminate. + +To add support for Kubernetes probes, add a package reference to [Microsoft.Extensions.Diagnostics.Probes](https://www.nuget.org/packages/Microsoft.Extensions.Diagnostics.Probes). On an instance, call . diff --git a/docs/core/diagnostics/index.md b/docs/core/diagnostics/index.md index a0fe9bb94d665..35cd7ee5f15f9 100644 --- a/docs/core/diagnostics/index.md +++ b/docs/core/diagnostics/index.md @@ -1,7 +1,7 @@ --- title: Diagnostics tools overview - .NET Core description: An overview of the tools and techniques available to diagnose .NET Core applications. -ms.date: 07/16/2020 +ms.date: 10/20/2023 ms.topic: overview #Customer intent: As a .NET Core developer I want to find the best tools to help me diagnose problems so that I can be productive. --- @@ -35,7 +35,7 @@ For most cases, whether adding logging to an existing project or creating a new ### Metrics -[Metrics](metrics.md) are numerical measurements recorded over time to monitor application performance and health. Metrics are often used to generate alerts when potential problems are detected. Metrics have very low performance overhead and many services configure them as always-on telemetry. +[Metrics](metrics.md) are numerical measurements recorded over time to monitor application performance and health. Metrics are often used to generate alerts when potential problems are detected. Metrics have very low performance overhead and many services configure them as always-on telemetry. Exceptions are often recorded as metrics, and can be summarized to reduce the cardinality of the data. For more information, see [Exception summarization](diagnostic-exception-summary.md). ### Distributed traces @@ -50,6 +50,10 @@ There are multiple ways that the instrumentation data can be egressed from the a - [dotnet-monitor](./dotnet-monitor.md) - an agent for collecting traces and telemetry - Third-party libraries or app code can read the information from the , , and APIs. +## Resource monitoring + +[Resource monitoring](diagnostic-resource-monitoring.md) is the process of continuously observing and tracking the utilization, performance, and availability of various computing resources within a system. These resources can include hardware components (such as CPUs, memory, disk storage, and network interfaces) as well as software components (like applications and services). Resource monitoring is often used to detect and diagnose performance issues, and to ensure that the system is operating within expected parameters. + ## Specialized diagnostics If debugging or observability is not sufficient, .NET supports additional diagnostic mechanisms such as EventSource, Dumps, DiagnosticSource. For more information, see the [specialized diagnostics](./specialized-diagnostics-overview.md) article. diff --git a/docs/core/diagnostics/media/resource-monitoring-output.png b/docs/core/diagnostics/media/resource-monitoring-output.png new file mode 100644 index 0000000000000..6928605f149ed Binary files /dev/null and b/docs/core/diagnostics/media/resource-monitoring-output.png differ diff --git a/docs/core/diagnostics/snippets/exception-summary/Program.cs b/docs/core/diagnostics/snippets/exception-summary/Program.cs new file mode 100644 index 0000000000000..3e589a66855ff --- /dev/null +++ b/docs/core/diagnostics/snippets/exception-summary/Program.cs @@ -0,0 +1,33 @@ +using System.Net; +using System.Net.Sockets; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Diagnostics.ExceptionSummarization; + +// Add exception summarization services. +var services = new ServiceCollection() + .AddExceptionSummarizer(static builder => builder.AddHttpProvider()); + +var provider = services.BuildServiceProvider(); + +// Get the exception summarizer. +IExceptionSummarizer summarizer = provider.GetRequiredService(); + +// Define exceptions to summarize. +Exception[] exceptions = +[ + new OperationCanceledException("Operation cancelled..."), + new TaskCanceledException("Task cancelled..."), + new SocketException(10_024, "Too many sockets open..."), + new WebException("Keep alive failure...", + WebExceptionStatus.KeepAliveFailure) +]; + +foreach (var exception in exceptions) +{ + // Summarize the exception. + ExceptionSummary summary = summarizer.Summarize(exception); + + Console.WriteLine(summary); +} + +Console.ReadLine(); diff --git a/docs/core/diagnostics/snippets/exception-summary/exception-summary.csproj b/docs/core/diagnostics/snippets/exception-summary/exception-summary.csproj new file mode 100644 index 0000000000000..3c14c1d3cf376 --- /dev/null +++ b/docs/core/diagnostics/snippets/exception-summary/exception-summary.csproj @@ -0,0 +1,16 @@ + + + + Exe + net8.0 + enable + enable + preview + + + + + + + + diff --git a/docs/core/diagnostics/snippets/health-checks/Program.cs b/docs/core/diagnostics/snippets/health-checks/Program.cs new file mode 100644 index 0000000000000..47efc981236ac --- /dev/null +++ b/docs/core/diagnostics/snippets/health-checks/Program.cs @@ -0,0 +1,21 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Diagnostics.HealthChecks; +using Microsoft.Extensions.Diagnostics.ResourceMonitoring; +using Microsoft.Extensions.Hosting; + +var builder = Host.CreateApplicationBuilder(args); + +builder.Services.AddResourceMonitoring(); + +builder.Services.AddHealthChecks() + .AddResourceUtilizationHealthCheck(); + +var app = builder.Build(); + +var healthCheckService = app.Services.GetRequiredService(); + +var result = await healthCheckService.CheckHealthAsync(); + +Console.WriteLine($"{result.Status} {result.TotalDuration}"); + +app.Run(); diff --git a/docs/core/diagnostics/snippets/health-checks/health-checks.csproj b/docs/core/diagnostics/snippets/health-checks/health-checks.csproj new file mode 100644 index 0000000000000..50f10caeadd16 --- /dev/null +++ b/docs/core/diagnostics/snippets/health-checks/health-checks.csproj @@ -0,0 +1,16 @@ + + + + Exe + net8.0 + enable + enable + preview + + + + + + + + diff --git a/docs/core/diagnostics/snippets/k8s-probes/Program.cs b/docs/core/diagnostics/snippets/k8s-probes/Program.cs new file mode 100644 index 0000000000000..daa5f7a4d6deb --- /dev/null +++ b/docs/core/diagnostics/snippets/k8s-probes/Program.cs @@ -0,0 +1,11 @@ +using Microsoft.Extensions.Diagnostics.Probes; +using Microsoft.Extensions.Hosting; + +var builder = Host.CreateApplicationBuilder(args); + +// Commented out as this is experimental... +// builder.Services.AddKubernetesProbes(); + +var app = builder.Build(); + +app.Run(); diff --git a/docs/core/diagnostics/snippets/k8s-probes/k8s-probes.csproj b/docs/core/diagnostics/snippets/k8s-probes/k8s-probes.csproj new file mode 100644 index 0000000000000..a2ea44b6c99bc --- /dev/null +++ b/docs/core/diagnostics/snippets/k8s-probes/k8s-probes.csproj @@ -0,0 +1,16 @@ + + + + Exe + net8.0 + enable + enable + preview + + + + + + + + diff --git a/docs/core/diagnostics/snippets/lifetime-health-checks/ExampleLifecycle.cs b/docs/core/diagnostics/snippets/lifetime-health-checks/ExampleLifecycle.cs new file mode 100644 index 0000000000000..3d97971ccbbaf --- /dev/null +++ b/docs/core/diagnostics/snippets/lifetime-health-checks/ExampleLifecycle.cs @@ -0,0 +1,46 @@ +using System.Runtime.CompilerServices; +using Microsoft.Extensions.Diagnostics.HealthChecks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; + +internal class ExampleLifecycle( + HealthCheckService healthCheckService, + ILogger logger) : IHostedLifecycleService +{ + Task IHostedService.StartAsync( + CancellationToken cancellationToken) => + CheckHealthAsync(cancellationToken: cancellationToken); + + Task IHostedLifecycleService.StartedAsync( + CancellationToken cancellationToken) => + CheckHealthAsync(cancellationToken: cancellationToken); + + Task IHostedLifecycleService.StartingAsync( + CancellationToken cancellationToken) => + CheckHealthAsync(cancellationToken: cancellationToken); + + Task IHostedService.StopAsync( + CancellationToken cancellationToken) => + CheckHealthAsync(cancellationToken: cancellationToken); + + Task IHostedLifecycleService.StoppedAsync( + CancellationToken cancellationToken) => + CheckHealthAsync(cancellationToken: cancellationToken); + + Task IHostedLifecycleService.StoppingAsync( + CancellationToken cancellationToken) => + CheckHealthAsync(cancellationToken: cancellationToken); + + public Task ReadyAsync() => CheckHealthAsync(); + + private async Task CheckHealthAsync( + [CallerMemberName] string eventName = "", + CancellationToken cancellationToken = default) + { + HealthReport result = + await healthCheckService.CheckHealthAsync(cancellationToken); + + logger.LogInformation( + "{EventName}: {Status}", eventName, result.Status); + } +} diff --git a/docs/core/diagnostics/snippets/lifetime-health-checks/Program.cs b/docs/core/diagnostics/snippets/lifetime-health-checks/Program.cs new file mode 100644 index 0000000000000..90c8a3b0c7e4a --- /dev/null +++ b/docs/core/diagnostics/snippets/lifetime-health-checks/Program.cs @@ -0,0 +1,30 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Diagnostics.HealthChecks; +using Microsoft.Extensions.Hosting; + +var builder = Host.CreateApplicationBuilder(args); + +var healthChecksBuilder = builder.Services + .AddHostedService() + .AddHealthChecks() + .AddApplicationLifecycleHealthCheck(); + +// You could use the healthChecksBuilder instance to add more checks... + +var app = builder.Build(); + +var services = app.Services.GetRequiredService>(); + +await Task.WhenAll(DelayAndReportAsync(services), app.RunAsync()); + +static async Task DelayAndReportAsync(IEnumerable services) +{ + // Ensure app started... + await Task.Delay(500); + + var service = services.FirstOrDefault(static s => s is ExampleLifecycle); + if (service is ExampleLifecycle example) + { + await example.ReadyAsync(); + } +} diff --git a/docs/core/diagnostics/snippets/lifetime-health-checks/lifetime-health-checks.csproj b/docs/core/diagnostics/snippets/lifetime-health-checks/lifetime-health-checks.csproj new file mode 100644 index 0000000000000..7fb9506b56bdf --- /dev/null +++ b/docs/core/diagnostics/snippets/lifetime-health-checks/lifetime-health-checks.csproj @@ -0,0 +1,16 @@ + + + + Exe + net8.0 + enable + enable + preview + + + + + + + + diff --git a/docs/core/diagnostics/snippets/resource-monitoring/Program.cs b/docs/core/diagnostics/snippets/resource-monitoring/Program.cs new file mode 100644 index 0000000000000..98f41a34baf89 --- /dev/null +++ b/docs/core/diagnostics/snippets/resource-monitoring/Program.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Diagnostics.ResourceMonitoring; +using Microsoft.Extensions.Logging; +using Spectre.Console; + +var services = new ServiceCollection() + .AddLogging(static builder => builder.AddConsole()) + .AddResourceMonitoring(); + +var provider = services.BuildServiceProvider(); + +var monitor = provider.GetRequiredService(); +// + +using var cancellationTokenSource = new CancellationTokenSource(); +var token = cancellationTokenSource.Token; + +// +await StartMonitoringAsync(monitor, token); + +async Task StartMonitoringAsync(IResourceMonitor monitor, CancellationToken cancellationToken) +{ + var table = new Table() + .Centered() + .Title("Resource Monitoring", new Style(foreground: Color.Purple, decoration: Decoration.Bold)) + .Caption("Updates every three seconds. *GTD: Guaranteed ", new Style(decoration: Decoration.Dim)) + .RoundedBorder() + .BorderColor(Color.Cyan1) + .AddColumns( + [ + new TableColumn("Time").Centered(), + new TableColumn("CPU %").Centered(), + new TableColumn("Memory %").Centered(), + new TableColumn("Memory (bytes)").Centered(), + new TableColumn("GTD / Max Memory (bytes)").Centered(), + new TableColumn("GTD / Max CPU (units)").Centered(), + ]); + + await AnsiConsole.Live(table) + .StartAsync(async ctx => + { + var window = TimeSpan.FromSeconds(3); + while (cancellationToken.IsCancellationRequested is false) + { + var utilization = monitor.GetUtilization(window); + var resources = utilization.SystemResources; + + table.AddRow( + [ + $"{DateTime.Now:T}", + $"{utilization.CpuUsedPercentage:p}", + $"{utilization.MemoryUsedPercentage:p}", + $"{utilization.MemoryUsedInBytes:#,#}", + $"{resources.GuaranteedMemoryInBytes:#,#} / {resources.MaximumMemoryInBytes:#,#}", + $"{resources.GuaranteedCpuUnits} / {resources.MaximumCpuUnits}", + ]); + + ctx.Refresh(); + await Task.Delay(window); + } + }); + + Console.CancelKeyPress += (_, e) => + { + e.Cancel = true; + cancellationTokenSource.Cancel(); + }; +} +// diff --git a/docs/core/diagnostics/snippets/resource-monitoring/resource-monitoring.csproj b/docs/core/diagnostics/snippets/resource-monitoring/resource-monitoring.csproj new file mode 100644 index 0000000000000..4c1dfb7a8db8d --- /dev/null +++ b/docs/core/diagnostics/snippets/resource-monitoring/resource-monitoring.csproj @@ -0,0 +1,18 @@ + + + + Exe + net8.0 + enable + enable + preview + + + + + + + + + + diff --git a/docs/navigate/tools-diagnostics/index.yml b/docs/navigate/tools-diagnostics/index.yml index 150421011790b..7baf8b595fe8e 100644 --- a/docs/navigate/tools-diagnostics/index.yml +++ b/docs/navigate/tools-diagnostics/index.yml @@ -7,7 +7,7 @@ metadata: title: .NET tools and diagnostics documentation description: Learn about .NET tools, including the SDK and .NET CLI, diagnostics and instrumentation, code analysis, and package validation. ms.topic: landing-page - ms.date: 01/17/2023 + ms.date: 10/10/2023 # linkListType: architecture | concept | deploy | download | get-started | how-to-guide | learn | overview | quickstart | reference | sample | tutorial | video | whats-new @@ -92,6 +92,14 @@ landingContent: url: ../../core/diagnostics/metrics.md - text: Runtime events url: ../../fundamentals/diagnostics/runtime-events.md + - linkListType: concept + links: + - text: App health checks in C# + url: ../../core/diagnostics/diagnostic-health-checks.md + - text: Exception summary + url: ../../core/diagnostics/diagnostic-exception-summary.md + - text: Resource monitoring + url: ../../core/diagnostics/diagnostic-resource-monitoring.md - linkListType: reference links: - text: Unmanaged API for debugging diff --git a/docs/navigate/tools-diagnostics/toc.yml b/docs/navigate/tools-diagnostics/toc.yml index 3afc763061f7e..cfb48e54d48fb 100644 --- a/docs/navigate/tools-diagnostics/toc.yml +++ b/docs/navigate/tools-diagnostics/toc.yml @@ -323,6 +323,12 @@ items: href: ../../core/extensions/logging.md - name: Observability with OpenTelemetry href: ../../core/diagnostics/observability-with-otel.md + - name: Resource monitoring + href: ../../core/diagnostics/diagnostic-resource-monitoring.md + displayName: resource monitoring, + - name: App health checks + href: ../../core/diagnostics/diagnostic-health-checks.md + displayName: health check,healthcheck,degraded,healthy,unhealthy,resource monitoring,resource health,app lifecycle monitoring - name: Metrics items: - name: Overview @@ -330,6 +336,9 @@ items: href: ../../core/diagnostics/metrics.md - name: Instrumentation href: ../../core/diagnostics/metrics-instrumentation.md + - name: Exception summarization + href: ../../core/diagnostics/diagnostic-exception-summary.md + displayName: exception summarization,exception summary,exception summarizer,ExceptionSummary - name: Collection href: ../../core/diagnostics/metrics-collection.md - name: Built-in Metrics