--- title: "Petclinic Service" generated_by: documentor-agent generated_at: "2026-06-08T16:14:03+00:00" human_edited: false source_entity: "Component/default/petclinic" source_repo: "https://gitea.kyndemo.live/validate/petclinic" --- ## Overview The Petclinic service is a Spring Boot application designed to manage veterinary clinic operations, including scheduling appointments, managing pet records, and handling customer information. It serves as a foundational component of the broader Petclinic system, providing essential functionality for veterinary platforms. This service is built using Java 17 and leverages Spring Boot for rapid development and deployment. It supports multiple database configurations, including in-memory H2, MySQL, and PostgreSQL, making it adaptable to various environments. Observability is integrated via OpenTelemetry, enabling detailed monitoring and performance analysis. Petclinic plays a critical role in the system by ensuring reliable and scalable management of veterinary clinic data, while also serving as a demonstration of modern application development practices. ## Repository | Field | Value | |----------------|-----------------------------------------------------------------------------------------------------------------| | **Source Repo**| [Petclinic Repository](https://gitea.kyndemo.live/validate/petclinic) | | **Branch** | `main` | | **ArgoCD App** | [petclinic](https://argocd.kyndemo.live/applications/petclinic) | | **Namespace** | `demo-apps` | ## Architecture The Petclinic service is a Spring Boot application deployed via ArgoCD in the `demo-apps` namespace. It integrates OpenTelemetry for observability and supports multiple database configurations, including H2, MySQL, and PostgreSQL. The deployment process involves continuous synchronization from the `main` branch of the source repository. Key architectural components: - **Spring Boot Framework**: Provides the core application structure and dependency management. - **Database Configurations**: Supports H2 (default), MySQL, and PostgreSQL, with profiles for switching between them. - **OpenTelemetry Integration**: Enables tracing, metrics, and logging for detailed observability. - **ArgoCD Deployment**: Ensures continuous delivery and synchronization of application updates. ## Configuration | Configuration Option | Description | |-------------------------------|-------------------------------------------------------------------------------------------------| | `spring.profiles.active` | Sets the active profile for database configuration (`mysql`, `postgres`, or default `h2`). | | `MYSQL_USER` | MySQL username for database authentication. | | `MYSQL_PASSWORD` | MySQL password for database authentication. | | `POSTGRES_USER` | PostgreSQL username for database authentication. | | `POSTGRES_PASSWORD` | PostgreSQL password for database authentication. | ## Operations ### Running Locally 1. Clone the repository: ```bash git clone https://gitea.kyndemo.live/validate/petclinic.git cd petclinic ``` 2. Start the application: - Using Maven: ```bash ./mvnw spring-boot:run ``` - Using Gradle: ```bash ./gradlew bootRun ``` 3. Access the application at [http://localhost:8080](http://localhost:8080). ### Container Deployment 1. Build the container image: ```bash ./mvnw spring-boot:build-image ``` 2. Run the container: ```bash docker run -p 8080:8080 docker.io/library/spring-petclinic:latest ``` ### Rollback 1. Open the [ArgoCD UI](https://argocd.kyndemo.live/applications/petclinic). 2. Click **History and Rollback**. 3. Select the desired revision and click **Rollback**. Alternatively, revert the commit in Git and push — ArgoCD will auto-sync the rollback. ## Observability This service is configured with OpenTelemetry instrumentation. Metrics, traces, and logs are exported to the OTel Collector and visualized in Grafana. - **Grafana Dashboard**: [Petclinic Observability](https://grafana.kyndemo.live/d/otel-app-observability-v2/opentelemetry-application-observability?orgId=1&var-service=petclinic) - **Alerting**: Alerts are configured via Grafana and can be filtered by `app=petclinic`. _Additional observability details are available in the platform observability documentation._ ## Dependencies - `component:default/argocd-service` - `resource:default/k6-operator` - `resource:default/otel-collector` - `resource:default/veterinary-platform` ## Links - [Live Application](https://petclinic.kyndemo.live) - [Repository](https://gitea.kyndemo.live/validate/petclinic) - [ArgoCD App](https://argocd.kyndemo.live/applications/petclinic) - [Grafana Dashboard](https://grafana.kyndemo.live/d/otel-app-observability-v2/opentelemetry-application-observability?orgId=1&var-service=petclinic)