{"id":26594034,"url":"https://github.com/fkucukkara/healthcheckworkshop","last_synced_at":"2026-04-25T16:34:58.692Z","repository":{"id":280146369,"uuid":"941118109","full_name":"fkucukkara/healthCheckWorkshop","owner":"fkucukkara","description":"This is a basic .NET Core API implementing health checks using Microsoft.Extensions.Diagnostics.HealthChecks. It provides endpoints to monitor the application's health status.","archived":false,"fork":false,"pushed_at":"2025-06-29T12:32:54.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-29T13:37:57.324Z","etag":null,"topics":["health-check","netcore-webapi"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fkucukkara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-01T14:32:45.000Z","updated_at":"2025-06-29T12:32:57.000Z","dependencies_parsed_at":"2025-03-01T15:30:49.497Z","dependency_job_id":"84a2f812-f37a-40a1-9568-367785315d16","html_url":"https://github.com/fkucukkara/healthCheckWorkshop","commit_stats":null,"previous_names":["fkucukkara/healthcheckworkshop"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fkucukkara/healthCheckWorkshop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkucukkara%2FhealthCheckWorkshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkucukkara%2FhealthCheckWorkshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkucukkara%2FhealthCheckWorkshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkucukkara%2FhealthCheckWorkshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fkucukkara","download_url":"https://codeload.github.com/fkucukkara/healthCheckWorkshop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkucukkara%2FhealthCheckWorkshop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32269462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["health-check","netcore-webapi"],"created_at":"2025-03-23T15:33:17.752Z","updated_at":"2026-04-25T16:34:58.674Z","avatar_url":"https://github.com/fkucukkara.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Health Check API\n\nThis is a basic .NET Core API implementing health checks using `Microsoft.Extensions.Diagnostics.HealthChecks`. It provides endpoints to monitor the application's health status.\n\n## Prerequisites\n\n- .NET 9.\n- Visual Studio / VS Code / Any C# IDE\n\n## Installation\n\n1. Clone the repository:\n   ```sh\n   git clone https://github.com/fkucukkara/healthCheckWorkshop.git\n   ```\n2. Restore dependencies:\n   ```sh\n   dotnet restore\n   ```\n3. Build the application:\n   ```sh\n   dotnet build\n   ```\n\n## Running the Application\n\nTo run the application, use the following command:\n```sh\n   dotnet run\n```\n\n## Health Check Endpoints\n\nThe API exposes two health check endpoints:\n\n- **Liveness Probe**: Checks if the service is running.\n  ```\n  GET /healthz/live\n  ```\n- **Readiness Probe**: Checks if the primary services are ready.\n  ```\n  GET /healthz/ready\n  ```\n\n## Implementation Details\n\n- **Primary Health Check**: Implemented via `SamplePrimaryCheckService`, marked with the tag `primary`.\n- **Secondary Health Check**: Implemented via `SampleSecondaryCheckService`, marked with the tag `secondary`.\n- `HealthStatus.Degraded` is used as a failure status for both health checks.\n- Health checks are mapped using `MapHealthChecks` in `Program.cs`.\n\n## HTTPS Redirection\n\nThe application forces HTTPS redirection using `app.UseHttpsRedirection();` to ensure secure communication.\n\n## Extending Health Checks\n\nYou can add custom health checks by implementing `IHealthCheck`:\n\n```csharp\nusing Microsoft.Extensions.Diagnostics.HealthChecks;\nusing System.Threading;\nusing System.Threading.Tasks;\n\npublic class CustomHealthCheck : IHealthCheck\n{\n    public Task\u003cHealthCheckResult\u003e CheckHealthAsync(\n        HealthCheckContext context,\n        CancellationToken cancellationToken = default)\n    {\n        return Task.FromResult(HealthCheckResult.Healthy(\"Custom check is healthy\"));\n    }\n}\n```\n\nRegister it in `Program.cs`:\n```csharp\nbuilder.Services.AddHealthChecks()\n    .AddCheck\u003cCustomHealthCheck\u003e(\"CustomCheck\");\n```\n\n## License\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nThis project is licensed under the MIT License. See the [`LICENSE`](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffkucukkara%2Fhealthcheckworkshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffkucukkara%2Fhealthcheckworkshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffkucukkara%2Fhealthcheckworkshop/lists"}