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

https://github.com/ololx/spring-boot-metrics-instances

This project presents instances of how to collect and display statistics on the use of micro-services and their logs, as well as distributed request tracing.
https://github.com/ololx/spring-boot-metrics-instances

example-project grafana-example grafana-sample loki-example loki-sample prometheus-example prometheus-sample promtail-example promtail-sample sample-project spring-boot-example spring-boot-metrics-example spring-boot-metrics-sample spring-boot-sample

Last synced: 3 months ago
JSON representation

This project presents instances of how to collect and display statistics on the use of micro-services and their logs, as well as distributed request tracing.

Awesome Lists containing this project

README

          

# spring-boot-metrics-instances

This project presents instances of how to collect and display statistics on the use of micro-services and their logs, as well as distributed request tracing.

[![status](https://img.shields.io/badge/status-active-active?style=flat-square)](BADGES_GUIDE.md#status) [![last commit](https://img.shields.io/badge/last_commit-August_23,_2021-informational?style=flat-square)](BADGES_GUIDE.md#commit-date)

[![license](https://img.shields.io/badge/license-UNLICENCE-informational?style=flat-square)](LICENSE)

---

[![Java](https://img.shields.io/badge/Java-ED8B00?style=for-the-badge&logo=java&logoColor=white)](#built-with) [![Spring Boot](https://img.shields.io/badge/Spring_Boot-6DB33F?style=for-the-badge&logo=spring-boot&logoColor=white)](#built-with) [![Swagger](https://img.shields.io/badge/Swagger-2C3239?style=for-the-badge&logo=swagger&labelColor=2C3239)](#built-with)

[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white)](#built-with)

[![RabbitMQ](https://img.shields.io/badge/rabbitmq-%23FF6600.svg?&style=for-the-badge&logo=rabbitmq&logoColor=white)](#built-with)

[![Grafana](https://img.shields.io/badge/Grafana-F2F4F9?style=for-the-badge&logo=grafana&logoColor=orange&labelColor=F2F4F9)](#built-with) [![Prometheus](https://img.shields.io/badge/Prometheus-000000?style=for-the-badge&logo=prometheus&labelColor=000000)](#built-with) [![Loki](https://img.shields.io/badge/grafana_loki-F2F4F9?style=for-the-badge&labelColor=2C3239&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYA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Ho4xkanmEdOWAe6TzX5nvWKF3qLw/paPcVJ9dy2k+QcwSqi1TVcffFwksJvN3s8BTGzGUkNzuQXn6N67pgdtah1ezvmLl64c3nhwffFsJ5PwjzuBdjiJLaD9aWGZdulD+yvOXPy/X38Dy2M5JJe3rzYAAAAASUVORK5CYII=)](#built-with) [![Jaeger](https://img.shields.io/badge/Jaeger-F2F4F9?style=for-the-badge&labelColor=F2F4F9&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAACFNJREFUSA2lVntQVNcZ/8659+7dXfbBG0RE3iFBDPKwHWItqGmMTmP+yGLM2Eq0mnZG27TJpJ20TtY26YzGUac2NhoDSoytaNOJqVWrBmpiqzzEB4gICiwrLg9ZYJ937+P0nFUo29p2pv1mvj3ffuec73e+1zkX4L8TstnzdWG2ATd9eXPzXoH972s+tKbj0sE4JhNCEBv/J7LVAWe3Az9986ZfZYv5dtD11Nfomd7RdHBFX2NtO5OdzQcrui/UJjK5rq4u4nBM9x9pOtCGnf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vcjjbhpNSgCLxxd82byiQXHYe7C0jmO801t/XQ+DEjHKVBor38vWwNdakHF+gY2MZ3Ky+18ef1b2ukfbYn23byWq4ZkVfEOSZ2XLrGvtogrbPq+h/KkY1NT/N69G6gX/6By+87ox8vK5+QWlGZS7dSckd4V6SL6JCcxnmTGx3wxucNOnzl2f7Ibyk4vbuo+A2GRZ2OYmBCBzL649p+6nnribFMmrboXEc/HUW5KXb16m+v4ySdV/8TrBPAIjWQSaOoKGt7fdt3qqHpgLtLWQ13EEEbOzs4WQVGW0hOtpC1VRkcD5tEf6Sfa1lAo1G91OlUas1BGaup8+vo/gzTtJi0dPwqFOlEgMN7t9bqp1YhnKAJl2p8wYHl5Oe/s6ZmrIfQYIohVlY421rVuR89n/7SWFdf/RX8HamKwc2H8JvoAAAAASUVORK5CYII=)](#built-with) [![Promtail](https://img.shields.io/badge/Promtail-F2F4F9?style=for-the-badge&labelColor=F2F4F9)](#built-with)

[![Docker](https://img.shields.io/badge/Docker-2CA5E0?style=for-the-badge&logo=docker&logoColor=white)](#built-with)

## 📇 Table of Contents

- [About](#about)
- [Features](#feature)
- [Getting Started](#getting-started)
- [Built With](#built-with)
- [Authors](#authors)
- [Licensing](#licensing)

## 📖 About

This is a collection of small and focused instances, each of which covers a single and defined approach to Java application development and an required technologies implementation. This project presents instances of how to collect and display statistics on the use of micro-services and their logs, as well as distributed request tracing. A strong focus of these instances is the different cases of the `micro-services distributed tracing`, `micro-services logs collecting` and `analytics and interactive visualization web application` realizations.

## 🎚 Features

The project with instances of:

- the `micro-services distributed tracing` technology implementation via `Jaeger`
- the `micro-services logs collecting` technology implementation via `loki` & `promtail`
- the `analytics and interactive visualization web application` technology implementation via `Graphana` & `Prometheus`

### Changelog

- For more information on a releases, a features and a changes, please read the [changelog](CHANGELOG.md) notes.

## đŸšĻ Getting Started

These instructions allow to get a copy of this project and run it on a local machine.

### Prerequisites

Before using it, make sure that follows software are installed on the local machine:

- **Docker Compose** - tool for defining and running multi-container `Docker` applications.

If any of the listed software is not installed, then it can be installed by instruction as described below.

#### Docker Compose

- Install Docker Compose according to instructions from an [official](https://docs.docker.com/compose/install/) source.

### Installing

In order to install it is quite simple to clone or download this repository.

### Cloning

For the cloning this repository to a local machine, just use the follows link:

```http
https://github.com/ololx/spring-boot-metrics-instances
```

### Using

To run and try out each instance is required to:
1. Launch containers with services

To do the launching some incstance, go to the instance directory and execute the following command:

```bash
docker-compose up --build
```

2. Open sevices GUI

When all services will start, you could open your browser and go to the services endpoints:

- Graphana endpont (user `admin`, password `admin`):
```http
http://localhost:3000/
```

- Jaeger endpont:
```http
http://localhost:16686/
```

- Prometheus endpont:
```http
http://localhost:9090/
```

- PostgreSQL Exporter endpont:
```http
http://localhost:9187/
```

- Some Api Client endpoint (with specs):
```http
http://localhost:8082/swagger-ui.html
```

- Some Api endpoint (with specs):
```http
http://localhost:8081/swagger-ui.html
```

3. [OPTIONAL] Send requests to instance service. Because the `some-api-executing` ervice will do the requests to `some-api-client` automatically every 30 seconds.

### Launching

To do the launching some incstance, go to the instance directory and execute the following command:

```bash
docker-compose up --build
```

## 🛠 Built With

- **JDK** - the java development kit;
- **Maven** - the dependency management;
- **PostgreSQL 10.6** - the database management system;
- **Swagger** - documentation and form generator;
- **Docker Compose** - tool for defining and running multi-container `Docker` applications.

## ÂŠī¸ Authors

* **Alexander A. Kropotin** - *Initial work* - [ololx](https://github.com/ololx).

## 🔏 Licensing

This project is unlicensed - see the [lisence](LICENSE) document for details.