{"id":21867229,"url":"https://github.com/logchange/hofund","last_synced_at":"2026-01-18T21:04:06.999Z","repository":{"id":56797699,"uuid":"497699456","full_name":"logchange/hofund","owner":"logchange","description":"🗡️💥 hofund is a tool set to monitor applications, connections and discover current state of components of the system 💥🗡️","archived":false,"fork":false,"pushed_at":"2026-01-12T07:28:59.000Z","size":2117,"stargazers_count":56,"open_issues_count":6,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-12T17:37:14.785Z","etag":null,"topics":["connections","discovery","grafana","hofund","metrics","micrometer","monitoring","prometheus","spring-boot","tool"],"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/logchange.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-05-29T20:14:37.000Z","updated_at":"2025-12-02T18:00:57.000Z","dependencies_parsed_at":"2024-06-26T07:28:10.194Z","dependency_job_id":"66878560-410b-417c-a493-9154d84d4828","html_url":"https://github.com/logchange/hofund","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/logchange/hofund","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logchange%2Fhofund","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logchange%2Fhofund/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logchange%2Fhofund/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logchange%2Fhofund/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logchange","download_url":"https://codeload.github.com/logchange/hofund/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logchange%2Fhofund/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28550498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T20:59:07.572Z","status":"ssl_error","status_checked_at":"2026-01-18T20:59:02.799Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["connections","discovery","grafana","hofund","metrics","micrometer","monitoring","prometheus","spring-boot","tool"],"created_at":"2024-11-28T05:08:45.222Z","updated_at":"2026-01-18T21:04:06.993Z","avatar_url":"https://github.com/logchange.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗡️💥 hofund 💥🗡️\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/logchange/hofund/graphs/contributors\" alt=\"Contributors\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/contributors/logchange/hofund\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/logchange/hofund/pulse\" alt=\"Activity\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/commit-activity/m/logchange/hofund\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://search.maven.org/search?q=g:%22dev.logchange.hofund%22%20AND%20a:%22hofund-spring-boot-starter%22\" alt=\"Maven Central\"\u003e\n        \u003cimg src=\"https://img.shields.io/maven-central/v/dev.logchange.hofund/hofund-spring-boot-starter.svg?label=Maven%20Central\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/logchange/hofund\"\u003e\n        \u003cimg src=\"https://codecov.io/gh/logchange/hofund/graph/badge.svg?token=NPARS712A6\" alt=\"codecov\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/logchange/hofund/raw/master/hofund.gif\" /\u003e\n\u003c/div\u003e\n\n# Introduction\n\nHofund is a tool set to monitor applications, connections and discover current state of components of the system.\nExposed metric are gathered by prometheus and provides information about system health.\n\n## Project name and pronunciation\n\n[pronunciation in Old Norse](https://forvo.com/word/h%C7%ABfu%C3%B0/) also you can pronunce it as`ho` `fund`\n\n```\nHǫfuð (\"man-head,\" Norwegian hoved, Danish hoved, Swedish huvud and Icelandic höfuð) \nis the sword of Heimdallr.\n\n\"Where’s the sword? That sword is the key to opening the Bifrost.\" ― Hela\n\nHofund, often simply referred as the Bifrost Sword, was an Asgardian sword used \nby Heimdall and, during his exile, Skurge. \nIt also served as a key to activate the switch that opens the Bifrost Bridge.\n```\n\n## Compatibility\n\n|        Version         |     SpringBoot Version      |    Java Version    |\n|:----------------------:|:---------------------------:|:------------------:|\n|       **3.X.X**        |       from **4.0.0**        | 17 (hofund-core 8) |\n| **2.X.X (deprecated)** | from **3.3.0** to **3.5.8** | 17 (hofund-core 8) |\n| **1.0.X (deprecated)** | from **2.2.0** to **3.2.X** |         8          |\n\n## Requirements\n\nYou can check following requirements by running `mvn dependency:tree`, but if you are using `spring-boot` in version at\nleast `2.2.0` everything should be alright.\n\nYour project has to contain:\n\n- spring-framework in version at least 5.2.12.RELEASE\n- spring-boot in version at least 2.2.0\n- micrometer-io in version at least 1.3.0\n- slf4j in version at least 1.7.28\n\n# Usage\n\n## SpringBoot based projects\n\n### 1. Add to your pom.xml:\n\n```xml\n\u003cproject\u003e\n   ...\n   \u003cdependencies\u003e\n      ...\n       \u003cdependency\u003e\n           \u003cgroupId\u003edev.logchange.hofund\u003c/groupId\u003e\n           \u003cartifactId\u003ehofund-spring-boot-starter\u003c/artifactId\u003e\n           \u003cversion\u003e3.0.0\u003c/version\u003e\n       \u003c/dependency\u003e\n      ...\n   \u003c/dependencies\u003e\n   \n   \u003cbuild\u003e\n       ...\n       \u003cplugins\u003e\n          ...\n         \u003cgroupId\u003eio.github.git-commit-id\u003c/groupId\u003e\n         \u003cartifactId\u003egit-commit-id-maven-plugin\u003c/artifactId\u003e\n         \u003cversion\u003e9.0.2\u003c/version\u003e \n         \u003c!-- \n         For older version of java (f.e. 8) see https://github.com/git-commit-id/git-commit-id-maven-plugin \n          --\u003e\n         \u003cexecutions\u003e\n           \u003cexecution\u003e\n             \u003cid\u003eget-the-git-infos\u003c/id\u003e\n             \u003cgoals\u003e\n               \u003cgoal\u003erevision\u003c/goal\u003e\n             \u003c/goals\u003e\n             \u003cphase\u003einitialize\u003c/phase\u003e\n           \u003c/execution\u003e\n         \u003c/executions\u003e\n         \u003cconfiguration\u003e\n           \u003cgenerateGitPropertiesFile\u003etrue\u003c/generateGitPropertiesFile\u003e\n           \u003cfailOnNoGitDirectory\u003efalse\u003c/failOnNoGitDirectory\u003e\n           \u003cinjectAllReactorProjects\u003etrue\u003c/injectAllReactorProjects\u003e\n         \u003c/configuration\u003e\n          ...\n       \u003c/plugins\u003e\n       ...\n   \u003c/build\u003e\n   ...\n\u003c/project\u003e\n```\n\n### 2. Check if your project already contains SpringBoot Actuator with Micrometer or add it:\n\n```xml\n\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n        \u003cartifactId\u003espring-boot-starter-actuator\u003c/artifactId\u003e\n    \u003c/dependency\u003e\n\n    \u003cdependency\u003e\n        \u003cgroupId\u003eio.micrometer\u003c/groupId\u003e\n        \u003cartifactId\u003emicrometer-registry-prometheus\u003c/artifactId\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nAnd your application should have the following configuration:\n\n```properties\nmanagement.endpoints.web.exposure.include=prometheus\n```\n\nor\n\n```yaml\nmanagement:\n  endpoints:\n    web:\n      exposure:\n        include: \"prometheus\"\n```\n\nTo define basic information about our application in hofund metric we need some configuration.\nFor maven project add to your `application.properties` following entries, but you can define it as you wish:\n\n```properties\nhofund.info.application.name=@project.name@\nhofund.info.application.version=@project.version@\n```\n\nor\n\n```yaml\nhofund:\n  info:\n    application:\n      name: @project.name@\n      version: @project.version@\n```\n\nYou can also override custom values for `GitInfo` metrics\n```properties\nhofund.git-info.commit.id=someid  # default value is equal to git.commit.id property from git.properties file generated by git-commit-id-maven-plugin\nhofund.git-info.commit.id-abbrev=someAbbrevId # default value is equal to git.commit.id.abbrev\nhofund.git-info.dirty=true # default value is equal to git.dirty\nhofund.git-info.branch=feature-1 # default value is equal to git.branch\nhofund.git-info.build.host=someHost # default value is equal to git.build.host\nhofund.git-info.build.time=11:12:13T11-11-2023 # default value is equal to git.build.time\n```\n\n\n\n### 3. Now you can start your application and verify exposed prometheus metric:\n\n```text\n# HELP hofund_info Basic information about application\n# TYPE hofund_info gauge\nhofund_info{application_name=\"cart\",application_version=\"1.0.4-SNAPSHOT\",id=\"cart\",} 1.0\n# HELP hofund_connection Current status of given connection\n# TYPE hofund_connection gauge\nhofund_connection{id=\"cart-cart_database\",source=\"cart\",target=\"cart_database\",type=\"database\",} 1.0\n# HELP hofund_git_info Basic information about application based on git\n# TYPE hofund_git_info gauge\nhofund_git_info{branch=\"master\",build_host=\"DESKTOP-AAAAA\",build_time=\"2023-02-19T11:22:34+0100\",commit_id=\"0d32d0f\",dirty=\"true\",} 1.0\n```\n\n### 4. Testing connections\n\nYou can define your own `HofundConnectionsProvider` but if you want to test HTTP connection the easiest way\nis to configure `SimpleHofundHttpConnection` or extend `AbstractHofundBasicHttpConnection`. If your project is based on spring you can extend it like below:\n\n```java\npackage dev.logchange.hofund.testapp.stats.health;\nimport dev.logchange.hofund.connection.SimpleHofundHttpConnection;\nimport org.springframework.beans.factory.annotation.Value;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Bean;\n\n@Configuration\npublic class SimpleHofundHttpConnectionConfiguration {\n    \n    @Bean \n    public SimpleHofundHttpConnection paymentApiSimpleHofundHttpConnection() {\n        return new SimpleHofundHttpConnection(\"payment-api\", \"http://host.docker.internal:18083/actuator/health/info\");\n    }\n\n    @Bean\n    public SimpleHofundHttpConnection carApiSimpleHofundHttpConnection() {\n        return new SimpleHofundHttpConnection(\"car-api\", \"http://host.docker.internal:18084/actuator/health/info\");\n    }\n\n    @Bean\n    public SimpleHofundHttpConnection cartApiSimpleHofundHttpConnection() {\n        return new SimpleHofundHttpConnection(\"cart-api\", \"http://host.docker.internal:18085/actuator/health/info\").withRequiredVersion(\"1.0.1\"); // you can also define a required version of service\n    }\n}\n\n\n```\n\n```java\n\npackage dev.logchange.hofund.testapp.stats.health;\n\nimport dev.logchange.hofund.connection.AbstractHofundBasicHttpConnection;\nimport org.springframework.beans.factory.annotation.Value;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class PaymentsHealthCheck extends AbstractHofundBasicHttpConnection {\n\n\n    @Value(\"${hofund.connection.payment.target:payment}\")\n    private String target;\n\n    @Value(\"${hofund.connection.payment.url:http://host.docker.internal:18083/}\")\n    private String basicUrl;\n\n    @Value(\"${hofund.connection.payment.url.suffix:actuator/health/info}\")\n    private String urlSuffix;\n\n    @Override\n    protected String getTarget() {\n        return target;\n    }\n\n    @Override\n    protected String getUrl() {\n        return basicUrl + urlSuffix;\n    }\n\n}\n\n```\n\nExtending `AbstractHofundBasicHttpConnection` is really simple, you only have to overrider `getTarget()`\nand `getUrl()` methods. The example above allows you to change values through spring application properties.\n\nIf you want to use f.e `POST` method, you can use `new SimpleHofundHttpConnection(\"abc\", \"some_url\", RequestMethod.POST)` or override `getRquestMethod()`.\n\nIf you don't want to test connection in some conditions, you can use `new SimpleHofundHttpConnection(\"abc\", \"some_url\", CheckingStatus.INACTIVE)` or override `getCheckingStatus()`.\nYou can also disable connection checks for specific targets using environment variables. Set environment variable named `HOFUND_CONNECTION_\u003cTARGET\u003e_DISABLED` (where `\u003cTARGET\u003e` is the uppercase value of the target name) is set to either `true` (case-insensitive) or `1`. For example, to disable connection checks for a target named \"payment-api\", you would set the environment variable `HOFUND_CONNECTION_PAYMENT_API_DISABLED=true`.\n\n### 5. Manually creating HofundConnection\n\nIf you need to create a HofundConnection manually, you must define a ConnectionFunction that will query the service you're interested in. The ConnectionFunction interface has a single method `getConnection()` that returns a HofundConnectionResult object.\n\nThe HofundConnectionResult stores:\n- The connection status (UP, DOWN, or INACTIVE)\n- The version of the connected service\n\n```java\n// Example of manually creating a HofundConnection with a custom ConnectionFunction\nnew HofundConnection(\n    \"my-service\",                                // target name\n    \"https://my-service.example.com/api\",        // URL\n    Type.HTTP,                                   // connection target type (HTTP, DATABASE, QUEUE etc.)\n    new AtomicReference\u003c\u003e(() -\u003e {                // ConnectionFunction as lambda\n        // Your custom logic to check connection and get version\n        try {\n            // Query the service and determine status\n            return HofundConnectionResult.http(Status.UP, \"1.2.3\");\n        } catch (Exception e) {\n            return HofundConnectionResult.http(Status.DOWN, HofundConnectionResult.UNKNOWN);\n        }\n    }),\n    \"Optional description\"                       // description\n);\n```\n\n#### Special values in HofundConnectionResult\n\n- **UNKNOWN** (`\"UNKNOWN\"`): Used when it was not possible to retrieve version information from the service.\n- **NOT_APPLICABLE** (`\"N/A\"`): Used when version information is not applicable for this connection type (e.g., database connections) or cannot be retrieved.\n\nFor database connections, you can use the factory method:\n```java\n// For database connections, version is automatically set to NOT_APPLICABLE\nHofundConnectionResult.db(Status.UP);\n```\n\nFor HTTP connections, you can specify the version or use HttpURLConnection:\n```java\n// Specify status and version directly\nHofundConnectionResult.http(Status.UP, \"1.2.3\");\n\n// Or let HofundConnectionResult extract version from open HttpURLConnection\nHofundConnectionResult.http(Status.UP, httpUrlConnection);\n```\n\nBy default, when using SimpleHofundHttpConnection or AbstractHofundBasicHttpConnection, hofund will attempt to retrieve version information from the target application. This requires the target application to expose version information at the provided endpoint URL in the following JSON format:\n\n```json\n{\n  \"application\": {\n    \"name\": \"AppName\",\n    \"version\": \"25.3.1-SNAPSHOT\"\n  }\n}\n```\n\n### 6. Metrics description\n\n- `hofund_info` - used to detect if application is running and what version is used. Application name and id\n  in the metric is always lowercase to make easier creation of connection graph.\n\n- `hofund_connection` - used to examine connection status to given services such as databases, rest apis etc.\n  Source is a name of the current application (lowercase) and target is a name of service that we want to connect\n  to joint with target type(also lowercase). Id is created by joining this two properties. Values:\n  - **1** - Connection is okay (UP)\n  - **0** - Connection is broken (DOWN)\n  - **-1** - Connection is not tested (INACTIVE)\n\n- `hofund_git_info` - used to inform about build and git-based information such as: commit id(short),\n  dirtiness(dirty - uncommitted changes), build machine name and time, branch. This information is useful\n  for sandbox environments, where everything is changing really fast.\n\n### 7. Currently supported spring datasource's for auto-detection and providing `hofund_connection`:\n\n    - PostgreSQL\n    - Oracle\n    - H2\n\n### 8. Connection Tabel\n\nThis simple functionality allows printing connection statuses in the logger during booting up!\n\n```txt\n+----------+--------------+----------+----------------------------------------------+---------+------------------+\n| TYPE     | NAME         | STATUS   | URL                                          | VERSION | REQUIRED VERSION |\n+----------+--------------+----------+----------------------------------------------+---------+------------------+\n| DATABASE | mydb         | UP       | jdbc:postgresql://localhost:5432/mydb        | N/A     | N/A              |\n| DATABASE | mydb2        | UP       | jdbc:mysql://localhost:3306/mydb2            | N/A     | N/A              |\n| DATABASE | orcl         | DOWN     | jdbc:oracle:thin:@localhost:1521:orcl        | N/A     | N/A              |\n| HTTP     | external-api | UP       | https://api.external-service.com             | UNKNOWN | UNKNOWN          |\n| HTTP     | internal-api | UP       | https://api.internal-service.local           | 1.0.0   | 1.0.1            |\n| HTTP     | public-API   | INACTIVE | https://api.public-service.com               | N/A     | N/A              |\n+----------+--------------+----------+----------------------------------------------+---------+------------------+\n```\n\nYou can achieve this by creating simple class:\n\n```java\n@Configuration\npublic class PrintHofundConnectionsTabel {\n\n    private static final Logger log = getLogger(PrintHofundConnectionsTabel.class);\n\n    @Bean\n    public CommandLineRunner printHofundTable(HofundConnectionsTable connectionsTable) {\n        return (_) -\u003e log.info(connectionsTable.print());\n    }\n}\n```\n\nIf you specified a required service version using SimpleHofundHttpConnection or AbstractHofundBasicHttpConnection, \nthis method may log an error indicating that the current version of the service is lower than the required version.\n\n\n# Grafana Dashboards\n\n## [hofund-node-graph.json](https://github.com/logchange/hofund/raw/master/grafana-dashboards/hofund-node-graph.json)\n\nImport [hofund-node-graph.json](https://github.com/logchange/hofund/raw/master/grafana-dashboards/hofund-node-graph.json)\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/logchange/hofund/raw/master/hofund.gif\" /\u003e\n\u003c/div\u003e\n\n### Explanation\n\n**Node colors:**\n\n- **$\\textcolor{green}{\\text{green}}$** - node is working correctly\n- **$\\textcolor{red}{\\text{red}}$** - node is down, does not respond\n- **$\\textcolor{blue}{\\text{blue}}$** - node is not tracked by hofund, it can be external service or database.\n\n**Node values (inside):**\n\n- **Upper value**: 0 or 1 - 0 node is down and 1 node is up.\n- **Lower value**: from 0 to 1 - % of node is up during week.\n\n**Node title (under node):**\n\n- **title:** name of the node.\n- **subtitle:** version (for monitored nodes) and type for external nodes.\n\n**Edge values (when hovered):**\n\n- **Upper value**: -1 or 0 or 1 - 0 connection is down and 1 connection is ok, -1 connection is inactive\n- **Lower value**: from 0 to 1 - % of connection is ok during week (without time when connection is inactive)\n\n# Contribution\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/logchange/hofund)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogchange%2Fhofund","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogchange%2Fhofund","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogchange%2Fhofund/lists"}