{"id":37028786,"url":"https://github.com/twinformatics/eureka-consul-adapter","last_synced_at":"2026-01-14T03:26:51.682Z","repository":{"id":57715001,"uuid":"117243568","full_name":"twinformatics/eureka-consul-adapter","owner":"twinformatics","description":"This project contains a Spring Boot Starter that registers HTTP endpoints on a Spring Cloud Eureka server to support Prometheus's service discovery mechanism for Consul (\u003cconsul_sd_config\u003e)","archived":true,"fork":false,"pushed_at":"2024-05-29T06:49:37.000Z","size":111,"stargazers_count":103,"open_issues_count":0,"forks_count":35,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-18T14:10:03.611Z","etag":null,"topics":["consul","eureka","prometheus","service-discovery","spring","spring-boot","spring-cloud"],"latest_commit_sha":null,"homepage":"","language":"Java","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/twinformatics.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":"2018-01-12T13:21:30.000Z","updated_at":"2024-11-21T06:38:59.000Z","dependencies_parsed_at":"2022-09-02T22:11:15.305Z","dependency_job_id":null,"html_url":"https://github.com/twinformatics/eureka-consul-adapter","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/twinformatics/eureka-consul-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twinformatics%2Feureka-consul-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twinformatics%2Feureka-consul-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twinformatics%2Feureka-consul-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twinformatics%2Feureka-consul-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twinformatics","download_url":"https://codeload.github.com/twinformatics/eureka-consul-adapter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twinformatics%2Feureka-consul-adapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","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":["consul","eureka","prometheus","service-discovery","spring","spring-boot","spring-cloud"],"created_at":"2026-01-14T03:26:50.943Z","updated_at":"2026-01-14T03:26:51.670Z","avatar_url":"https://github.com/twinformatics.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eureka Consul Adapter _(for Prometheus)_\n\nThis project contains a Spring Boot Starter that registers HTTP endpoints on a [Spring Cloud Eureka server](https://cloud.spring.io/spring-cloud-netflix/) to support [Prometheus](https://prometheus.io/)'s \n[discovery mechanism for Consul (\u003cconsul_sd_config\u003e)](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#\u003cconsul_sd_config\u003e)\n\n# Restrictions\nThis adapter _does not support everything_ of [Consul's HTTP API](https://www.consul.io/api/index.html) \nbut only those endpoints and attributes that are required for Prometheus' service discovery mechanism.\n\n# Functionality\n\nThis starter adds the following HTTP endpoints:\n- `/v1/agent/self` Returns the name of the datacenter in use (Consul API: https://www.consul.io/api/agent.html#read-configuration).\nIn Eureka, this can be set using the `archaius.deployment.datacenter` configuration property.\n- `/v1/catalog/services` Returns the names of the deployed applications (Consul API: https://www.consul.io/api/catalog.html#list-services). \nNo service tags service will be returned as Eureka does not support this concept.\n- `/v1/catalog/service/{service}` Returns all available details for the particular application \n(instances, host names, ports, meta data, service tags). No service tags service will be returned as Eureka does not support this concept.\n\n# Long-polling\n\nConsul HTTP API offers long-polling on some of its endpoints. Prometheus' client uses this functionality to get \nnotified about changes in the registry (i.e. service de-/registrations). Prometheus adds the `wait` parameter \n(e.g. http://service-registry/v1/catalog/service/MY-SERVICE?wait=30000ms ), which causes the response\nto be delayed by specified time passed or returns immediately if the service itself changes within this time range.\nThis behaviour has the benefit, that services changes are detected at once whithout have to wait the whole polling interval.\nPrometheus opens one long-polling request for each service. In order not to block one thread for each call, this adapter\nuses the async capabilities of Spring MVC. The default timeout for async requests is by default lower than 30 seconds\n and can cause `AsyncRequestTimeoutExceptions`. **To prevent this you need to set `spring.mvc.async.request-timeout` to\n at least 35000 (35 seconds)**.\n\n# Configuration options\nAdd the following options to your config (e.g. application.properties), if required.\n- **`eurekaConsulAdapter.preferHostName`**: setting this to `true` uses the hostname rather than the ip address of the service (default is `false`)\n- **`eurekaConsulAdapter.useNodeMeta`**: use the `ServiceMeta` tag for metadata instead of `NodeMeta` (details see [#16](https://github.com/twinformatics/eureka-consul-adapter/pull/16)).\n- **`eurekaConsulAdapter.nodeMetaPrefix`**: only move those meta entries that match the prefix. the prefix will be trimmed from the entry key (details see [#16](https://github.com/twinformatics/eureka-consul-adapter/pull/16)).\n\n# How to use this starter\n\nSimply add this dependency the your Spring Cloud Eureka Server (https://github.com/spring-cloud-samples/eureka):\n\n## Maven\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eat.twinformatics\u003c/groupId\u003e\n  \u003cartifactId\u003eeureka-consul-adapter\u003c/artifactId\u003e\n  \u003cversion\u003e${eureka-consul-adapter.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Gradle\n```groovy\ndependencies {\n    compile 'at.twinformatics:eureka-consul-adapter:${eureka-consul-adapter.version}'\n}\n```\n\n# Requirements\n\n- Java 1.8+\n\n### Versions 1.1.x and later\n- Spring Boot 2.1.x\n- Spring Cloud Greenwich\n\n### Versions 1.0.x and later\n- Spring Boot 2.0.x\n- Spring Cloud Finchley\n\n### Versions 0.x\n- Spring Boot 1.5.x \n- Spring Cloud Edgware\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwinformatics%2Feureka-consul-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwinformatics%2Feureka-consul-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwinformatics%2Feureka-consul-adapter/lists"}