Skip to content

Commit

Permalink
Merge branch 'develop' into feature/ETCM-129-scala-point-13
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Voronov committed Jan 11, 2021
2 parents 29b6c7b + 7c517df commit ec36746
Show file tree
Hide file tree
Showing 14 changed files with 6,373 additions and 22 deletions.
15 changes: 9 additions & 6 deletions README.md
Expand Up @@ -135,12 +135,15 @@ git commit -m "Update nix-sbt sha"

#### 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
@@ -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 @@ -123,6 +125,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
@@ -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
@@ -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
@@ -0,0 +1,11 @@
apiVersion: 1

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

0 comments on commit ec36746

Please sign in to comment.