{"id":51083170,"url":"https://github.com/slothlabsorg/health-dsl","last_synced_at":"2026-06-23T20:01:47.099Z","repository":{"id":365581492,"uuid":"1269761006","full_name":"slothlabsorg/health-dsl","owner":"slothlabsorg","description":"A tiny DSL for service readiness/liveness checks: concurrent execution, per-check timeouts, correct aggregation — native Rust / TypeScript / Kotlin.","archived":false,"fork":false,"pushed_at":"2026-06-18T00:44:11.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-18T02:14:01.895Z","etag":null,"topics":["devops","health-check","kotlin","liveness","observability","readiness","rust","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/slothlabsorg/health-dsl","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slothlabsorg.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-15T04:29:39.000Z","updated_at":"2026-06-18T00:44:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/slothlabsorg/health-dsl","commit_stats":null,"previous_names":["slothlabsorg/health-dsl"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/slothlabsorg/health-dsl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slothlabsorg%2Fhealth-dsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slothlabsorg%2Fhealth-dsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slothlabsorg%2Fhealth-dsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slothlabsorg%2Fhealth-dsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slothlabsorg","download_url":"https://codeload.github.com/slothlabsorg/health-dsl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slothlabsorg%2Fhealth-dsl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34704748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["devops","health-check","kotlin","liveness","observability","readiness","rust","typescript"],"created_at":"2026-06-23T20:01:45.109Z","updated_at":"2026-06-23T20:01:47.084Z","avatar_url":"https://github.com/slothlabsorg.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# health-dsl\n\n**A tiny DSL for declaring service readiness/liveness checks — run concurrently,\naggregated correctly, serialized anywhere. Three native implementations.**\n\nMost services grow an ad-hoc `/health` endpoint: a pile of `try/catch` blocks,\ninconsistent timeouts, one slow dependency that hangs the whole probe, and no\nclear distinction between \"we're down\" and \"we're degraded but still serving.\"\n`health-dsl` makes that a declaration.\n\n```kotlin\n// Kotlin\nval health = healthChecks {\n    check(\"database\", critical = true) { if (db.ping()) up() else down(\"unreachable\") }\n    check(\"cache\") { up(\"hitRate\" to \"0.93\") }\n    check(\"disk\", timeout = 2.seconds) {\n        val free = freePercent()\n        when {\n            free \u003c 5  -\u003e down(\"disk almost full: $free%\")\n            free \u003c 15 -\u003e degraded(\"disk low: $free%\")\n            else      -\u003e up(\"freePercent\" to free.toString())\n        }\n    }\n}\nval report = health.run()      // all checks run concurrently\nreport.status                  // UP | DEGRADED | DOWN\n```\n\n## What it gives you\n\n- **Correct aggregation.** A `critical` dependency that is `DOWN` makes the\n  system `DOWN`; a non-critical failure (or any `degraded`) makes it `DEGRADED`\n  but still healthy. You stop conflating \"page someone\" with \"we're fine.\"\n- **Concurrency + per-check timeouts.** `report.durationMs` is roughly your\n  slowest check, not the sum. A hung dependency becomes a `DOWN` outcome after\n  its timeout instead of hanging the probe.\n- **No check can break the report.** Exceptions/panics and timeouts fold into a\n  `DOWN` outcome (cancellation is still propagated).\n- **Serialize anywhere.** A dependency-free JSON renderer, plus a map/struct form\n  for Jackson, kotlinx.serialization, serde, or a Spring Actuator\n  `HealthIndicator`.\n\n## Implementations\n\n| Language   | Path                 | Install                          | Async model               |\n|------------|----------------------|----------------------------------|---------------------------|\n| Rust       | [`rust/`](rust/)     | `cargo add health-dsl`           | `tokio` + `join_all`      |\n| TypeScript | [`ts/`](ts/)         | `npm i @slothlabs/health-dsl`    | `Promise.all` (zero deps) |\n| Kotlin/JVM | [`kotlin/`](kotlin/) | `com.slothlabs:health-dsl`       | coroutines                |\n\n## Install\n\nEach implementation lives in its own subdirectory of this one repository and is\npublished to its language's registry. You can install from a registry release,\nor pull straight from git/JitPack today.\n\n### Rust\n\nFrom git (works immediately, no registry release needed):\n\n```sh\ncargo add health-dsl --git https://github.com/slothlabsorg/health-dsl\n```\n\nOr, once a `rust-v*` tag is published to crates.io:\n\n```sh\ncargo add health-dsl\ncargo add tokio --features rt-multi-thread,macros,time\n```\n\n### Kotlin / JVM (JitPack — works immediately)\n\nJitPack builds the `kotlin/` module straight from a git tag — no manual publish\nstep required.\n\n```kotlin\n// build.gradle.kts\nrepositories {\n    mavenCentral()\n    maven(\"https://jitpack.io\")\n}\n\ndependencies {\n    implementation(\"com.github.slothlabsorg:health-dsl:v0.1.0\")\n}\n```\n\nThe `0.1.0` coordinate resolves to the git tag `v0.1.0`. (Releases pushed to\nGitHub Packages under `com.slothlabs:health-dsl` via a `jvm-v*` tag are an\nalternative; see [RELEASING.md](RELEASING.md).)\n\n### TypeScript\n\n```sh\nnpm i @slothlabs/health-dsl\n```\n\nAvailable on npm once the `npm-v*` tag publishes the package (see\n[RELEASING.md](RELEASING.md)).\n\n## Status semantics (identical across languages)\n\n| Any check…                         | Overall status |\n|------------------------------------|----------------|\n| critical `DOWN`                    | `DOWN`         |\n| non-critical `DOWN`, or `DEGRADED` | `DEGRADED`     |\n| all `UP` (or no checks)            | `UP`           |\n\n`Status` is ordered `UP \u003c DEGRADED \u003c DOWN`, so aggregation is \"take the worst,\"\nwith a non-critical `DOWN` capped at `DEGRADED`.\n\nSee each subdirectory's README for the language-specific API.\n\n## License\n\nMIT © SlothLabs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslothlabsorg%2Fhealth-dsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslothlabsorg%2Fhealth-dsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslothlabsorg%2Fhealth-dsl/lists"}