{"id":25274701,"url":"https://github.com/tugayesilyurt/springboot3-haproxy-java21-prometheus-grafana-virtual-thread","last_synced_at":"2025-08-12T12:34:37.087Z","repository":{"id":198749629,"uuid":"701462988","full_name":"tugayesilyurt/springboot3-haproxy-java21-prometheus-grafana-virtual-thread","owner":"tugayesilyurt","description":"Spring Boot 3 -HAProxy-Prometheus-Grafana-Java 21 ( Virtual Thread and Platform Thread and String Templates )","archived":false,"fork":false,"pushed_at":"2023-10-09T06:32:31.000Z","size":435,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T04:13:53.433Z","etag":null,"topics":["grafana","haproxy","prometheus","spring-boot-3","virtual-thread"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tugayesilyurt.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-06T17:28:11.000Z","updated_at":"2025-01-08T22:27:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"5d12b194-246b-4799-9520-6783ac0d3755","html_url":"https://github.com/tugayesilyurt/springboot3-haproxy-java21-prometheus-grafana-virtual-thread","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.5,"last_synced_commit":"6d52b73fb9174550deb767b4d66e7405ab2388be"},"previous_names":["tugayesilyurt/springboot3-haproxy-java21-prometheus-grafana-virtual-thread"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tugayesilyurt/springboot3-haproxy-java21-prometheus-grafana-virtual-thread","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugayesilyurt%2Fspringboot3-haproxy-java21-prometheus-grafana-virtual-thread","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugayesilyurt%2Fspringboot3-haproxy-java21-prometheus-grafana-virtual-thread/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugayesilyurt%2Fspringboot3-haproxy-java21-prometheus-grafana-virtual-thread/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugayesilyurt%2Fspringboot3-haproxy-java21-prometheus-grafana-virtual-thread/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tugayesilyurt","download_url":"https://codeload.github.com/tugayesilyurt/springboot3-haproxy-java21-prometheus-grafana-virtual-thread/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugayesilyurt%2Fspringboot3-haproxy-java21-prometheus-grafana-virtual-thread/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270061627,"owners_count":24520333,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"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":["grafana","haproxy","prometheus","spring-boot-3","virtual-thread"],"created_at":"2025-02-12T14:33:09.350Z","updated_at":"2025-08-12T12:34:37.049Z","avatar_url":"https://github.com/tugayesilyurt.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project Name\n\nSpring Boot 3 -HAProxy-Prometheus-Grafana-Java 21 ( Virtual Thread and Platform Thread and String Template )\n\n## Tech Stack\n\n- Java 21\n- Spring Boot 3\n- HAProxy\n- Prometheus\n- Grafana\n- Docker Compose\n\n## Installation\n\n```shell\ndocker-compose up -d\n```\n## Medium\n\n[Read the full article on Medium](https://medium.com/@htyesilyurt/spring-boot-3-haproxy-prometheus-grafana-java-21-virtual-thread-and-platform-thread-and-string-9e62a121730e)\n\n## HAProxy UI\n\n![HAProxy UI](https://github.com/tugayesilyurt/springboot3-haproxy-java21-prometheus-grafana-virtual-thread/blob/main/assets/haproxyui.png)\n\n## Service Call Count in Grafana\n\n![Grafana UI](https://github.com/tugayesilyurt/springboot3-haproxy-java21-prometheus-grafana-virtual-thread/blob/main/assets/grafana.png)\n\n\n- `haproxy.cfg`\n\n```\nglobal\n    maxconn     4000\n\ndefaults\n    mode http\n    timeout connect 5000\n    timeout client 50000\n    timeout server 50000\n\nfrontend stats\n    bind *:4444\n    mode http\n    stats uri /\n    stats show-legends\n    stats enable\n    stats auth tugay:tugay\n\nfrontend backend_service_listen\n    bind *:1905\n    default_backend backend_service\n\nbackend backend_service\n    mode http\n    option httpclose\n    balance roundrobin\n    server virtual-thread host.docker.internal:8091 check port 8091\n    server platform-thread host.docker.internal:8090 check port 8090\n```\n\n- `Java 21 String Templates`\n\n```java\n\tvar threadName = Thread.currentThread().toString();\n\n        var response = STR.\"\"\"\n                {\n                   \"thradName\" :\\{threadName}\n                   \"port\" : \"8091\"\n                   \"applicationName\" : \"virtual-thread\"\n                }\n                \"\"\";\n```\n\n- `Enable Virtual thread in Spring Boot Configuration`\n\n```java\n\t@Bean\n\tTomcatProtocolHandlerCustomizer\u003c?\u003e protocolHandlerVirtualThreadExecutorCustomizer() {\n\t\treturn protocolHandler -\u003e {\n\t\t\tprotocolHandler.setExecutor(Executors.newVirtualThreadPerTaskExecutor());\n\t\t};\n\t}\n```\n\nApache Benchmark provides various options to control the benchmarking process.\n\nExamples\n\nPerform 100 requests to a website with a concurrency of 100:\n\n```shell\n# Platform Thread\nab -n 100 -c 100 http://localhost:1905/v1/api\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftugayesilyurt%2Fspringboot3-haproxy-java21-prometheus-grafana-virtual-thread","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftugayesilyurt%2Fspringboot3-haproxy-java21-prometheus-grafana-virtual-thread","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftugayesilyurt%2Fspringboot3-haproxy-java21-prometheus-grafana-virtual-thread/lists"}