{"id":24522133,"url":"https://github.com/helpdeveloper/java-observability-metrics","last_synced_at":"2025-08-28T19:08:22.991Z","repository":{"id":133292860,"uuid":"594462017","full_name":"helpdeveloper/java-observability-metrics","owner":"helpdeveloper","description":"[Java][Metrics] Observability metrics stack with Java (Quarkus and Spring Boot) + Micrometer + Prometheus + Grafana","archived":false,"fork":false,"pushed_at":"2023-01-28T17:33:27.000Z","size":523,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T07:48:17.237Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/helpdeveloper.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-28T16:20:02.000Z","updated_at":"2024-10-07T18:11:34.000Z","dependencies_parsed_at":"2023-04-28T08:11:35.508Z","dependency_job_id":null,"html_url":"https://github.com/helpdeveloper/java-observability-metrics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/helpdeveloper/java-observability-metrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpdeveloper%2Fjava-observability-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpdeveloper%2Fjava-observability-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpdeveloper%2Fjava-observability-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpdeveloper%2Fjava-observability-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/helpdeveloper","download_url":"https://codeload.github.com/helpdeveloper/java-observability-metrics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpdeveloper%2Fjava-observability-metrics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272541805,"owners_count":24952466,"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-28T02:00:10.768Z","response_time":74,"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":[],"created_at":"2025-01-22T03:18:19.323Z","updated_at":"2025-08-28T19:08:22.982Z","avatar_url":"https://github.com/helpdeveloper.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Observability: Monitoring your application from metrics\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./.images/logo.png\" height=\"150\"\u003e\n\u003c/p\u003e\nThis repository contains sample Spring Boot and Quarkus application that exposes metrics to Prometheus and Grafana. \n\nThe goal of this project was to showcase how to instrumentation your application and collect and monitor application's metrics running inside docker compose.\n\nMore detail in this article written in PT-BR: [Observabilidade: Monitorando sua aplicação a partir de métricas](https://medium.com/luizalabs/observabilidade-monitorando-sua-aplicacao-a-partir-de-metricas-bd1b2d0ba1f8)\n\n# Architecture\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./.images/arch.png\" height=\"200\"\u003e\n\u003c/p\u003e\n\nThe project contains the following components:\n\n - [Spring Boot Web Application](./java-spring-metrics): To export metrics\n - [Quarkus Web Application](./java-quarkus-metrics): To export metrics\n - [Prometheus](https://prometheus.io/): To collect metrics\n - [Grafana](https://grafana.com/): To data visualization\n\n## Tecnologies:\n\n - Java 17\n - Spring Boot 3\n - Quarkus 2.15\n - Docker Compose\n - Prometheus 2.26\n - Grafana 9.3\n\n# Execution\n\nWe have two docker-compose files to separate the stack and applications\n\n- [docker/docker-compose-stack.yml](docker/docker-compose-stack.yml)\n- [docker/docker-compose-apps.yml](docker/docker-compose-apps.yml)\n\nTo facilitate the execution of this example, we created a Makefile script with the following instructions:\n\n- **build**: Execute build `mvnw clean install` on projects \n- **install**: Build the projects `Dockerfile`\n- **run-stack**: Execute only `docker-compose-stack.yml`\n- **run-apps**: Execute only `docker-compose-apps.yml`\n- **run-all**: Execute all steps above\n- **stop-stack**: Stop stack\n- **stop-apps**:  Stop apps\n- **stop-all**:  Stop stack and apps\n\nExecute the desired instruction: \n\n```shellscript\n$make {desired-instruction}\n```\n\n### Prometheus UI\n\n- Running at: http://localhost:9090\n- Config files: [docker/prometheus](./docker/prometheus/)\n\n### Grafana UI\n\n- Running at: http://localhost:3000\n- Config files: [docker/grafana](./docker/grafana/)\n\n### Test the apps métrics\n\nSpring Boot: http://localhost:8081\nQuarkus: http://localhost:8080\n\nBoth have a `/hello` endpoint with a Query Param `name` which will be metrified. The custom metrics generated are:\n\n- `hello_get_method_timer`: Time metric about method duration\n- `hello_get_do_process_timer`: Time metric about `doProcess` method duration\n- `hello_get_name_length_limit`: Count metric increases when the Query Param `name` exceed the length limit (currently 10)\n\nCall that endpoint:\n\n```shelscript\n$curl 'http://localhost:{port}/hello?name={any name}'\n```\n\n# Monitoring\n\nWe have Grafana as monitoring in conjunction with Prometheus listening to the metrics of the applications, a default dashbord was created that automatically goes up in Grafana; ([dashboards location](./docker/grafana/provisioning/dashboards/))\n\n- JVM (Micrometer) Dashboard\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./.images/dash-1.png\" height=\"300\"\u003e\n\u003c/p\u003e\n\n- Application Metrics Dashboard\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./.images/dash-2.png\" height=\"197\"\u003e\n\u003c/p\u003e\n\n# Contribute\n\nPull Requests are welcome. For important changes, open an 'issue' first to discuss what you would like to change. Be sure to update tests as appropriate.\n\n# Developer\n\n**Guilherme Biff Zarelli**\n\nBlog/Site - https://helpdev.com.br\n\nLinkedIn - https://linkedin.com/in/gbzarelli/\n\nGitHub - https://github.com/gbzarelli\n\nMedium - https://medium.com/@guilherme.zarelli\n\nEmail - gbzarelli@helpdev.com.br\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelpdeveloper%2Fjava-observability-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelpdeveloper%2Fjava-observability-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelpdeveloper%2Fjava-observability-metrics/lists"}