{"id":21358541,"url":"https://github.com/logicblocks/salutem","last_synced_at":"2025-07-13T00:34:01.021Z","repository":{"id":38290891,"uuid":"273596758","full_name":"logicblocks/salutem","owner":"logicblocks","description":"A health check library for sync / async health checks.","archived":false,"fork":false,"pushed_at":"2024-04-23T06:32:18.000Z","size":1832,"stargazers_count":42,"open_issues_count":1,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-04-23T11:02:21.766Z","etag":null,"topics":["clojure","health","health-check","healthcheck","library"],"latest_commit_sha":null,"homepage":"https://logicblocks.github.io/salutem/","language":"Clojure","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/logicblocks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2020-06-19T22:22:29.000Z","updated_at":"2024-04-29T07:26:48.449Z","dependencies_parsed_at":"2024-01-05T07:27:37.167Z","dependency_job_id":"fe244314-d431-48db-a4f3-98300eac5f4d","html_url":"https://github.com/logicblocks/salutem","commit_stats":{"total_commits":209,"total_committers":5,"mean_commits":41.8,"dds":0.3253588516746412,"last_synced_commit":"a20bc7f0ddfa578043c64d7906a1f5c5d3d8639c"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicblocks%2Fsalutem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicblocks%2Fsalutem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicblocks%2Fsalutem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logicblocks%2Fsalutem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logicblocks","download_url":"https://codeload.github.com/logicblocks/salutem/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225845419,"owners_count":17533283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["clojure","health","health-check","healthcheck","library"],"created_at":"2024-11-22T05:18:58.262Z","updated_at":"2024-11-22T05:18:58.783Z","avatar_url":"https://github.com/logicblocks.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# salutem\n\n[![Clojars Project](https://img.shields.io/clojars/v/io.logicblocks/salutem.core.svg)](https://clojars.org/io.logicblocks/salutem.core)\n[![Clojars Downloads](https://img.shields.io/clojars/dt/io.logicblocks/salutem.core.svg)](https://clojars.org/io.logicblocks/salutem.core)\n[![GitHub Contributors](https://img.shields.io/github/contributors-anon/logicblocks/salutem.svg)](https://github.com/logicblocks/salutem/graphs/contributors)\n\nA system for defining and maintaining a collection of health checks.\n\n`salutem` supports:\n* both realtime and background checks\n* a registry for storing, finding and resolving checks\n* an asynchronous maintenance system for ensuring that the results of checks are\n  kept up-to-date; and\n* notifying via callbacks after checks are evaluated.\n\n`salutem` also provides check function implementations for:\n\n* data sources; and\n* HTTP endpoints.\n\n## Install\n\nAdd the following to your `project.clj` file:\n\n```clojure\n[io.logicblocks/salutem.core \"0.1.8\"]\n```\n\n## Documentation\n\n* [API Docs](http://logicblocks.github.io/salutem)\n* [Getting Started](https://logicblocks.github.io/salutem/01-getting-started.html)\n\n## Usage\n\n```clojure\n(require '[salutem.core :as salutem])\n\n(defn database-health-check-fn\n  [context callback-fn]\n  (callback-fn\n    (salutem/unhealthy\n      {:error :connection-failed})))\n\n(defn external-service-health-check-fn\n  [context callback-fn]\n  (callback-fn\n    (salutem/healthy\n      {:latency-ms 200})))\n\n(def registry-atom\n  (atom\n    (-\u003e (salutem/empty-registry)\n      (salutem/with-check\n        (salutem/realtime-check :database\n          database-health-check-fn\n          {:salutem/timeout (salutem/duration 5 :seconds)}))\n      (salutem/with-check\n        (salutem/background-check :external-service\n          external-service-health-check-fn\n          {:salutem/time-to-re-evaluation (salutem/duration 30 :seconds)})))))\n\n(def maintainer\n  (salutem/maintain registry-atom))\n\n(salutem/resolve-checks @registry-atom)\n; =\u003e {:database\n;      {:error :connection-failed\n;       :salutem/status :unhealthy\n;       :salutem/evaluated-at #time/instant\"2021-08-18T23:39:29.234Z\"}\n;     :external-service \n;      {:latency-ms 200,\n;       :salutem/status :healthy,\n;       :salutem/evaluated-at #time/instant\"2021-08-18T23:39:10.383Z\"}}\n\n; ...5 seconds later...\n\n(salutem/resolve-checks @registry-atom)\n; =\u003e {:database\n;      {:error :connection-failed\n;       :salutem/status :unhealthy\n;       :salutem/evaluated-at #time/instant\"2021-08-18T23:39:34.234Z\"}\n;     :external-service \n;      {:latency-ms 200,\n;       :salutem/status :healthy,\n;       :salutem/evaluated-at #time/instant\"2021-08-18T23:39:10.383Z\"}}\n\n(salutem/shutdown maintainer)\n```\n\n## License\n\nCopyright \u0026copy; 2023 LogicBlocks Maintainers\n\nDistributed under the terms of the \n[MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogicblocks%2Fsalutem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogicblocks%2Fsalutem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogicblocks%2Fsalutem/lists"}