Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

healthchecks-setup

/healthchecks-setup

Dodaje do ASP.NET Core health checks z podziałem na liveness i readiness oraz sprawdzaniem zależności (baza, cache, broker) dla Kubernetes i load balancerów, w tym endpointy /health.

Licencja
MIT
Ostatnia zmiana repozytorium
09.08.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 09.08.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Dodaje do ASP.NET Core health checks z podziałem na liveness i readiness oraz sprawdzaniem zależności (baza, cache, broker) dla Kubernetes i load balancerów, w tym endpointy /health.

Oryginalny opis (EN)

Add ASP.NET Core health checks with a liveness/readiness split and dependency checks (database, cache, message broker) for Kubernetes and load balancers. Use this skill whenever the user wants health checks, liveness/readiness probes, /health endpoints, dependency health, Kubernetes probes, or asks "how do I add health checks / readiness vs liveness / health endpoint". Always use this skill for health-check requests; it wires the live/ready split and dependency checks correctly.

Jak działa

  1. Input — point it at your project
  2. Wiring (the live/ready split that matters)
  3. Kubernetes probes
  4. Principles
  5. How to use it & best prompts
Sekcje z nagłówków SKILL.md, w oryginale · 41 linii, 295 słów
Podgląd SKILL.md
---
name: healthchecks-setup
description: Add ASP.NET Core health checks with a liveness/readiness split and dependency checks (database, cache, message broker) for Kubernetes and load balancers. Use this skill whenever the user wants health checks, liveness/readiness probes, /health endpoints, dependency health, Kubernetes probes, or asks "how do I add health checks / readiness vs liveness / health endpoint". Always use this skill for health-check requests; it wires the live/ready split and dependency checks correctly.
category: Observability
version: 1.0.0
---

# Health Checks Setup

Add health checks that orchestrators can actually use: a **liveness** probe (am I alive?) separate from a **readiness** probe (can I serve traffic?), with dependency checks tagged correctly.

## Input — point it at your project
Works on a target: a **project** or **GitHub URL**. Inspect: `grep -rn "AddHealthChecks\|MapHealthChecks\|UseHealthChecks" --include=*.cs <target>` and the dependencies in `.csproj` (DB/cache/broker) to know what to check.

## Wiring (the live/ready split that matters)
```csharp
builder.Services.AddHealthChecks()
    .AddNpgSql(conn, name: "db", tags: new[] { "ready" })
    .AddRedis(redisConn, name: "redis", tags: new[] { "ready" })
    .AddCheck("self", () => HealthCheckResult.Healthy(), tags: new[] { "live" });

// Liveness: is the process up? (no dependencies — don't restart on a DB blip)
app.MapHealthChecks("/health/live", new() { Predicate = c => c.Tags.Contains("live") });

// Readiness: can it serve? (include dependencies — pull from LB while a dep is down)
app.MapHealthChecks("/health/ready", new()
{
    Predicate = c => c.Tags.Contains("ready"),
    ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse   // JSON detail
});
```

## Kubernetes probes
```yaml
livenessProbe:  { httpGet: { path: /health/live,  port: 8080 }, periodSeconds: 10 }
readinessProbe: { httpGet: { path: /health/ready, port: 8080 }, periodSeconds: 5 }
```

## Principles
- **Liveness ≠ readiness.** Liveness must NOT depend on the DB — a transient DB outage shouldn't restart your pods. Readiness should, so traffic is withheld until dependencies recover.
- Keep checks **fast and cheap** (timeouts); a slow health check causes flapping.
- Don't expose detailed health publicly without auth — it leaks topology.
- Add a check per critical dependency, tagged `ready`.

## How to use it & best prompts
"Add health checks with liveness and readiness", "wire DB and Redis health", "Kubernetes probes for my service", "why does a DB blip restart my pods" (answer: liveness depends on DB — fix the split). Pairs with `microservice-template-generator`.
Pliki w paczce (2)
  • SKILL.md 3 KB
  • USAGE.md 1 KB

Wersje

W bazie nie ma innych skilli o nazwie healthchecks-setup.

Migawka bazy z 28.10.2026 · wersja paczki 3c5d19a248d0 (skrót SHA-256 całej paczki)

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100health-check-endpoints
    Projektuje endpointy kontroli kondycji dla liveness, readiness i monitorowania zależności w Kubernetes, load balancerach i autoskalowaniu, także przy błędach sond i opóźnieniach startu.
  • 100orchardcore-health-checks
    Pomaga udostępniać i rozszerzać kontrole stanu tenantów w Orchard Core: HealthChecksOptions, endpointy, kompaktowe i szczegółowe kody statusu, limitowanie sond i rejestracja IHealthCheck.
  • 100health-checks
    Opisuje wzorce kontroli kondycji i łagodnego zamykania: sondy liveness i readiness, kontrole zależności, sondy Kubernetes, Spring Actuator i zamykanie bez przestojów.
  • 100health-probes
    Konfiguruje sondy zdrowia Kubernetes, hooki cyklu życia i polityki zakończenia (liveness, readiness, startup, postStart, preStop, terminationMessagePolicy) w specyfikacjach podów, Deploymentach, StatefulSetach i szablonach Helm.
  • 100spring-actuator
    Konfiguruje Spring Boot Actuator do monitoringu: health indicators, metryki Micrometer, integrację z Prometheus, własne endpointy, sondy Kubernetes i zabezpieczenie endpointów.
  • 90health-checks
    Pomaga projektować sondy liveness, readiness i startup, które leczą prawdziwe awarie bez wzmacniania przestojów, przy endpointach zdrowia lub pętlach restartów.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.