# TraconHealthCheckExtensions

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.traconhealthcheckextensions/
> Summary: TraconHealthCheckExtensions: Extensions that connect Tracon to the standard.NET health check system.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.AspNetCore.dll</code></div>

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

```csharp
public static class TraconHealthCheckExtensions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.traconhealthcheckextensions/">TraconHealthCheckExtensions</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Methods

### <a id="Tracon_TraconHealthCheckExtensions_AddTraconHealthChecks_Microsoft_Extensions_DependencyInjection_IHealthChecksBuilder_System_String_System_Collections_Generic_IEnumerable_System_String__"></a> AddTraconHealthChecks\(IHealthChecksBuilder, string, IEnumerable<string\>?\)

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

```csharp
public static IHealthChecksBuilder AddTraconHealthChecks(this IHealthChecksBuilder builder, string name = "tracon", IEnumerable<string>? tags = null)
```

#### Parameters

`builder` [IHealthChecksBuilder](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.ihealthchecksbuilder)

The health checks builder.

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The name of the check. Default is `tracon`.

`tags` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\>?

Tags to add to the check. Example: readiness/liveness separation.

#### Returns

 [IHealthChecksBuilder](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.ihealthchecksbuilder)

The builder, for chaining.

#### Remarks

Tracon does not call `MapHealthChecks` — taking over the consumer's path
choice would break the no-surprises rule. Setup:

```csharp
builder.Services.AddHealthChecks().AddTraconHealthChecks();
app.MapHealthChecks("/health");
```

The check reads [TraconDiagnosticsCollector](/api/tracon.tracondiagnosticscollector/); it produces no
model call. For the three states, see [Tracon.TraconHealthCheck](/api/tracon/).

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

#### Exceptions

 [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception)

`builder` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).

 [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception)

`name` is empty.
