---
url: /saas-starter/v0.9.0/guide/observability.md
---
# Observability

::: tip One page for every option
This page covers every choice of `--Persistence`, `--Auth`, `--IncludeTests` and `--Aspire`.
A label says which options a part is for; the copy in your app's `docs/` folder has only yours.
`ApiHost` stands for your app's name.
:::

## Health checks

* `/health/live`: the process is running.
* `/health/ready`: it can also reach PostgreSQL.

Point your host's or load balancer's health checks at them.

## Traces, metrics and logs

::: info Marten
The app records traces, metrics and logs with OpenTelemetry: HTTP requests, SQL commands,
Wolverine messages and handlers, Marten, and .NET runtime metrics
(`src/ApiHost/Observability/OpenTelemetrySetup.cs`). Nothing is sent anywhere until you set
`OTEL_EXPORTER_OTLP_ENDPOINT`.
:::

::: info EF Core
The app records traces, metrics and logs with OpenTelemetry: HTTP requests, SQL commands,
Wolverine messages and handlers, and .NET runtime metrics
(`src/ApiHost/Observability/OpenTelemetrySetup.cs`). Nothing is sent anywhere until you set
`OTEL_EXPORTER_OTLP_ENDPOINT`.
:::

::: info With Aspire
The Aspire AppHost shows all of this without any set-up ([how](./how-to/run-with-aspire.md)). Without
it, to see it locally in the standalone Aspire dashboard:
:::

::: info Without Aspire
To see it locally in the Aspire dashboard:
:::

```bash
docker compose --profile observability up -d     # dashboard on http://localhost:18888
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 dotnet run --project src/ApiHost
```

(`dotnet run` itself also reports to the dashboard, as `dotnet-cli`; the app is `ApiHost`.)

In production, point `OTEL_EXPORTER_OTLP_ENDPOINT` (and, if needed, `OTEL_EXPORTER_OTLP_HEADERS`)
at any OpenTelemetry backend, such as Grafana, Honeycomb or a self-hosted Jaeger.

::: info With accounts

## Failed emails

Account emails are sent by a Wolverine handler and retried with growing delays if the mail
server fails. Emails that still fail end up in Wolverine's `wolverine_dead_letters` table, and
the failures are in the logs.
:::
