{"id":23235766,"url":"https://github.com/billmeyer/spring-petclinic-microservices-splunk","last_synced_at":"2025-07-04T01:04:54.149Z","repository":{"id":89566483,"uuid":"362617899","full_name":"billmeyer/spring-petclinic-microservices-splunk","owner":"billmeyer","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-29T16:48:59.000Z","size":894,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T20:35:43.029Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/billmeyer.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":"2021-04-28T22:03:00.000Z","updated_at":"2021-04-29T16:49:01.000Z","dependencies_parsed_at":"2023-06-29T03:01:16.059Z","dependency_job_id":null,"html_url":"https://github.com/billmeyer/spring-petclinic-microservices-splunk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/billmeyer/spring-petclinic-microservices-splunk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billmeyer%2Fspring-petclinic-microservices-splunk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billmeyer%2Fspring-petclinic-microservices-splunk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billmeyer%2Fspring-petclinic-microservices-splunk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billmeyer%2Fspring-petclinic-microservices-splunk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/billmeyer","download_url":"https://codeload.github.com/billmeyer/spring-petclinic-microservices-splunk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billmeyer%2Fspring-petclinic-microservices-splunk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263427306,"owners_count":23464842,"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","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":"2024-12-19T03:29:30.459Z","updated_at":"2025-07-04T01:04:54.090Z","avatar_url":"https://github.com/billmeyer.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring PetClinic \n\n[![Build Status](https://travis-ci.org/spring-petclinic/spring-petclinic-microservices.svg?branch=master)](https://travis-ci.org/spring-petclinic/spring-petclinic-microservices/) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nDistributed version of the Sample Application built with Spring Cloud. Instrumented with the Splunk distribution of the OpenTelemetry Java Instrumentation and accompanied by OpenTelemetry Collector.\n\n\nThis microservices branch was initially derived from [AngularJS version](https://github.com/spring-petclinic/spring-petclinic-angular1) to demonstrate how to split sample Spring application into [microservices](http://www.martinfowler.com/articles/microservices.html).\nTo achieve that goal we use Spring Cloud Gateway, Spring Cloud Circuit Breaker, Spring Cloud Config, Spring Cloud Sleuth, Resilience4j, Micrometer \nand the Eureka Service Discovery from the [Spring Cloud Netflix](https://github.com/spring-cloud/spring-cloud-netflix) technology stack.\n\n## One-time Setup\n\n1. To get started, down the Splunk OpenTelemetry Java Agent with:\n\n    ```bash\n    $ ./download.sh\n    ```\n\n2. Create a file named `env-file.txt` at the top of the project directory with the following contents:\n\n    ```\n    SPLUNK_ACCESS_TOKEN=\u003cyour token\u003e\n    SPLUNK_REALM=\u003cyour realm\u003e\n    ```\n\nReplacing `\u003cyour token\u003e` with an *Access Token* from your account.  Likewise, replace `\u003cyour realm\u003e` with the realm your account was created in.\n\n## Starting the application with instrumentation\n\n1. Start by building the application using the supplied build script:\n\n    ```\n    ./build.sh\n    ```\n\n2. Once complete, start the application using the run script:\n\n    ```\n    ./run.sh\n    ```\n\n    After starting services it takes a while for API Gateway to be in sync with service registry, so don't be scared of initial Spring Cloud Gateway timeouts. You can track services availability using Eureka dashboard available by default at http://localhost:8761.\n\n    If everything goes well, you can access the following services at given location:\n   \n    * Discovery Server - http://localhost:8761\n    * Config Server - http://localhost:8888\n    * AngularJS frontend (API Gateway) - http://localhost:8080\n    * Customers, Vets and Visits Services - random port, check Eureka Dashboard \n    * Otel Collector - http://localhost:55680\n    * Tracing Server (Zipkin) - http://localhost:9411/zipkin/ (we use [openzipkin](https://github.com/openzipkin/zipkin/tree/master/zipkin-server))\n    * Admin Server (Spring Boot Admin) - http://localhost:9090\n    * Prometheus - http://localhost:9091\n\n*NOTE: Under MacOSX or Windows, make sure that the Docker VM has enough memory to run the microservices. The default settings are usually not enough and make the `docker-compose up` painfully slow.*\n\n## Understanding the Spring Petclinic application\n\n[See the presentation of the Spring Petclinic Framework version](http://fr.slideshare.net/AntoineRey/spring-framework-petclinic-sample-application)\n\n[A blog bost introducing the Spring Petclinic Microsevices](http://javaetmoi.com/2018/10/architecture-microservices-avec-spring-cloud/) (french language)\n\nYou can then access petclinic here: http://localhost:8080/\n\n![Spring Petclinic Microservices screenshot](docs/application-screenshot.png)\n\n**Architecture diagram of the Spring Petclinic Microservices**\n\n![Spring Petclinic Microservices architecture](docs/microservices-architecture-diagram.jpg)\n\n## In case you find a bug/suggested improvement for Spring Petclinic Microservices\n\nOur issue tracker is available here: https://github.com/spring-petclinic/spring-petclinic-microservices/issues\n\n## Database configuration\n\nIn its default configuration, Petclinic uses an in-memory database (HSQLDB) which gets populated at startup with data.\n\n## Custom metrics monitoring\n\nPrometheus is included in the `docker-compose.yml` configuration, and the public facing applications have been instrumented with [MicroMeter](https://micrometer.io) to collect JVM and custom business metrics.\n\nA JMeter load testing script is available to stress the application and generate metrics: [petclinic_test_plan.jmx](spring-petclinic-api-gateway/src/test/jmeter/petclinic_test_plan.jmx)\n\n### Using Prometheus\n\n* Prometheus can be accessed from your local machine at http://localhost:9091\n\n### Custom metrics\nSpring Boot registers a lot number of core metrics: JVM, CPU, Tomcat, Logback... \nThe Spring Boot auto-configuration enables the instrumentation of requests handled by Spring MVC.\nAll those three REST controllers `OwnerResource`, `PetResource` and `VisitResource` have been instrumented by the `@Timed` Micrometer annotation at class level.\n\n* `customers-service` application has the following custom metrics enabled:\n  * @Timed: `petclinic.owner`\n  * @Timed: `petclinic.pet`\n* `visits-service` application has the following custom metrics enabled:\n  * @Timed: `petclinic.visit`\n\n## Looking for something in particular?\n\n| Spring Cloud components         | Resources  |\n|---------------------------------|------------|\n| Configuration server            | [Config server properties](spring-petclinic-config-server/src/main/resources/application.yml) and [Configuration repository] |\n| Service Discovery               | [Eureka server](spring-petclinic-discovery-server) and [Service discovery client](spring-petclinic-vets-service/src/main/java/org/springframework/samples/petclinic/vets/VetsServiceApplication.java) |\n| API Gateway                     | [Spring Cloud Gateway starter](spring-petclinic-api-gateway/pom.xml) and [Routing configuration](/spring-petclinic-api-gateway/src/main/resources/application.yml) |\n| Docker Compose                  | [Spring Boot with Docker guide](https://spring.io/guides/gs/spring-boot-docker/) and [docker-compose file](docker-compose.yml) |\n| Circuit Breaker                 | [Resilience4j fallback method](spring-petclinic-api-gateway/src/main/java/org/springframework/samples/petclinic/api/boundary/web/ApiGatewayController.java)  |\n| Prometheus Monitoring | [Micrometer implementation](https://micrometer.io/), [Spring Boot Actuator Production Ready Metrics] |\n\n Front-end module  | Files |\n|-------------------|-------|\n| Node and NPM      | [The frontend-maven-plugin plugin downloads/installs Node and NPM locally then runs Bower and Gulp](spring-petclinic-ui/pom.xml)  |\n| Bower             | [JavaScript libraries are defined by the manifest file bower.json](spring-petclinic-ui/bower.json)  |\n| Gulp              | [Tasks automated by Gulp: minify CSS and JS, generate CSS from LESS, copy other static resources](spring-petclinic-ui/gulpfile.js)  |\n| Angular JS        | [app.js, controllers and templates](spring-petclinic-ui/src/scripts/)  |\n\n## Interesting Spring Petclinic forks\n\nThe Spring Petclinic master branch in the main [spring-projects](https://github.com/spring-projects/spring-petclinic)\nGitHub org is the \"canonical\" implementation, currently based on Spring Boot and Thymeleaf.\n\nThis [spring-petclinic-microservices](https://github.com/spring-petclinic/spring-petclinic-microservices/) project is one of the [several forks](https://spring-petclinic.github.io/docs/forks.html) \nhosted in a special GitHub org: [spring-petclinic](https://github.com/spring-petclinic).\nIf you have a special interest in a different technology stack\nthat could be used to implement the Pet Clinic then please join the community there.\n\n\n# Contributing\n\nThe [issue tracker](https://github.com/spring-petclinic/spring-petclinic-microservices/issues) is the preferred channel for bug reports, features requests and submitting pull requests.\n\nFor pull requests, editor preferences are available in the [editor config](.editorconfig) for easy use in common text editors. Read more and download plugins at \u003chttp://editorconfig.org\u003e.\n\n\n[Configuration repository]: https://github.com/spring-petclinic/spring-petclinic-microservices-config\n[Spring Boot Actuator Production Ready Metrics]: https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-metrics.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillmeyer%2Fspring-petclinic-microservices-splunk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbillmeyer%2Fspring-petclinic-microservices-splunk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillmeyer%2Fspring-petclinic-microservices-splunk/lists"}