Package reference page maintained from the source documentation in src/HealthChecks.Grafana.

Grafana Health Check

This health check verifies a Grafana instance through the Grafana /api/health endpoint.

Defaults

By default, the Grafana health endpoint is checked and the database field returned by Grafana must report ok.

void ConfigureServices(IServiceCollection services)
{
    services
        .AddHealthChecks()
        .AddGrafana(new Uri("https://grafana.example.com"));
}

Custom endpoint or request

If Grafana is exposed through a reverse proxy path, configure HealthEndpointPath. For authenticated or proxied setups, use ConfigureRequest or configure the named HTTP client.

using HealthChecks.Grafana;
using System.Net.Http.Headers;

void ConfigureServices(IServiceCollection services)
{
    services
        .AddHealthChecks()
        .AddGrafana(new Uri("https://grafana.example.com"), options =>
        {
            options.HealthEndpointPath = "/grafana/api/health";
            options.ConfigureRequest = request =>
            {
                request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "token");
            };
        });
}

Customization

You can additionally add the following parameters: