# DistributedApplicationBuilder.AddHealthCheck

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Defined on: [DistributedApplicationBuilder](/reference/api/go/aspire.hosting/distributedapplicationbuilder.md)
- Version: `17.0.0`
- Kind: `method`

Adds a custom health check callback to the distributed-application builder.

## Definition

```go
type DistributedApplicationBuilder interface {
    // ... omitted for brevity
    AddHealthCheck(
        name string,
        check func(...any) *HealthCheckResult,
    ) error
}
```

## Signature

```go
AddHealthCheck(
    name string,
    check func(...any) *HealthCheckResult,
) error
```

## Parameters

- `name` (`string`) -- The health check registration name.
- `check` (`func(...any) *HealthCheckResult`) -- The callback that evaluates the health check.

## Returns

`error`

Returns `error`.

## Defined on

- [DistributedApplicationBuilder](/reference/api/go/aspire.hosting/distributedapplicationbuilder.md) -- `interface`
