Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/daggerok/boot-micrometer-prometheus-grafana-monitoring

Monitor spring-boot apps with actuator, micrometer, prometheus and grafana...
https://github.com/daggerok/boot-micrometer-prometheus-grafana-monitoring

grafana micrometer postgres postgres-database postgresql postgresql-database prometheus prometheus-metrics r2dbc r2dbc-migrations r2dbc-postgres r2dbc-postgresql spring-boot-actuator

Last synced: 24 days ago
JSON representation

Monitor spring-boot apps with actuator, micrometer, prometheus and grafana...

Awesome Lists containing this project

README

        

# spring-boot micrometer prometheus grafana [![CI](https://github.com/daggerok/boot-micrometer-prometheus-grafana-monitoring/workflows/CI/badge.svg)](https://github.com/daggerok/boot-micrometer-prometheus-grafana-monitoring/actions?query=workflow%3ACI)
Monitor spring-boot apps with actuator, micrometer, prometheus and grafana...

## build and run system

```bash
./mvnw -f docker-compose -P postgres-start
./mvnw -f backend package jib:dockerBuild
./mvnw -f docker-compose -P backend-start,prometheus-start,grafana-start
```

## examine some rest calls (monitoring test data)

```bash
curl -sS 0:8080 | jq '.'
http :8080 name=ololo
http :8080 name=trololo
http :8080
```

## grafana

### setup

* open http://127.0.0.1:3000/
* login as `admin` / `admin`
* set a new password and confirm

### configure prometheus datasource

* click on `Add data source`
* select `prometheus`
* set URL: `http://prometheus:9090`
* set Query timeout: `5s`
* finally, click button: `Save & Test`
* verify success: `Data source is working`
* click `Dashboards` tab
* create one for `http_server_requests_seconds_count` query

## cleanup

```bash
./mvnw -f docker-compose -P down
```

## resources

* [YouTube: Kubernetes Master Class: Monitoring and Alerting with Prometheus & Grafana](https://www.youtube.com/watch?v=OQojdJL48S4&feature=youtu.be&t=1750)
* https://dzone.com/articles/monitoring-using-spring-boot-20-prometheus-and-gra
* [Docker Hub Prometheus](https://hub.docker.com/r/prom/prometheus/)
* [Spring Boot Actuator Metrics](https://docs.spring.io/spring-metrics/docs/current/public/prometheus)
* [R2DBC migrations (require java >= 11 and spring-boot >= 2.3.0.M3)](https://github.com/nkonev/r2dbc-migrate)
* [R2DBC migrations example](https://github.com/nkonev/r2dbc-migrate-example/blob/master/pom.xml)
* [YouTube: Production-Ready Spring Boot Applications](https://www.youtube.com/watch?v=SSu7V-S5yec&feature=youtu.be&t=2132s)
* https://www.callicoder.com/spring-boot-actuator-metrics-monitoring-dashboard-prometheus-grafana/