refactor, better exporter, better dashboard

This commit is contained in:
lza_menace 2022-09-19 12:54:26 -07:00
parent 4a9f083dd7
commit 08960fd8c4
11 changed files with 5514 additions and 682 deletions

View file

@ -1,30 +1,46 @@
version: '3'
version: "3.7"
volumes:
grafana:
prometheus:
x-log-config: &log-config
logging:
driver: json-file
options:
max-size: "50m"
max-file: "20"
services:
prometheus:
image: prom/prometheus:v2.18.0
image: prom/prometheus:v2.36.0
command:
- --config.file=/etc/prometheus/config.yaml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=360d
container_name: wownero_prometheus
restart: unless-stopped
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
- --web.enable-admin-api
- --storage.tsdb.retention.time=360d
volumes:
- prometheus:/prometheus
- ./files/prometheus:/etc/prometheus
ports:
- 127.0.0.1:9090:9090
- ./files/prometheus/config.yaml:/etc/prometheus/config.yaml:ro
<<: *log-config
grafana:
image: grafana/grafana:6.5.0
user: "1000"
command:
- -config=/etc/grafana/grafana.ini
container_name: wownero_grafana
restart: unless-stopped
image: grafana/grafana:8.5.4
ports:
- 127.0.0.1:3000:3000
volumes:
- grafana:/var/lib/grafana
- ./files/grafana/grafana.ini:/etc/grafana/grafana.ini:ro
- ./files/grafana/provisioning:/etc/grafana/provisioning:ro
- ./files/grafana/dashboards:/var/lib/grafana/dashboards:ro
environment:
HOSTNAME: grafana
GF_SERVER_ROOT_URL: ${GRAFANA_URL}
@ -38,22 +54,18 @@ services:
GF_AUTH_DISABLE_LOGIN_FORM: "${GF_AUTH_DISABLE_LOGIN_FORM:-true}"
GF_SECURITY_ADMIN_PASSWORD: "${GF_SECURITY_ADMIN_PASSWORD}"
GF_SECURITY_ADMIN_USER: "${GF_SECURITY_ADMIN_USER}"
volumes:
- ./files/grafana/dashboards.yaml:/etc/grafana/provisioning/dashboards/default.yaml:ro
- ./files/grafana/prometheus.yaml:/etc/grafana/provisioning/datasources/prometheus.yaml:ro
- ./files/grafana/daemon_metrics.json:/var/lib/grafana/dashboards/daemon_metrics.json:ro
- grafana:/var/lib/grafana
<<: *log-config
exporter:
command:
- --monero-addr=http://wownerod:34570
container_name: wownero_exporter
restart: unless-stopped
build:
context: dockerfiles
dockerfile: wownerod_exporter
restart: unless-stopped
environment:
DAEMON_HOST: http://wownerod:34570
PORT: 8080
ports:
- 127.0.0.1:8080:8080
<<: *log-config
wownerod:
container_name: wownero_daemon
build:
@ -68,3 +80,4 @@ services:
- 0.0.0.0:34567:34567
- 0.0.0.0:34568:34568
- 127.0.0.1:34570:34570
<<: *log-config

View file

@ -1,11 +1,10 @@
FROM node:8
FROM ubuntu:22.04
WORKDIR /opt/wownerod_exporter
RUN apt-get update && apt-get install wget tar -y
RUN git clone https://github.com/lalanza808/monerod_exporter.git --branch=master --depth=1 .
RUN wget https://github.com/cirocosta/monero-exporter/releases/download/v0.0.2/monero-exporter_0.0.2_linux_amd64.tar.gz -O monero-exporter.tar.gz && \
tar xzvf monero-exporter.tar.gz && \
mv ./monero-exporter /usr/local/bin && \
chmod +x /usr/local/bin/monero-exporter
RUN npm install
EXPOSE 8080
ENTRYPOINT ["node", "index.js"]
ENTRYPOINT [ "/usr/local/bin/monero-exporter" ]

View file

@ -1,611 +0,0 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 1,
"links": [],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 9,
"w": 18,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 4,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "avg(monerod_connections_incoming)",
"intervalFactor": 1,
"legendFormat": "Incoming",
"refId": "A"
},
{
"expr": "avg(monerod_connections_outgoing)",
"intervalFactor": 1,
"legendFormat": "Outgoing",
"refId": "B"
},
{
"expr": "avg(monerod_rpc_connections_count)",
"intervalFactor": 1,
"legendFormat": "RPC",
"refId": "C"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Connections",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": null,
"format": "none",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 9,
"w": 6,
"x": 18,
"y": 0
},
"hiddenSeries": false,
"id": 8,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "/.*/",
"color": "#FA6400"
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "avg(monerod_block_reward) * 10",
"intervalFactor": 1,
"legendFormat": "Block Reward (WOW)",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Block Reward (WOW)",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": null,
"format": "none",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 9
},
"hiddenSeries": false,
"id": 6,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "/.*/",
"color": "#8F3BB8"
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "avg(monerod_tx_mempool)",
"interval": "",
"intervalFactor": 1,
"legendFormat": "Pool Transactions",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Mempool Transactions",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 9
},
"hiddenSeries": false,
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "/.*/",
"color": "#C4162A"
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "avg(monerod_block_difficulty)",
"intervalFactor": 1,
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Difficulty",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "none",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 20,
"x": 0,
"y": 18
},
"hiddenSeries": false,
"id": 12,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "/.*/",
"color": "#1F60C4"
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "monerod_database_size",
"intervalFactor": 1,
"legendFormat": "Chain Size",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Chain Size",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "decbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"cacheTimeout": null,
"colorBackground": false,
"colorPostfix": false,
"colorPrefix": false,
"colorValue": false,
"colors": [
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": null,
"format": "none",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 8,
"w": 4,
"x": 20,
"y": 18
},
"id": 10,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"options": {},
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false,
"ymax": null,
"ymin": null
},
"tableColumn": "",
"targets": [
{
"expr": "avg(monerod_tx_chain)",
"instant": true,
"refId": "A"
}
],
"thresholds": "",
"timeFrom": null,
"timeShift": null,
"title": "Total Transactions",
"type": "singlestat",
"valueFontSize": "100%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "current"
}
],
"refresh": "30s",
"schemaVersion": 21,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-90d",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
]
},
"timezone": "",
"title": "Daemon Stats",
"uid": "0ktA4KDGk",
"version": 5
}

View file

@ -1,13 +0,0 @@
apiVersion: 1
providers:
- name: 'default'
orgId: 1
folder: ''
type: file
disableDeletion: true
editable: true
updateIntervalSeconds: 60
allowUiUpdates: true
options:
path: /var/lib/grafana/dashboards

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,29 @@
[analytics]
reporting_enabled = false
check_for_updates = false
[auth]
disable_login_form = false
; [auth.anonymous]
; enabled = true
; org_role = Admin
[dashboards]
min_refresh_interval = 1m
default_home_dashboard_path = /var/lib/grafana/dashboards/wownero.json
[paths]
provisioning = /etc/grafana/provisioning
[server]
root_url = https://127.0.0.1
enable_gzip = true
read_timeout = 2m
[snapshots]
external_enabled = false
[security]
admin_user = admin
admin_password = admin

View file

@ -1,9 +0,0 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090
access: proxy
isDefault: true
timeInterval: 10s

View file

@ -0,0 +1,12 @@
apiVersion: 1
providers:
- name: 'fs'
orgId: 1
folder: ''
type: 'file'
updateIntervalSeconds: 30
allowUiUpdates: true
options:
path: '/var/lib/grafana/dashboards'
foldersFromFilesStructure: true

View file

@ -0,0 +1,12 @@
apiVersion: 1
datasources:
- name: prometheus
type: prometheus
access: proxy
orgId: 1
url: http://prometheus:9090
isDefault: true
version: 1
editable: false
timeInterval: 30s

View file

@ -0,0 +1,9 @@
global:
scrape_interval: 10s
evaluation_interval: 10s
external_labels:
monitor: wownerod-exporter
scrape_configs:
- job_name: "wownerod"
static_configs:
- targets: ["exporter:9000"]

View file

@ -1,17 +0,0 @@
global:
scrape_interval: 30s
evaluation_interval: 60s
external_labels:
monitor: wownerod-exporter
scrape_configs:
- job_name: "wownerod-exporter"
static_configs:
- targets: ["exporter:8080"]
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093