1
0
Fork 0

Add last payments to Flexpool dashboard

Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
Julien Riou 2021-03-05 09:16:01 +01:00
parent 65c11fc2a1
commit e85c21fe11
No known key found for this signature in database
GPG key ID: FF42D23B580C89F7
2 changed files with 128 additions and 5 deletions

View file

@ -33,6 +33,12 @@
"id": "stat", "id": "stat",
"name": "Stat", "name": "Stat",
"version": "" "version": ""
},
{
"type": "panel",
"id": "table",
"name": "Table",
"version": ""
} }
], ],
"annotations": { "annotations": {
@ -53,7 +59,7 @@
"gnetId": null, "gnetId": null,
"graphTooltip": 0, "graphTooltip": 0,
"id": null, "id": null,
"iteration": 1614869549332, "iteration": 1614928977404,
"links": [], "links": [],
"panels": [ "panels": [
{ {
@ -1076,7 +1082,7 @@
"fillGradient": 0, "fillGradient": 0,
"gridPos": { "gridPos": {
"h": 8, "h": 8,
"w": 12, "w": 6,
"x": 0, "x": 0,
"y": 25 "y": 25
}, },
@ -1280,8 +1286,8 @@
}, },
"gridPos": { "gridPos": {
"h": 8, "h": 8,
"w": 12, "w": 6,
"x": 12, "x": 6,
"y": 25 "y": 25
}, },
"hideTimeOverride": true, "hideTimeOverride": true,
@ -1391,6 +1397,112 @@
"title": "Paid by the pool", "title": "Paid by the pool",
"type": "stat" "type": "stat"
}, },
{
"datasource": "${DS_INFLUXDB}",
"fieldConfig": {
"defaults": {
"custom": {
"align": "center"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "amount"
},
"properties": [
{
"id": "decimals",
"value": 5
}
]
},
{
"matcher": {
"id": "byName",
"options": "amount (fiat)"
},
"properties": [
{
"id": "decimals",
"value": 2
}
]
},
{
"matcher": {
"id": "byName",
"options": "duration"
},
"properties": [
{
"id": "unit",
"value": "dtdurations"
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 25
},
"id": 64,
"options": {
"showHeader": true
},
"pluginVersion": "7.0.0",
"targets": [
{
"groupBy": [],
"measurement": "flexpool_payments",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT \"amount\"/1000000000000000000, \"amount\"/1000000000000000000*$exchange_rate as \"amount (fiat)\", \"duration\" FROM \"flexpool_payments\" WHERE (\"miner\" =~ /^$miner$/) order by time desc limit 6",
"rawQuery": true,
"refId": "A",
"resultFormat": "table",
"select": [
[
{
"params": [
"amount"
],
"type": "field"
}
]
],
"tags": [
{
"key": "miner",
"operator": "=~",
"value": "/^$miner$/"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "Last payments",
"type": "table"
},
{ {
"collapsed": false, "collapsed": false,
"datasource": "${DS_INFLUXDB}", "datasource": "${DS_INFLUXDB}",
@ -2882,5 +2994,5 @@
"timezone": "", "timezone": "",
"title": "Flexpool overview", "title": "Flexpool overview",
"uid": "Q3JPASkgz", "uid": "Q3JPASkgz",
"version": 11 "version": 12
} }

View file

@ -43,3 +43,14 @@
tagexclude = ["url"] tagexclude = ["url"]
[inputs.http.tags] [inputs.http.tags]
miner = "${MINER_ADDRESS}" miner = "${MINER_ADDRESS}"
[[inputs.http]]
name_override = "flexpool_payments"
urls = ["https://flexpool.io/api/v1/miner/${MINER_ADDRESS}/payments/?page=0"]
data_format = "json"
tagexclude = ["url"]
json_query = "result.data"
json_time_format = "unix"
json_time_key = "timestamp"
[inputs.http.tags]
miner = "${MINER_ADDRESS}"