Skip to content
Snippets Groups Projects
Unverified Commit b00f7526 authored by Levente Pap's avatar Levente Pap Committed by GitHub
Browse files

Run Prometheus + Grafana docker containers with goshimmer (#551)

* :chart_with_upwards_trend: Run Prometheus + grafana with goshimmer docker image

* Update docker-compose.yml

* Add grafana dirs in mounted volumes

* Update local grafana dashboard

* Update config.default.json + docker compose
parent b26c1140
Branches
Tags
No related merge requests found
...@@ -65,6 +65,9 @@ ...@@ -65,6 +65,9 @@
"numThreads": 1, "numThreads": 1,
"timeout": "1m" "timeout": "1m"
}, },
"prometheus": {
"bindAddress": "127.0.0.1:9311"
},
"webapi": { "webapi": {
"auth": { "auth": {
"password": "goshimmer", "password": "goshimmer",
......
...@@ -10,12 +10,14 @@ services: ...@@ -10,12 +10,14 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: iota_goshimmer container_name: iota_goshimmer
restart: unless-stopped restart: unless-stopped
command: >
--node.enablePlugins=prometheus
# Mount volumes: # Mount volumes:
# make sure to give read/write access to the folder ./mainnetdb (e.g., chmod -R 777 ./mainnetdb) # make sure to give read/write access to the folder ./mainnetdb (e.g., chmod -R 777 ./mainnetdb)
# optionally, you can mount a config.json into the container # optionally, you can mount a config.json into the container
volumes: volumes:
- ./mainnetdb/:/tmp/mainnetdb/:rw - ./mainnetdb/:/tmp/mainnetdb/:rw
#- ./config.json:/config.json:ro - ./config.json:/config.json:ro
# Expose ports: # Expose ports:
# gossip: - "14666:14666/tcp" # gossip: - "14666:14666/tcp"
# autopeering: - "14626:14626/udp" # autopeering: - "14626:14626/udp"
...@@ -24,5 +26,35 @@ services: ...@@ -24,5 +26,35 @@ services:
ports: ports:
- "14666:14666/tcp" - "14666:14666/tcp"
- "14626:14626/udp" - "14626:14626/udp"
#- "8080:8080/tcp" - "9311:9311/tcp" # prometheus exporter
#- "8081:8081/tcp" - "8080:8080/tcp" # webApi
- "8081:8081/tcp" # dashboard
prometheus:
network_mode: host
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
ports:
- 9090:9090
command:
- --config.file=/etc/prometheus/prometheus.yml
volumes:
- ./tools/monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
depends_on:
- goshimmer
grafana:
network_mode: host
image: grafana/grafana:latest
container_name: grafana
restart: unless-stopped
environment:
# path to provisioning definitions can only be defined as
# environment variables for grafana within docker
- GF_PATHS_PROVISIONING=/var/lib/grafana/provisioning
ports:
- 3000:3000
user: "472"
volumes:
- ./tools/monitoring/grafana:/var/lib/grafana:rw
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"editable": true, "editable": true,
"gnetId": null, "gnetId": null,
"graphTooltip": 0, "graphTooltip": 0,
"id": 2, "id": 1,
"links": [], "links": [],
"panels": [ "panels": [
{ {
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
}, },
{ {
"datasource": "Prometheus", "datasource": "Prometheus",
"description": "Version number of node software.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {}, "custom": {},
...@@ -95,21 +96,36 @@ ...@@ -95,21 +96,36 @@
}, },
{ {
"datasource": "Prometheus", "datasource": "Prometheus",
"description": "1= node is synced, 0 = node is not synced", "description": "Describes if the node is in synced state.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {}, "custom": {},
"mappings": [], "mappings": [
{
"from": "",
"id": 0,
"operator": "",
"text": "No",
"to": "",
"type": 1,
"value": "0"
},
{
"from": "",
"id": 1,
"operator": "",
"text": "Yes",
"to": "",
"type": 1,
"value": "1"
}
],
"thresholds": { "thresholds": {
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "green",
"value": null "value": null
},
{
"color": "red",
"value": 80
} }
] ]
}, },
...@@ -154,6 +170,7 @@ ...@@ -154,6 +170,7 @@
}, },
{ {
"datasource": "Prometheus", "datasource": "Prometheus",
"description": "Aggregated MPS for all message types in the communication layer.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {}, "custom": {},
...@@ -211,6 +228,7 @@ ...@@ -211,6 +228,7 @@
}, },
{ {
"datasource": "Prometheus", "datasource": "Prometheus",
"description": "Current CPU usage of the node.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {}, "custom": {},
...@@ -268,6 +286,7 @@ ...@@ -268,6 +286,7 @@
}, },
{ {
"datasource": "Prometheus", "datasource": "Prometheus",
"description": "Memory consumed by the node.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {}, "custom": {},
...@@ -321,6 +340,7 @@ ...@@ -321,6 +340,7 @@
}, },
{ {
"datasource": "Prometheus", "datasource": "Prometheus",
"description": "Size of the ledger database.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {}, "custom": {},
...@@ -626,6 +646,7 @@ ...@@ -626,6 +646,7 @@
}, },
{ {
"datasource": "Prometheus", "datasource": "Prometheus",
"description": "Number of currently connected neighbors.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {}, "custom": {},
...@@ -677,11 +698,12 @@ ...@@ -677,11 +698,12 @@
], ],
"timeFrom": null, "timeFrom": null,
"timeShift": null, "timeShift": null,
"title": "Current Neighbor Count", "title": "Current Neighbors",
"type": "stat" "type": "stat"
}, },
{ {
"datasource": "Prometheus", "datasource": "Prometheus",
"description": "Calculated for each dropped neighbor.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {}, "custom": {},
...@@ -1245,7 +1267,7 @@ ...@@ -1245,7 +1267,7 @@
}, },
"yaxes": [ "yaxes": [
{ {
"format": "decbytes", "format": "Bps",
"label": null, "label": null,
"logBase": 1, "logBase": 1,
"max": null, "max": null,
...@@ -1945,6 +1967,7 @@ ...@@ -1945,6 +1967,7 @@
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": "Prometheus", "datasource": "Prometheus",
"description": "Describes how many FPC query requests the node has received.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {} "custom": {}
...@@ -2133,7 +2156,7 @@ ...@@ -2133,7 +2156,7 @@
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": "Prometheus", "datasource": "Prometheus",
"description": "", "description": "Describes how many FPC opinions were requested from the node.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {} "custom": {}
...@@ -2347,5 +2370,5 @@ ...@@ -2347,5 +2370,5 @@
"timezone": "", "timezone": "",
"title": "GoShimmer Local Metrics", "title": "GoShimmer Local Metrics",
"uid": "kjOQZ2ZMk", "uid": "kjOQZ2ZMk",
"version": 4 "version": 5
} }
\ No newline at end of file
This diff is collapsed.
apiVersion: 1
providers:
# <string> an unique provider name. Required
- name: 'Goshimmer Local Metrics'
# <int> Org id. Default to 1
orgId: 1
# <string> name of the dashboard folder.
folder: ''
# <string> folder UID. will be automatically generated if not specified
folderUid: ''
# <string> provider type. Default to 'file'
type: file
# <bool> disable dashboard deletion
disableDeletion: false
# <bool> enable dashboard editing
editable: true
# <int> how often Grafana will scan for changed dashboards
updateIntervalSeconds: 10
# <bool> allow updating provisioned dashboards from the UI
allowUiUpdates: true
options:
# <string, required> path to dashboard files on disk. Required when using the 'file' type
path: /var/lib/grafana/dashboards
# config file version
apiVersion: 1
# list of datasources to insert/update depending
# what's available in the database
datasources:
# <string, required> name of the datasource. Required
- name: Prometheus
# <string, required> datasource type. Required
type: prometheus
# <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
access: direct
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string> custom UID which can be used to reference this datasource in other parts of the configuration, if not specified will be generated automatically
uid:
# <string> url
url: http://localhost:9090
# <string> Deprecated, use secureJsonData.password
password:
# <string> database user, if used
user:
# <string> database name, if used
database:
# <bool> enable/disable basic auth
basicAuth:
# <string> basic auth username
basicAuthUser:
# <string> Deprecated, use secureJsonData.basicAuthPassword
basicAuthPassword:
# <bool> enable/disable with credentials headers
withCredentials:
# <bool> mark as default datasource. Max one per org
isDefault:
# <map> fields that will be converted to json and stored in jsonData
jsonData:
graphiteVersion: '1.1'
tlsAuth: true
tlsAuthWithCACert: true
timeInterval: '1s'
# <string> json object of data that will be encrypted.
secureJsonData:
tlsCACert: '...'
tlsClientCert: '...'
tlsClientKey: '...'
# <string> database password, if used
password:
# <string> basic auth password
basicAuthPassword:
version: 1
# <bool> allow users to edit datasources from the UI.
editable: true
scrape_configs:
- job_name: goshimmer_local
scrape_interval: 5s
static_configs:
- targets:
# goshimmer prometheus plugin export
- 127.0.0.1:9311
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment