docs: generate README for component/default/petclinic [documentor-agent]
This commit is contained in:
@@ -1,57 +1,60 @@
|
|||||||
---
|
---
|
||||||
title: "Petclinic Service"
|
title: "Petclinic Service"
|
||||||
generated_by: documentor-agent
|
generated_by: documentor-agent
|
||||||
generated_at: "2026-05-13T10:51:17+00:00"
|
generated_at: "2026-06-08T16:14:03+00:00"
|
||||||
human_edited: false
|
human_edited: false
|
||||||
source_entity: "Component/default/petclinic"
|
source_entity: "Component/default/petclinic"
|
||||||
source_repo: "https://gitea.kyndemo.live/validate/petclinic-demo-andrej2"
|
source_repo: "https://gitea.kyndemo.live/validate/petclinic"
|
||||||
---
|
---
|
||||||
|
|
||||||
# Petclinic Service
|
|
||||||
|
|
||||||
> A Spring Boot application for managing veterinary clinics, including scheduling, customer management, and pet records.
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
The Petclinic service is a Spring Boot application designed to manage veterinary clinic operations. It provides features such as scheduling appointments, managing customer and pet records, and viewing clinic information. Originally developed as a sample application by the Spring community, this service has been adapted and deployed using Backstage templates for enhanced observability and deployment automation.
|
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.
|
||||||
|
|
||||||
The application supports multiple database configurations, including in-memory H2, MySQL, and PostgreSQL, and can be run locally or deployed in containerized environments. It is instrumented with OpenTelemetry for comprehensive observability and integrates with Grafana for monitoring and alerting.
|
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
|
## Repository
|
||||||
|
|
||||||
| Field | Value |
|
| Field | Value |
|
||||||
|---|---|
|
|----------------|-----------------------------------------------------------------------------------------------------------------|
|
||||||
| Source Repo | [Petclinic Repository](https://gitea.kyndemo.live/validate/petclinic-demo-andrej2) |
|
| **Source Repo**| [Petclinic Repository](https://gitea.kyndemo.live/validate/petclinic) |
|
||||||
| Branch | main |
|
| **Branch** | `main` |
|
||||||
| ArgoCD App | petclinic-demo-andrej2 |
|
| **ArgoCD App** | [petclinic](https://argocd.kyndemo.live/applications/petclinic) |
|
||||||
| Namespace | demo-apps |
|
| **Namespace** | `demo-apps` |
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
- The service is scaffolded using the Backstage Application Migration Factory template.
|
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.
|
||||||
- Deployment is managed via ArgoCD, which continuously syncs the `main` branch to the `demo-apps` namespace.
|
|
||||||
- OpenTelemetry auto-instrumentation is applied via Kustomize overlays, enabling detailed traces, metrics, and logs.
|
Key architectural components:
|
||||||
- The application supports multiple database configurations, including H2 (default), MySQL, and PostgreSQL, with profiles for each database type.
|
- **Spring Boot Framework**: Provides the core application structure and dependency management.
|
||||||
- Observability is integrated with Grafana, providing dashboards and alerts for monitoring service health and performance.
|
- **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.
|
||||||
|
|
||||||
|
<!-- TODO: FILL IN -->
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
| Configuration | Description |
|
| Configuration Option | Description |
|
||||||
|---|---|
|
|-------------------------------|-------------------------------------------------------------------------------------------------|
|
||||||
| `spring.profiles.active` | Sets the active Spring profile (`mysql`, `postgres`, or default `h2`). |
|
| `spring.profiles.active` | Sets the active profile for database configuration (`mysql`, `postgres`, or default `h2`). |
|
||||||
| Database URLs | `jdbc:h2:mem:<uuid>` for H2, or Docker-based MySQL/PostgreSQL configurations. |
|
| `MYSQL_USER` | MySQL username for database authentication. |
|
||||||
| OpenTelemetry Endpoint | `http://otel-collector.monitoring.svc.cluster.local:4318` |
|
| `MYSQL_PASSWORD` | MySQL password for database authentication. |
|
||||||
|
| `POSTGRES_USER` | PostgreSQL username for database authentication. |
|
||||||
|
| `POSTGRES_PASSWORD` | PostgreSQL password for database authentication. |
|
||||||
|
|
||||||
## Operations
|
## Operations
|
||||||
|
|
||||||
### Local Development
|
### Running Locally
|
||||||
|
|
||||||
1. Clone the repository:
|
1. Clone the repository:
|
||||||
```bash
|
```bash
|
||||||
git clone https://gitea.kyndemo.live/validate/petclinic-demo-andrej2.git
|
git clone https://gitea.kyndemo.live/validate/petclinic.git
|
||||||
cd petclinic-demo-andrej2
|
cd petclinic
|
||||||
```
|
```
|
||||||
2. Run the application:
|
2. Start the application:
|
||||||
- Using Maven:
|
- Using Maven:
|
||||||
```bash
|
```bash
|
||||||
./mvnw spring-boot:run
|
./mvnw spring-boot:run
|
||||||
@@ -62,29 +65,42 @@ The application supports multiple database configurations, including in-memory H
|
|||||||
```
|
```
|
||||||
3. Access the application at [http://localhost:8080](http://localhost:8080).
|
3. Access the application at [http://localhost:8080](http://localhost:8080).
|
||||||
|
|
||||||
### Deployment
|
### Container Deployment
|
||||||
|
1. Build the container image:
|
||||||
Changes pushed to the `main` branch are automatically synced to the `demo-apps` namespace by ArgoCD. To roll back, use the ArgoCD UI or revert the commit in Git.
|
```bash
|
||||||
|
./mvnw spring-boot:build-image
|
||||||
### Database Setup
|
```
|
||||||
|
2. Run the container:
|
||||||
- Default: In-memory H2 database.
|
```bash
|
||||||
- Persistent options: MySQL or PostgreSQL, with Docker or `docker-compose` configurations.
|
docker run -p 8080:8080 docker.io/library/spring-petclinic:latest
|
||||||
|
```
|
||||||
|
|
||||||
### Rollback
|
### 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**.
|
||||||
|
|
||||||
1. Open the [ArgoCD UI](https://argocd.kyndemo.live/applications/petclinic-demo-andrej2).
|
Alternatively, revert the commit in Git and push — ArgoCD will auto-sync the rollback.
|
||||||
2. Select **History and Rollback**.
|
|
||||||
3. Choose the desired revision and click **Rollback**.
|
|
||||||
|
|
||||||
## Observability
|
## Observability
|
||||||
|
|
||||||
- **Grafana Dashboard**: [View Dashboard](https://grafana.kyndemo.live/d/otel-app-observability-v2/opentelemetry-application-observability?orgId=1&var-service=petclinic)
|
This service is configured with OpenTelemetry instrumentation. Metrics, traces, and logs are exported to the OTel Collector and visualized in Grafana.
|
||||||
- **Alerts**: Configured via Grafana, filter by `app=petclinic`.
|
|
||||||
- OpenTelemetry instrumentation is enabled for traces, metrics, and logs.
|
- **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
|
## Dependencies
|
||||||
|
|
||||||
- `component:default/argocd-service`
|
- `component:default/argocd-service`
|
||||||
- `resource:default/k6-operator`
|
- `resource:default/k6-operator`
|
||||||
- `resource:default/otel-collector`
|
- `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)
|
||||||
Reference in New Issue
Block a user