Skip to content

Commit

Permalink
Add internal ResourceMonitor when registering ResourceUtilizationHeal…
Browse files Browse the repository at this point in the history
…thCheck (#5413)
  • Loading branch information
evgenyfedorov2 authored Sep 16, 2024
1 parent 39f5d27 commit 2018ae6
Show file tree
Hide file tree
Showing 2 changed files with 266 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public static IHealthChecksBuilder AddResourceUtilizationHealthCheck(this IHealt
_ = Throw.IfNull(builder);
_ = Throw.IfNull(tags);

_ = builder.Services.AddResourceMonitoring();

_ = builder.Services.AddOptionsWithValidateOnStart<ResourceUtilizationHealthCheckOptions, ResourceUtilizationHealthCheckOptionsValidator>();
return builder.AddCheck<ResourceUtilizationHealthCheck>(HealthCheckName, tags: tags);
}
Expand All @@ -44,6 +46,8 @@ public static IHealthChecksBuilder AddResourceUtilizationHealthCheck(this IHealt
_ = Throw.IfNull(builder);
_ = Throw.IfNull(tags);

_ = builder.Services.AddResourceMonitoring();

_ = builder.Services.AddOptionsWithValidateOnStart<ResourceUtilizationHealthCheckOptions, ResourceUtilizationHealthCheckOptionsValidator>();
return builder.AddCheck<ResourceUtilizationHealthCheck>(HealthCheckName, tags: tags);
}
Expand Down
Loading

0 comments on commit 2018ae6

Please sign in to comment.