Skip to content

API monitoring project using Spring Boot, Grafana, Prometheus, Loki, and Promtail for real-time metrics and log visualization.

License

Notifications You must be signed in to change notification settings

Joao-Lucas-de-Oliveira-Lima/spring-boot-observability

Repository files navigation

API Monitoring with Grafana, Loki, Promtail, and Prometheus

Java Spring Prometheus Grafana Docker

Table of Contents


About

This project demonstrates how to monitor monolithic APIs using Grafana, Loki, Promtail, and Prometheus.

Dashboard Previews

Micrometer Example 1 Micrometer Example 2
Loki Example Spring Observability

Dashboards Used:

To use these dashboards, import them into Grafana and assign the required data sources (Prometheus/Loki).


Getting Started

Prerequisites

Ensure the following software is installed:

  • Docker Desktop

Installation

  1. Start all services using Docker Compose:
    docker compose up -d

Usage

After starting the services, access them via these URLs:

API Log Endpoints

Test logging by triggering these endpoints:

  • GET /api/v1/logs/info - Generates an info log
  • GET /api/v1/logs/error - Generates an error log
  • GET /api/v1/logs/warning - Generates a warning log

Logs are sent to Loki and visualized in Grafana.

How It Works

Spring Boot Actuator generates the required metrics and exposes them via endpoints using HATEOAS links. Micrometer acts as a facade for Prometheus, which collects these metrics. Grafana then visualizes them. Logs are sent to Loki via Promtail for further analysis.


About

API monitoring project using Spring Boot, Grafana, Prometheus, Loki, and Promtail for real-time metrics and log visualization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published