Skip to content

Commit a60aa02

Browse files
initial commit (#42626)
1 parent 87af0bb commit a60aa02

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

docs/core/diagnostics/diagnostic-health-checks.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,12 @@ To perform health checks on the resource utilization of your .NET apps, add a pa
2525
The preceding code:
2626

2727
- Creates a new <xref:Microsoft.Extensions.Hosting.HostApplicationBuilder> instance.
28-
- Adds resource monitoring by calling <xref:Microsoft.Extensions.DependencyInjection.ResourceMonitoringServiceCollectionExtensions.AddResourceMonitoring%2A>.
2928
- Adds a health check for resource utilization by chaining a call from the <xref:Microsoft.Extensions.DependencyInjection.HealthCheckServiceCollectionExtensions.AddHealthChecks%2A> call to the <xref:Microsoft.Extensions.DependencyInjection.ResourceUtilizationHealthCheckExtensions.AddResourceUtilizationHealthCheck%2A> extension method.
3029
- Builds the <xref:Microsoft.Extensions.Hosting.IHost> instance as the `app` variable.
3130
- Gets an instance of the <xref:Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckService> class from the service provider.
3231
- Performs a health check and displays the result.
3332
- Runs the application.
3433

35-
> [!NOTE]
36-
> The `Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization` library assumes that the consumer will register the dependent call to <xref:Microsoft.Extensions.DependencyInjection.ResourceMonitoringServiceCollectionExtensions.AddResourceMonitoring%2A>. If you don't register this, when resolving the `HealthCheckService` an exception is thrown.
37-
3834
## Application lifetime health checks
3935

4036
To perform health checks on the application lifetime events of <xref:Microsoft.Extensions.Hosting.IHostApplicationLifetime>, use the <xref:Microsoft.Extensions.DependencyInjection.CommonHealthChecksExtensions.AddApplicationLifecycleHealthCheck%2A> extension method available in the [Microsoft.Extensions.Diagnostics.HealthChecks.Common](https://www.nuget.org/packages/Microsoft.Extensions.Diagnostics.HealthChecks.Common) NuGet package.

docs/core/diagnostics/snippets/health-checks/Program.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
using Microsoft.Extensions.DependencyInjection;
22
using Microsoft.Extensions.Diagnostics.HealthChecks;
3-
using Microsoft.Extensions.Diagnostics.ResourceMonitoring;
43
using Microsoft.Extensions.Hosting;
54

65
var builder = Host.CreateApplicationBuilder(args);
76

8-
builder.Services.AddResourceMonitoring();
9-
107
builder.Services.AddHealthChecks()
118
.AddResourceUtilizationHealthCheck();
129

0 commit comments

Comments
 (0)