{"id":49815489,"url":"https://github.com/dropwizard/dropwizard-health","last_synced_at":"2026-05-29T21:00:51.821Z","repository":{"id":35617983,"uuid":"185870780","full_name":"dropwizard/dropwizard-health","owner":"dropwizard","description":"Provides a health check implementation that performs ongoing monitoring of an application's dependencies and includes an endpoint that can be called by a load balancer to determine if the application is healthy and thus able to receive traffic.","archived":true,"fork":false,"pushed_at":"2023-05-05T07:04:26.000Z","size":279,"stargazers_count":18,"open_issues_count":5,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-06T06:18:52.326Z","etag":null,"topics":["dropwizard","health-check","health-checks","healthcheck","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dropwizard.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}},"created_at":"2019-05-09T20:58:23.000Z","updated_at":"2024-03-06T08:44:43.000Z","dependencies_parsed_at":"2023-01-16T01:16:09.853Z","dependency_job_id":null,"html_url":"https://github.com/dropwizard/dropwizard-health","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/dropwizard/dropwizard-health","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-health","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-health/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-health/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-health/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dropwizard","download_url":"https://codeload.github.com/dropwizard/dropwizard-health/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-health/sbom","scorecard":{"id":356807,"data":{"date":"2025-08-11","repo":{"name":"github.com/dropwizard/dropwizard-health","commit":"08d83c3843522300fb0063ca406bad65a75e561a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: .mvn/wrapper/maven-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/3 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/dropwizard/dropwizard-health/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/dropwizard/dropwizard-health/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/dropwizard/dropwizard-health/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/dropwizard/dropwizard-health/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/dropwizard/dropwizard-health/release.yml/master?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":10,"reason":"SAST tool detected","details":["Info: SAST configuration detected: Sonar","Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"30 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-vmq6-5m68-f53m","Warn: Project is vulnerable to: GHSA-6v67-2wr5-gvf4","Warn: Project is vulnerable to: GHSA-pr98-23f8-jwxv","Warn: Project is vulnerable to: GHSA-h46c-h94j-95f3","Warn: Project is vulnerable to: GHSA-wf8f-6423-gfxg","Warn: Project is vulnerable to: GHSA-3x8x-79m2-3w2w","Warn: Project is vulnerable to: GHSA-57j2-w4cx-62h2","Warn: Project is vulnerable to: GHSA-jjjh-jjxp-wpff","Warn: Project is vulnerable to: GHSA-rgv9-q543-rqg4","Warn: Project is vulnerable to: GHSA-5mg8-w23w-74h3","Warn: Project is vulnerable to: GHSA-7g45-4rm6-3mm3","Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v","Warn: Project is vulnerable to: GHSA-hmr7-m48g-48f6","Warn: Project is vulnerable to: GHSA-qh8g-58pp-2wxh","Warn: Project is vulnerable to: GHSA-g8m5-722r-8whq","Warn: Project is vulnerable to: GHSA-p26g-97m4-6q7c","Warn: Project is vulnerable to: GHSA-q4rv-gq96-w7c5","Warn: Project is vulnerable to: GHSA-qw69-rqj8-6qw8","Warn: Project is vulnerable to: GHSA-3gh6-v5v9-6v9j","Warn: Project is vulnerable to: GHSA-j26w-f9rq-mr2q","Warn: Project is vulnerable to: GHSA-c43q-5hpj-4crv","Warn: Project is vulnerable to: GHSA-7v6m-28jr-rg84","Warn: Project is vulnerable to: GHSA-x83m-pf6f-pf9g","Warn: Project is vulnerable to: GHSA-3mc7-4q67-w48m","Warn: Project is vulnerable to: GHSA-98wm-3w3q-mw94","Warn: Project is vulnerable to: GHSA-9w3m-gqgf-c4p9","Warn: Project is vulnerable to: GHSA-c4r9-r8fh-9vj2","Warn: Project is vulnerable to: GHSA-hhhw-99gj-p3c3","Warn: Project is vulnerable to: GHSA-mjmj-j48q-9wg2","Warn: Project is vulnerable to: GHSA-w37g-rhq8-7m4j"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T09:47:49.133Z","repository_id":35617983,"created_at":"2025-08-18T09:47:49.133Z","updated_at":"2025-08-18T09:47:49.133Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33670211,"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-05-29T02:00:06.066Z","response_time":107,"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":["dropwizard","health-check","health-checks","healthcheck","java"],"created_at":"2026-05-13T06:00:43.977Z","updated_at":"2026-05-29T21:00:51.815Z","avatar_url":"https://github.com/dropwizard.png","language":"Java","funding_links":[],"categories":["容错组件"],"sub_categories":["微服务框架"],"readme":"\u003e ## ℹ️ dropwizard-health has been promoted to a core module and is part of the Dropwizard main project since [Dropwizard 2.1.0](https://github.com/dropwizard/dropwizard/releases/tag/v2.1.0).\n\n# dropwizard-health\n[![Build](https://github.com/dropwizard/dropwizard-health/workflows/Build/badge.svg)](https://github.com/dropwizard/dropwizard-health/actions?query=workflow%3ABuild)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dropwizard_dropwizard-health\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=dropwizard_dropwizard-health)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.dropwizard.modules/dropwizard-health/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.dropwizard.modules/dropwizard-health/)\n\nProvides a health check implementation that performs ongoing monitoring of an application's dependencies and includes\nan endpoint that can be called by a load balancer to determine if the application is healthy and thus able to receive\ntraffic.\n\n## Dropwizard Version Support Matrix\ndropwizard-health | Dropwizard v1.3.x  | Dropwizard v2.0.x\n----------------- | ------------------ | ------------------\nv1.3.x            | :white_check_mark: | :white_check_mark:\nv1.4.x            | :white_check_mark: | :white_check_mark:\nv1.5.x            | :white_check_mark: | :white_check_mark:\nv1.6.x            | :white_check_mark: | :white_check_mark:\nv1.7.x            | :white_check_mark: | :white_check_mark:\n\n\n## Usage\nAdd dependency on library.\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.dropwizard.modules\u003c/groupId\u003e\n  \u003cartifactId\u003edropwizard-health\u003c/artifactId\u003e\n  \u003cversion\u003e${dropwizard-health.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Health Checks\nIn your application's `Configuration` class, add a `HealthConfiguration` object:\n```java\npublic class ExampleConfiguration extends Configuration {\n    ...\n\n    @Valid\n    @NotNull\n    @JsonProperty(\"health\")\n    private HealthConfiguration healthConfiguration = new HealthConfiguration();\n\n    public HealthConfiguration getHealthConfiguration() {\n        return healthConfiguration;\n    }\n\n    public void setHealthConfiguration(final HealthConfiguration healthConfiguration) {\n        this.healthConfiguration = healthConfiguration;\n    }\n}\n```\n\nAdd a `HealthCheckBundle` to the `Bootstrap` object in your `initialize` method:\n```java\nbootstrap.addBundle(new HealthCheckBundle\u003cExampleConfiguration\u003e() {\n    @Override\n    protected HealthConfiguration getHealthConfiguration(final ExampleConfiguration configuration) {\n        return configuration.getHealthConfiguration();\n    }\n});\n```\n\nConfigure health checks for any dependencies your application has, such as any databases, caches, queues, etc.\nDropwizard modules that support connecting to a dependency will often register a health check automatically.\n\nDefine the following health check configurations in your `config.yml` file:\n```yaml\nhealth:\n  delayedShutdownHandlerEnabled: true\n  shutdownWaitPeriod: 30s\n  healthChecks:\n    - name: UserDatabase\n      critical: true\n    - name: UserNotificationTopic\n      critical: false\n      schedule:\n        checkInterval: 2500ms\n        downtimeInterval: 10s\n        failureAttempts: 2\n        successAttempts: 1\n    - name: UserCache\n      critical: false\n```\n\n## Configuration Reference\n### Health Configuration\nName | Default | Description\n---- | ------- | -----------\ndelayedShutdownHandlerEnabled | true | Flag indicating whether to delay shutdown to allow already processing requests to complete.\nshutdownWaitPeriod | 15 seconds | Amount of time to delay shutdown by to allow already processing requests to complete. Only applicable if `delayedShutdownHandlerEnabled` is true.\nhealthCheckUrlPaths | \\[\"/health-check\"\\] | URLs to expose the app's health check on.\nhealthChecks | [] | A list of configured health checks. See the [Health Check Configuration section](#health-check-configuration) for more details.\ninitialOverallState | true | Flag indicating whether the overall health state of the application should start as healthy or unhealthy. A value of `true` indicates an initial state of healthy while a value of `false` indicates an initial state of unhealthy.\nservlet | default health servlet | The health servlet that is used to generate health check responses. See the [Default Health Servlet section](#default-health-servlet) for more details.\n\n### Health Check Configuration\nName | Default | Description\n---- | ------- | -----------\nname | (none) | The name of this health check. This must be unique.\ntype | ready | The type of this health check. This is either `alive` or `ready`. See the [Application Status section](#application-status) for more details.\ncritical | false | Flag indicating whether this dependency is critical to determine the health of the application. If `true` and this dependency is unhealthy, the application will also be marked as unhealthy.\ninitialState | true | Flag indicating the initial state to use for this health check. A value of `true` indicates an initial state of healthy while a value of `false` indicates an initial state of unhealthy.\nschedule | (none) | The schedule that this health check will be run on. See the [Schedule section](#schedule) for more details.\n\n### Schedule\nName | Default | Description\n---- | ------- | -----------\ncheckInterval | 5 seconds | The interval on which to perform a health check for this dependency while the dependency is in a healthy state.\ndowntimeInterval | 30 seconds | The interval on which to perform a health check for this dependency while the dependency is in an unhealthy state.\ninitialDelay | the value of `checkInterval` | The initial delay to use when first scheduling the health check.\nfailureAttempts | 3 | The threshold of consecutive failed attempts needed to mark a dependency as unhealthy (from a healthy state).\nsuccessAttempts | 2 | The threshold of consecutive successful attempts needed to mark a dependency as healthy (from an unhealthy state).\n\n### Default Health Servlet\nName | Default | Description\n---- | ------- | -----------\ncacheControlEnabled | true | Flag controlling whether a `Cache-Control` header will be included in the health check response or not. Set header value using `cacheControlValue`.\ncacheControlValue | \"no-store\" | The value to be set in the `Cache-Control` header in the health check response. Only used if `cacheControlEnabled` is set to `true`.\ncontentType | application/json | The value of the `Content-Type` header in the health check response.\nhealthyValue | {\"status\":\"healthy\"} | The value of the body of the health check response when the application is healthy.\nunhealthyValue | {\"status\":\"unhealthy\"} | The value of the body of the health check response when the application is unhealthy.\n\n## Application Status\nThere are two types of status that are supported: Alive and Ready\n\n### alive\nAn `alive` status indicates the application is operating normally and does not need to be restarted to recover from a\nstuck state.\n\nLong-running applications can eventually reach a broken state and cannot recover except by being restarted\n(e.g. deadlocked threads).\n\n### ready\nA `ready` status indicates the application is ready to serve traffic.\n\nApplications can temporarily be unable to serve traffic due to a variety of reasons, for example, an application might\nneed to build/compute large caches during startup or can critically depend on an external service.\n\n### Query Application Status\nhttps://\u003chostname\u003e:\u003cport\u003e/health-check?type=\u003ctype\u003e (replace `\u003ctype\u003e` with `ready` or `alive`; defaults to `ready`)\n\nHealthy\n```bash\n$ curl -v https://\u003chostname\u003e:\u003cport\u003e/health-check?type=ready\n\u003e GET /health-check?type=ready HTTP/1.1\n...\n\u003e\n\u003c HTTP/1.1 200 OK\n\u003c Content-Type: application/json\n\u003c Cache-Control: no-store\n...\n\u003c\n{\"status\": \"healthy\"}\n```\n\nNot Healthy\n```bash\n$ curl -v https://\u003chostname\u003e:\u003cport\u003e/health-check?type=ready\n\u003e GET /health-check?type=ready HTTP/1.1\n...\n\u003e\n\u003c HTTP/1.1 503 Service Unavailable\n\u003c Content-Type: application/json\n\u003c Cache-Control: no-store\n...\n\u003c\n{\"status\": \"unhealthy\"}\n```\n\n## HTTP and TCP Health Checks\nShould your service have any dependencies that it needs to perform health checks against that expose either an HTTP or TCP health check interface,\nyou can use the `HttpHealthCheck` or `TcpHealthCheck` classes to do so easily.\n\n### Usage\nYou will need to register your health check(s) in your `Application` class `run()` method.\n\n#### HTTP\n```java\n@Override\npublic void run(final AppConfiguration configuration, final Environment environment) {\n    ...\n    environment.healthChecks().register(\"http-service-dependency\", new HttpHealthCheck(\"http://some-http-dependency.com:8080/health-check\"));\n}\n```\n#### TCP\n```java\n@Override\npublic void run(final AppConfiguration configuration, final Environment environment) {\n    ...\n    environment.healthChecks().register(\"tcp-service-dependency\", new TcpHealthCheck(\"some-tcp-dependency.com\", 443));\n}\n```\n\n## Composite Health Checks\nYou might find you need a health check that is a composite of more than one other health check. For instance, consider the case where you have\na database and a cache, and if only one of those two are unhealthy, your service can still fulfill a subset of functionality, and thus\nshould not necessarily be marked down.\n\nLet's say that you have a database health check registered under the name `UserDatabase` and a cache health check under the name `UserCache`.\nBelow, see an example of how you might create a health check that is a composite of these two checks. Note that there does not exist a\n`CompositeHealthCheck` class currently, but it might be a nice addition to this library.\n\n#### Example Composite Health Check\n```java\nprivate void registerCompositeHealthCheck(final HealthCheckRegistry healthChecks) {\n    final HealthCheck databaseCheck = healthChecks.getHealthCheck(\"UserDatabase\");\n    final HealthCheck cacheCheck = healthChecks.getHealthCheck(\"UserCache\");\n\n    final UserHealthCheck userHealthCheck = new UserHealthCheck(databaseCheck, cacheCheck);\n    healthChecks.register(\"UserComposite\", userHealthCheck);\n}\n```\n\n#### Example Composite Health Check YAML\n```yaml\nhealth:\n  delayedShutdownHandlerEnabled: true\n  shutdownWaitPeriod: 30s\n  healthChecks:\n    - name: UserComposite\n      critical: true\n```\n\n## Future improvements:\n* Hooks for health status change events.\n* The ability to expose health check data to other modules (for instance, an Admin page may want to show historical health check results).\n* More out-of-the-box generally useful health checks implementations, like file-system health checks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropwizard%2Fdropwizard-health","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdropwizard%2Fdropwizard-health","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropwizard%2Fdropwizard-health/lists"}