fix graphs, grafana compose

This commit is contained in:
vdo 2022-05-31 16:02:33 +01:00
parent 720974857d
commit 9e364559b7
5 changed files with 84 additions and 60 deletions

3
.env
View file

@ -7,7 +7,8 @@ TRAEFIK_TLS_PORT=443
TRAEFIK_HTTP_PORT=80 TRAEFIK_HTTP_PORT=80
MONEROD_TAG=latest MONEROD_TAG=latest
MONEROD_RPC_PORT=18089 MONEROD_RPC_PORT=18081
MONEROD_RESTRICTED_RPC_PORT=18089
MONEROD_P2P_PORT=18080 MONEROD_P2P_PORT=18080
MONEROD_EXTRA_PARAMS=--prune-blockchain MONEROD_EXTRA_PARAMS=--prune-blockchain
MONEROD_accessControlAllowOriginList=* MONEROD_accessControlAllowOriginList=*

View file

@ -274,7 +274,7 @@
], ],
"title": "Height and Target", "title": "Height and Target",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -368,7 +368,7 @@
], ],
"title": "Block size median and limit", "title": "Block size median and limit",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -452,7 +452,7 @@
], ],
"title": "Uptime", "title": "Uptime",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -538,7 +538,7 @@
], ],
"title": "Alternative blocks", "title": "Alternative blocks",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -623,7 +623,7 @@
], ],
"title": "Free space", "title": "Free space",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -708,7 +708,7 @@
], ],
"title": "Database Size", "title": "Database Size",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
} }
], ],
"title": "Overall", "title": "Overall",
@ -914,7 +914,7 @@
], ],
"title": "White Peerlist last seen distribution", "title": "White Peerlist last seen distribution",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -998,7 +998,7 @@
], ],
"title": "Peerlists' count", "title": "Peerlists' count",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -1090,7 +1090,7 @@
], ],
"title": "Data rate", "title": "Data rate",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -1174,7 +1174,7 @@
], ],
"title": "Connections by direction (in/out)", "title": "Connections by direction (in/out)",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -1258,7 +1258,7 @@
], ],
"title": "Connections by connection state", "title": "Connections by connection state",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -1350,7 +1350,7 @@
], ],
"title": "Data", "title": "Data",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -1541,7 +1541,7 @@
], ],
"title": "P2P Peers Data Receive Rate", "title": "P2P Peers Data Receive Rate",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -1732,7 +1732,7 @@
], ],
"title": "P2P Peers Data Transmission Rate", "title": "P2P Peers Data Transmission Rate",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -1923,7 +1923,7 @@
], ],
"title": "Connected Peers' Height", "title": "Connected Peers' Height",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -2114,7 +2114,7 @@
], ],
"title": "Connections' Age", "title": "Connections' Age",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
} }
], ],
"title": "Networking", "title": "Networking",
@ -2216,7 +2216,7 @@
], ],
"title": "RPC hits per minute", "title": "RPC hits per minute",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -2300,7 +2300,7 @@
], ],
"title": "Time spent serving RPC methods", "title": "Time spent serving RPC methods",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -2386,7 +2386,7 @@
], ],
"title": "RPC Connections", "title": "RPC Connections",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
} }
], ],
"title": "RPC", "title": "RPC",
@ -2485,7 +2485,7 @@
], ],
"title": "Spent Key Images", "title": "Spent Key Images",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -2569,7 +2569,7 @@
], ],
"title": "Size", "title": "Size",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -2653,7 +2653,7 @@
], ],
"title": "Transactions", "title": "Transactions",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -2844,7 +2844,7 @@
], ],
"title": "Transaction Size", "title": "Transaction Size",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -3035,7 +3035,7 @@
], ],
"title": "Transaction Fees Distribution (per kB)", "title": "Transaction Fees Distribution (per kB)",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -3119,7 +3119,7 @@
], ],
"title": "Fees", "title": "Fees",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -3309,7 +3309,7 @@
], ],
"title": "Transaction Inputs", "title": "Transaction Inputs",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -3499,7 +3499,7 @@
], ],
"title": "Transaction Outputs", "title": "Transaction Outputs",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -3591,7 +3591,7 @@
], ],
"title": "Inputs and Outputs", "title": "Inputs and Outputs",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -3699,7 +3699,7 @@
], ],
"title": "Weird cases", "title": "Weird cases",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -3890,7 +3890,7 @@
], ],
"title": "Transaction Age", "title": "Transaction Age",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
} }
], ],
"title": "Transaction Pool", "title": "Transaction Pool",
@ -3989,7 +3989,7 @@
], ],
"title": "Height", "title": "Height",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -4073,7 +4073,7 @@
], ],
"title": "Fees", "title": "Fees",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -4158,7 +4158,7 @@
], ],
"title": "Subsidy", "title": "Subsidy",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -4349,7 +4349,7 @@
], ],
"title": "Transaction Fees Distribution (per kB)", "title": "Transaction Fees Distribution (per kB)",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -4433,7 +4433,7 @@
], ],
"title": "Rewards", "title": "Rewards",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -4517,7 +4517,7 @@
], ],
"title": "Size", "title": "Size",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -4601,7 +4601,7 @@
], ],
"title": "Transactions", "title": "Transactions",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -4693,7 +4693,7 @@
], ],
"title": "Inputs and Outputs", "title": "Inputs and Outputs",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -4884,7 +4884,7 @@
], ],
"title": "Transaction Size Distribution", "title": "Transaction Size Distribution",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -5074,7 +5074,7 @@
], ],
"title": "Transaction Inputs", "title": "Transaction Inputs",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -5264,7 +5264,7 @@
], ],
"title": "Transaction Outputs", "title": "Transaction Outputs",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
}, },
{ {
"datasource": null, "datasource": null,
@ -5348,7 +5348,7 @@
], ],
"title": "Difficulty", "title": "Difficulty",
"transparent": true, "transparent": true,
"type": "timeseries" "type": "graph"
} }
], ],
"title": "Last Block", "title": "Last Block",

View file

@ -14,13 +14,14 @@ org_role = Admin
[dashboards] [dashboards]
min_refresh_interval = 1m min_refresh_interval = 1m
default_home_dashboard_path = dashboards/monero.json
[paths] [paths]
provisioning = /etc/grafana/provisioning provisioning = /etc/grafana/provisioning
[server] [server]
root_url = https://127.0.0.1/grafana
enable_gzip = true enable_gzip = true
read_timeout = 2m read_timeout = 2m

View file

@ -28,9 +28,10 @@ x-traefik-command-nole: &traefik-command-nole
x-monerod-command: &monerod-command x-monerod-command: &monerod-command
command: >- command: >-
--restricted-rpc --public-node --no-igd --no-zmq --public-node --no-igd --no-zmq
--enable-dns-blocklist --rpc-restricted-bind-ip=0.0.0.0 --enable-dns-blocklist --rpc-restricted-bind-ip=0.0.0.0
--rpc-restricted-bind-port=${MONEROD_RPC_PORT} --confirm-external-bind --rpc-restricted-bind-port=${MONEROD_RESTRICTED_RPC_PORT} --confirm-external-bind
--rpc-bind-port=${MONEROD_RPC_PORT} --rpc-bind-ip=0.0.0.0
${MONEROD_EXTRA_PARAMS} ${MONEROD_EXTRA_PARAMS}
x-tor-service: &tor-service x-tor-service: &tor-service
@ -40,7 +41,7 @@ x-tor-service: &tor-service
links: links:
- monerod - monerod
environment: environment:
MONEROD_TOR_SERVICE_HOSTS: "${TOR_HTTP_PORT}:monerod:${MONEROD_RPC_PORT}" MONEROD_TOR_SERVICE_HOSTS: "${TOR_HTTP_PORT}:monerod:${MONEROD_RESTRICTED_RPC_PORT}"
volumes: volumes:
- tor-keys:/var/lib/tor/hidden_service/ - tor-keys:/var/lib/tor/hidden_service/
@ -73,7 +74,6 @@ x-monero-exporter-service: &monero-exporter-service
- --monero-addr=http://monerod:${MONEROD_RPC_PORT} - --monero-addr=http://monerod:${MONEROD_RPC_PORT}
container_name: monero-exporter container_name: monero-exporter
image: utxobr/monero-exporter@sha256:737413b1054583535e835e1417b61a8d59a4c08723e4a15c61c4249c2a7d69a4 image: utxobr/monero-exporter@sha256:737413b1054583535e835e1417b61a8d59a4c08723e4a15c61c4249c2a7d69a4
network_mode: service:monerod
x-grafana-service: &grafana-service x-grafana-service: &grafana-service
grafana: grafana:
@ -101,6 +101,7 @@ x-grafana-service: &grafana-service
x-prometheus-service: &prometheus-service x-prometheus-service: &prometheus-service
prometheus: prometheus:
user: root
command: command:
- --config.file=/etc/prometheus/config.yaml - --config.file=/etc/prometheus/config.yaml
- --storage.tsdb.path=/data - --storage.tsdb.path=/data
@ -139,7 +140,6 @@ services:
<<: *monerod-command <<: *monerod-command
ports: ports:
- "${MONEROD_P2P_PORT}:${MONEROD_P2P_PORT}" # Exposes P2P port - "${MONEROD_P2P_PORT}:${MONEROD_P2P_PORT}" # Exposes P2P port
- "${MONEROD_RPC_PORT}"
volumes: volumes:
- "monerod-data:/home/monero/.bitmonero" - "monerod-data:/home/monero/.bitmonero"
labels: labels:
@ -150,21 +150,19 @@ services:
- "traefik.http.routers.monerod.entrypoints=websecure" - "traefik.http.routers.monerod.entrypoints=websecure"
- "traefik.http.routers.monerod.tls" - "traefik.http.routers.monerod.tls"
- "traefik.http.routers.monerod.service=monerod" - "traefik.http.routers.monerod.service=monerod"
- "traefik.http.services.monerod.loadbalancer.server.port=${MONEROD_RPC_PORT}" - "traefik.http.services.monerod.loadbalancer.server.port=${MONEROD_RESTRICTED_RPC_PORT}"
# - "traefik.http.middlewares.corsheader.headers.accessControlAllowOriginList=${MONEROD_accessControlAllowOriginList}" #!cors # - "traefik.http.middlewares.corsheader.headers.accessControlAllowOriginList=${MONEROD_accessControlAllowOriginList}" #!cors
# - "traefik.http.routers.monerod.middlewares=corsheader" #!cors # - "traefik.http.routers.monerod.middlewares=corsheader" #!cors
restart: unless-stopped restart: unless-stopped
# <<: *tor-service #!tor # <<: *tor-service #!tor
# <<: *explorer-service #!explorer # <<: *explorer-service #!explorer
<<: *monero-exporter-service #!monero-exporter # <<: *monero-exporter-service #!monero-exporter
# <<: *grafana-service #!grafana
<<: *grafana-service #!grafana # <<: *prometheus-service #!prometheus
<<: *prometheus-service #!prometheus
# <<: *watchtower-service #!watchtower # <<: *watchtower-service #!watchtower
volumes: volumes:
monerod-data: {} monerod-data: {}
# tor-keys: {} #!tor # tor-keys: {} #!tor
prometheus-data: {} #!prometheus # prometheus-data: {} #!prometheus

32
install
View file

@ -52,6 +52,7 @@ TLS_PORT=""
TLS_DOMAIN="" TLS_DOMAIN=""
TLS_EMAIL="" TLS_EMAIL=""
NETWORK="mainnet" NETWORK="mainnet"
ENABLE_GRAFANA=""
################################################################ ################################################################
# Functions # # Functions #
@ -282,6 +283,24 @@ configure_explorer() {
done done
} }
configure_grafana() {
echo -e "${OkBullet}Configuring grafana..."
while true; do
read -r -e -p " Do you want to enable a grafana monitoring dashboard? [y/n]: " yn
case $yn in
[Yy]*)
ENABLE_GRAFANA=true
sed -i '/#!monero-exporter/s/# //g' docker-compose.yml
sed -i '/#!grafana/s/# //g' docker-compose.yml
sed -i '/#!prometheus/s/# //g' docker-compose.yml
break
;;
[Nn]*) break ;;
*) echo " Please answer yes or no." ;;
esac
done
}
configure_watchtower() { configure_watchtower() {
echo -e "${OkBullet}Configuring watchtower..." echo -e "${OkBullet}Configuring watchtower..."
while true; do while true; do
@ -341,13 +360,18 @@ completed() {
echo -e " ${Red}┌───────────────────────────────────────────────────────────────────────────[info]──" echo -e " ${Red}┌───────────────────────────────────────────────────────────────────────────[info]──"
echo -e " ${Red}│${Stat} Network: ${StatInfo}${NETWORK}" echo -e " ${Red}│${Stat} Network: ${StatInfo}${NETWORK}"
echo -e " ${Red}│${Stat} URL: ${StatInfo}https://${HOST}${PORT_SUFF}" echo -e " ${Red}│${Stat} URL: ${StatInfo}https://${HOST}${PORT_SUFF}"
if [ "$ENABLE_EXPLORER" = true ]; then
echo -e " ${Red}│${Stat} Explorer URL: ${StatInfo}https://${HOST}${PORT_SUFF}/explorer"
fi
echo -e " ${Red}│${Stat} Public IP: ${StatInfo}${PUBLIC_IP}" echo -e " ${Red}│${Stat} Public IP: ${StatInfo}${PUBLIC_IP}"
if [ "$ENABLE_TOR" = true ]; then if [ "$ENABLE_TOR" = true ]; then
echo -e " ${Red}│${Stat} Onion Service: ${StatInfo}$ONION" echo -e " ${Red}│${Stat} Onion Service: ${StatInfo}$ONION"
fi fi
if [ "$ENABLE_EXPLORER" = true ]; then
echo -e " ${Red}│${Stat} Explorer URL: ${StatInfo}https://${HOST}${PORT_SUFF}/explorer"
fi
if [ "$ENABLE_GRAFANA" = true ]; then
echo -e " ${Red}│${Stat} Grafana URL: ${StatInfo}https://${HOST}${PORT_SUFF}/grafana"
fi
echo -e " ${Red}│${Stat} Project installed in: ${StatInfo}${XMRSH_DIR}"
echo -e " ${Red}│${Off}" echo -e " ${Red}│${Off}"
echo echo
} }
@ -377,7 +401,7 @@ configure_cors
configure_tor configure_tor
configure_explorer configure_explorer
configure_watchtower configure_watchtower
# configure_monitor configure_grafana
# configure_lws # configure_lws
start_xmrsh start_xmrsh
completed completed