Skip to content

AgentPrismHealthCheckExtensions

Namespace AgentPrism · Assembly AgentPrism.AspNetCore.dll

Extensions that connect AgentPrism to the standard.NET health check system.

public static class AgentPrismHealthCheckExtensions

objectAgentPrismHealthCheckExtensions

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

AddAgentPrismHealthChecks(IHealthChecksBuilder, string, IEnumerable<string>?)

Section titled “ AddAgentPrismHealthChecks(IHealthChecksBuilder, string, IEnumerable<string>?)”

Registers the AgentPrism health check. The consumer sets up its own /health path.

public static IHealthChecksBuilder AddAgentPrismHealthChecks(this IHealthChecksBuilder builder, string name = "agentprism", IEnumerable<string>? tags = null)

builder IHealthChecksBuilder

The health checks builder.

name string

The name of the check. Default is agentprism.

tags IEnumerable<string>?

Tags to add to the check. Example: readiness/liveness separation.

IHealthChecksBuilder

The builder, for chaining.

AgentPrism does not call MapHealthChecks — seizing the consumer’s path choice would force the no-surprises rule. Setup:

builder.Services.AddHealthChecks().AddAgentPrismHealthChecks();
app.MapHealthChecks("/health");

The check reads AgentPrismDiagnosticsCollector; it produces no model call. For the three states, see AgentPrism.AgentPrismHealthCheck.

This call only adds a service registration; whether AddAgentPrism is called before or after it does not matter (DI registration is order-independent). However, if AddAgentPrism is never called, AgentPrismDiagnosticsCollector cannot be resolved on the first /health probe and DI raises a clear error.

ArgumentNullException

builder is null.

ArgumentException

name is empty.