Skip to content

Basic project that can quickly bootstrap cAdvisor, prometheus, grafana along with the spring-boot app

Notifications You must be signed in to change notification settings

shubhambhattar/spring-boot-monitoring-setup

Repository files navigation

This project aims to quickly spin up a monitoring setup for a spring-boot application in local environment. It will spin up the following containers:

  • cAdvisor (for container metrics)
  • Prometheus (for monitoring)
  • Promlens (for complex Prometheus querying)
  • Grafana (for visualization)
  • vector (to collect, transform, and route all your logs and metrics)
  • spring-boot app

The spring-boot app includes the following dependencies (and no code modification apart from what comes by default from https://start.spring.io):

  • spring-boot-devtools
  • spring-boot-configuration-processor
  • lombok
  • spring-boot-starter-actuator
  • micrometer-registry-prometheus
  • spring-boot-starter-web

It also has one property defined in application.properties to expose metrics in a format Prometheus understands.

Grafana contains a dashboard which has graphs created for the metrics which are emitted by default from micrometer in the spring-boot app. This will contain metrics related to:

  • JVM:
    • Memory: Heap / NonHeap / Buffer <-> Used / Committed / Max
    • GC: Minor / Major GC Pauses with frequency
    • Threads: Thread States, Live, Daemon, Peak Threads
  • Log Events - logback level frequencies

To start the application, run the following command (replace nerdctl with docker if needed):

./mvnw clean package && nerdctl compose up --build

Different dashboards will be available once the above commands successfully runs:

About

Basic project that can quickly bootstrap cAdvisor, prometheus, grafana along with the spring-boot app

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published