Skip to content

[ETCM-295] akka monitoring #879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,15 @@ To fix this, update the version of Nix you are using, or in a pinch:

#### Locally build & run monitoring client

```
# Build monitoring client docker image
projectRoot $ docker build -f ./docker/monitoring-client.Dockerfile -t mantis-monitoring-client ./docker/
# Run monitoring client in http://localhost:9090
projectRoot $ docker run --network=host mantis-monitoring-client
```
Setup a dashboard using Prometheus and Grafana, popular choice of monitoring stack.
Before that you need enable the metrics in the file “metrics.conf”, setting mantis.metrics.enabled=true.

You can start Docker Compose initializing Prometheus and Grafana with a preconfigured dashboard.
For build the monitoring, you need to run the following script: `./docker/monitoring/build.sh`
This script prepares a docker image of mantis. And as a precondition you need to have installed docker-compose and sbt.

We can see the dashboard called "Mantis" at URL: http://localhost:3000 using user and password: admin and admin


### TLS setup

Expand Down
5 changes: 4 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
enablePlugins(JDKPackagerPlugin, JavaAppPackaging, SolidityPlugin)
enablePlugins(JDKPackagerPlugin, JavaAppPackaging, SolidityPlugin, JavaAgent)

javaAgents += "io.kamon" % "kanela-agent" % "1.0.6"

import scala.sys.process.Process
import NativePackagerHelper._
Expand Down Expand Up @@ -127,6 +129,7 @@ lazy val node = {
Dependencies.logging,
Dependencies.apacheCommons,
Dependencies.micrometer,
Dependencies.kamon,
Dependencies.prometheus,
Dependencies.cli,
Dependencies.dependencies
Expand Down
2 changes: 0 additions & 2 deletions docker/monitoring-client.Dockerfile

This file was deleted.

8 changes: 8 additions & 0 deletions docker/monitoring/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

HERE=$(dirname $0)

cd $HERE/../../
sbt 'set version := "latest"' docker:publishLocal

docker-compose -f docker/monitoring/docker-compose.yml up -d
54 changes: 54 additions & 0 deletions docker/monitoring/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: '3.1'

volumes:
prometheus_data: {}
grafana_data: {}

networks:
mantis-net:

services:

prometheus:
image: prom/prometheus:v2.23.0
volumes:
- ./prometheus/:/etc/prometheus/
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
- 9090:9090
links:
- mantis:mantis
depends_on:
- mantis
networks:
- mantis-net
restart: always

mantis:
image: mantis:latest
ports:
- 8546:8546
- 13798:13798
- 9095:9095
networks:
- mantis-net
restart: always

grafana:
image: grafana/grafana:7.3.6
depends_on:
- prometheus
ports:
- 3000:3000
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning/:/etc/grafana/provisioning/
networks:
- mantis-net
restart: always

11 changes: 11 additions & 0 deletions docker/monitoring/grafana/provisioning/dashboards/dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: 1

providers:
- name: 'Prometheus'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
options:
path: /etc/grafana/provisioning/dashboards
Loading