Skip to content

Commit

Permalink
Add new charts, introduce log parsing and wrap up Ansible automation (#…
Browse files Browse the repository at this point in the history
…95)

* add validator chart

* chain: add last block metrics

* chain: adjust supply conversion

* add header size

* add blocks visualization

* add number of inputs and outputs

* add block chart

* dashboard list

* dash list

* adjust blocks report

* add Go runtime dashboard

* add configuration to Promtail to parse logs & modify Go runtime dashboard

* adjust promtail

* add numered names to dashboards and list for dashboards

* add logging

* add logging and monitoring dashboards into folders

* add default time range to dashboards

* make dashboards public

* introduce reverse proxy for /list path and wrap up Ansible automation

* change branch for ansible pull

* add quick flags for bot

* add todo

* linter

---------

Co-authored-by: yago-123 <yfernandezgou@gmail.com>
  • Loading branch information
yago-123 and yago-123 authored Jan 25, 2025
1 parent d88cdc2 commit 68bf0ef
Show file tree
Hide file tree
Showing 31 changed files with 3,763 additions and 657 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Default configuration:
```yaml
seed-nodes: # List of seed nodes
- address: "seed-1.chainnet.yago.ninja"
peer-id: "QmNXM4W7om3FdYDutuPjYCgTsazRNWhNn6fNyimf7SUHhR"
peer-id: "QmVQ8bj9KPfTiN23vX7sbqn4oXjTSycfULL4oApAZccWL5"
port: 9100
- address: "seed-2.chainnet.yago.ninja"
peer-id: "peerID-2"
Expand Down Expand Up @@ -116,8 +116,6 @@ $ ./bin/chainnet-nespv send \
--pay-type P2PKH \
--wallet-key-path <wallet.pem>
```
```
`todo()`: add example with P2PKH payment too

### Step 3: Extract the Public Key in Base58 Format
To receive rewards, you'll need to extract the public key from the wallet in `base58` format. This can be done as follows:
Expand Down Expand Up @@ -190,7 +188,7 @@ $ ansible-playbook -i ansible/inventories/seed/hosts.ini \
After the initial chain has been set up, you can also install logging and monitoring with default dashboards. To do this,
you must first install Grafana:
```bash
$ ansible-playbook -i ansible/inventories/seed/hosts.ini \
$ ansible-playbook -i ansible/inventories/seed/hosts.ini \
ansible/playbooks/visualization.yml
```

Expand Down
2 changes: 1 addition & 1 deletion ansible/playbooks/blockchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
app_dir: /var/chainnet
config: 'default-config.yaml'
repo_url: 'https://github.com/yago-123/chainnet.git'
branch: 'improve-reliability-bot'
branch: 'master'
go_version: '1.23.0'
target: "{{ node }}"
roles:
Expand Down
2 changes: 1 addition & 1 deletion ansible/playbooks/logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
name: visualization
when: grafana_installed

- name: Set up monitoring
- name: Set up logging
include_role:
name: logging
239 changes: 195 additions & 44 deletions ansible/playbooks/roles/logging/files/dashboard-logging.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 4,
"id": 10,
"links": [],
"panels": [
{
"datasource": {
"type": "loki",
"uid": "ae8pr32girzswd"
"uid": "P8E80F9AEF21F6940"
},
"fieldConfig": {
"defaults": {
Expand All @@ -37,29 +37,17 @@
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
Expand All @@ -69,75 +57,238 @@
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
"color": "green",
"value": null
}
]
}
},
"overrides": []
"overrides": [
{
"matcher": {
"id": "byName",
"options": "error"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "dark-red",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "info"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "green",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "debug"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "blue",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 7,
"w": 24,
"h": 8,
"w": 19,
"x": 0,
"y": 0
},
"id": 2,
"id": 3,
"options": {
"barRadius": 0,
"barWidth": 0.81,
"fullHighlight": false,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"orientation": "auto",
"showValue": "never",
"stacking": "normal",
"tooltip": {
"mode": "multi",
"sort": "desc"
},
"xTickLabelRotation": 0,
"xTickLabelSpacing": 200
},
"pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"editorMode": "code",
"expr": "count_over_time({filename=\"/var/log/chainnet/service.err.log\"} |= `` [$__auto])",
"legendFormat": "{{level}}",
"queryType": "range",
"refId": "A"
}
],
"title": "Logs Count",
"type": "barchart"
},
{
"datasource": {
"type": "loki",
"uid": "P8E80F9AEF21F6940"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": []
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "debug"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "blue",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "error"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "red",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "info"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "green",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 5,
"x": 19,
"y": 0
},
"id": 4,
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"tooltip": {
"mode": "single",
"sort": "none"
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "11.4.0",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "ae8pr32girzswd"
"uid": "P8E80F9AEF21F6940"
},
"editorMode": "builder",
"expr": "count(rate({filename=\"/var/log/chainnet/service.err.log\"} |= `` [$__auto]))",
"editorMode": "code",
"expr": "sum(count_over_time({filename=\"/var/log/chainnet/service.err.log\"}[$__range])) by (level)",
"legendFormat": "{{level}}",
"queryType": "range",
"refId": "A"
}
],
"title": "Panel Title",
"type": "timeseries"
"title": "",
"type": "piechart"
},
{
"datasource": {
"type": "loki",
"uid": "ae8pr32girzswd"
"uid": "P8E80F9AEF21F6940"
},
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 16,
"h": 13,
"w": 24,
"x": 0,
"y": 7
"y": 8
},
"id": 1,
"id": 2,
"options": {
"dedupStrategy": "exact",
"dedupStrategy": "none",
"enableLogDetails": true,
"prettifyLogMessage": false,
"showCommonLabels": false,
"showLabels": false,
"showTime": true,
"showTime": false,
"sortOrder": "Descending",
"wrapLogMessage": false
},
Expand All @@ -146,15 +297,15 @@
{
"datasource": {
"type": "loki",
"uid": "ae8pr32girzswd"
"uid": "P8E80F9AEF21F6940"
},
"editorMode": "builder",
"expr": "{filename=\"/var/log/chainnet/service.err.log\"} |= ``",
"queryType": "range",
"refId": "A"
}
],
"title": "Panel Title",
"title": "",
"type": "logs"
}
],
Expand All @@ -165,13 +316,13 @@
"list": []
},
"time": {
"from": "now-6h",
"from": "now-24h",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "logs",
"uid": "be8ptv4k41gxsa",
"version": 8,
"title": "Logging",
"uid": "ceat0e1ne8jr4c",
"version": 2,
"weekStart": ""
}
}
Loading

0 comments on commit 68bf0ef

Please sign in to comment.