-
Navigate to the
docker-composesfolder. -
Run the following command to start the Docker containers:
docker compose -f .\docker-composer.yml up -d -
Wait for a minute to ensure all services are up and running.
-
Start both applications.
-
URL:
/api/v1/url -
Method:
POST -
Consumes:
application/json -
Produces:
application/json -
Request Body:
{ "longUrl": "https://example.com" } -
Response Body:
{ "longUrl": "https://example.com", "shortUrl": "http://short.url/abc123" }
- URL:
/api/v1/url/{shortUrl} - Method:
GET - Path Variable:
shortUrl(e.g.,abc123) - Response: Redirects to the original long URL
Now you can:
- View distributed traces in the Zipkin UI: http://localhost:9411
- Monitor metrics in Prometheus: http://localhost:9090
- Create custom dashboards in Grafana: http://localhost:3000
- Note: When adding Prometheus as a data source in Grafana, use the URL:
http://host.docker.internal:9090
- Note: When adding Prometheus as a data source in Grafana, use the URL:
Prometheus is configured to scrape metrics from the Spring Boot application and itself. The configuration is defined in the prometheus.yml file.