Merge pull request #74 from asymmetric-research/example-prometheus

added example prometheus setup
This commit is contained in:
Matt Johnstone 2024-11-14 11:13:14 +02:00 committed by GitHub
commit c689d360c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 2876 additions and 574 deletions

3
.gitignore vendored
View File

@ -1,6 +1,3 @@
# for prometheus:
.prometheus
# builds:
.builds
/solana-exporter

View File

@ -17,6 +17,8 @@ solana-exporter \
-monitor-block-sizes
```
![Solana Exporter Dashboard Sample](assets/solana-dashboard-screenshot.png)
## Installation
### Build

View File

@ -1,571 +0,0 @@
{
"__inputs": [
{
"name": "DS_MAIN_PROMETHEUS",
"label": "Main Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "7.0.1"
},
{
"type": "panel",
"id": "graph",
"name": "Graph",
"version": ""
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.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": 1,
"id": null,
"iteration": 1591625151288,
"links": [],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_MAIN_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 13,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": true,
"min": true,
"show": true,
"sort": "min",
"sortDesc": false,
"total": false,
"values": true
},
"lines": false,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pluginVersion": "6.5.3",
"pointradius": 1,
"points": true,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "solana_validator_last_vote - on(service) group_left() max by(env, service) (solana_validator_last_vote{service=~\"$service\"}) > -500000",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "validator desync",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": "100",
"min": "-400",
"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": "${DS_MAIN_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"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": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "rate(max by(env, service) (solana_validator_last_vote{service=~\"$service\"})[1m:])",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "rate(max(last_voted))",
"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": "${DS_MAIN_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 8
},
"hiddenSeries": false,
"id": 2,
"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": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "solana_active_validators{service=~\"$service\"}",
"legendFormat": "{{ state }}",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "active / delinquent",
"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": "${DS_MAIN_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 6,
"x": 12,
"y": 8
},
"hiddenSeries": false,
"id": 8,
"legend": {
"alignAsTable": true,
"avg": false,
"current": true,
"max": true,
"min": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "max(solana_validator_root_slot{service=~\"$service\"})",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "max(root_slot)",
"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": "${DS_MAIN_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 6,
"x": 18,
"y": 8
},
"hiddenSeries": false,
"id": 9,
"legend": {
"alignAsTable": true,
"avg": false,
"current": true,
"max": true,
"min": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "max(solana_validator_last_vote{service=~\"$service\"})",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "max(last_voted)",
"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
}
}
],
"refresh": "",
"schemaVersion": 25,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {},
"datasource": "${DS_MAIN_PROMETHEUS}",
"definition": "label_values(solana_active_validators, service)",
"hide": 0,
"includeAll": true,
"label": null,
"multi": false,
"name": "service",
"options": [],
"query": "label_values(solana_active_validators, service)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
]
},
"timezone": "",
"title": "Solana Exporter",
"uid": "fU8H9cmGz",
"version": 3
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 KiB

1
prometheus/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/data

9
prometheus/README.md Normal file
View File

@ -0,0 +1,9 @@
# Solana Exporter: Example Prometheus Configuration
## Overview
This directory contains:
* An example Prometheus configuration.
* Solana recording rules for tracking skip rate.
* An example Grafana dashboard.
***NOTE***: None of these examples are required - custom tailored configurations are encouraged!

13
prometheus/prometheus.yml Normal file
View File

@ -0,0 +1,13 @@
global:
scrape_interval: 30s
rule_files:
- 'solana-rules.yml'
scrape_configs:
- job_name: 'solana-exporter'
static_configs:
- targets: ['localhost:8080']
labels:
app: 'solana'
hostname: 'my-host.name'

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,22 @@
groups:
- name: solana_recording_rules
interval: 30s
rules:
- record: solana:cluster_epoch_skip_rate
expr: |-
sum by (hostname, epoch) (solana_cluster_slots_by_epoch_total{app="solana",status="skipped"}) / sum by (hostname, epoch) (solana_cluster_slots_by_epoch_total{app="solana"})
- record: solana:validator_epoch_skip_rate
expr: |-
sum by (hostname, epoch, nodekey) (solana_validator_leader_slots_by_epoch_total{app="solana",status="skipped"}) / sum by (hostname, epoch, nodekey) (solana_validator_leader_slots_by_epoch_total{app="solana"})
- record: solana:cluster_hour_skip_rate
expr: |-
sum by (hostname) (increase(solana_validator_leader_slots_total{app="solana",status="skipped"}[1h])) / sum by (hostname) (increase(solana_validator_leader_slots_total{app="solana"}[1h]))
- record: solana:cluster_day_skip_rate
expr: |-
sum by (hostname) (increase(solana_validator_leader_slots_total{app="solana",status="skipped"}[1d])) / sum by (hostname) (increase(solana_validator_leader_slots_total{app="solana"}[1d]))
- record: solana:validator_hour_skip_rate
expr: |-
sum by (hostname, nodekey) (increase(solana_validator_leader_slots_total{app="solana",status="skipped"}[1h])) / sum by (hostname, nodekey) (increase(solana_validator_leader_slots_total{app="solana"}[1h]))
- record: solana:validator_day_skip_rate
expr: |-
sum by (hostname, nodekey) (increase(solana_validator_leader_slots_total{app="solana",status="skipped"}[1d])) / sum by (hostname, nodekey) (increase(solana_validator_leader_slots_total{app="solana"}[1d]))