Fixed dashboards capacity Widgets (#2055)

- Added new calculation for prometheus capacity
- Added indicator colors to capacity widgets
- Adjusted capacity in drives for common dashboard

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Alex
2022-05-31 10:03:58 -05:00
committed by GitHub
parent 68e98be376
commit b02e649405
6 changed files with 208 additions and 60 deletions

View File

@@ -27,14 +27,12 @@ import (
"strings"
"time"
"github.com/minio/madmin-go"
"github.com/go-openapi/swag"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/swag"
"github.com/minio/console/models"
"github.com/minio/console/restapi/operations"
systemApi "github.com/minio/console/restapi/operations/system"
"github.com/minio/madmin-go"
)
func registerAdminInfoHandlers(api *operations.ConsoleAPI) {
@@ -222,7 +220,7 @@ var widgets = []Metric{
},
{
ID: 50,
Title: "Current Usable Capacity",
Title: "Current Usable Free Capacity",
Type: "gauge",
MaxDataPoints: 100,
GridPos: GridPos{
@@ -239,8 +237,44 @@ var widgets = []Metric{
},
},
Targets: []Target{
{
Expr: `topk(1, sum(minio_cluster_capacity_usable_total_bytes{$__query}) by (instance))`,
LegendFormat: "Total Usable",
Step: 300,
},
{
Expr: `topk(1, sum(minio_cluster_capacity_usable_free_bytes{$__query}) by (instance))`,
LegendFormat: "Usable Free",
Step: 300,
},
{
Expr: `topk(1, sum(minio_cluster_capacity_usable_total_bytes{$__query}) by (instance)) - topk(1, sum(minio_cluster_capacity_usable_free_bytes{$__query}) by (instance))`,
LegendFormat: "Used Space",
Step: 300,
},
},
},
{
ID: 51,
Title: "Current Usable Total Bytes",
Type: "gauge",
MaxDataPoints: 100,
GridPos: GridPos{
H: 6,
W: 3,
X: 6,
Y: 0,
},
Options: MetricOptions{
ReduceOptions: ReduceOptions{
Calcs: []string{
"lastNotNull",
},
},
},
Targets: []Target{
{
Expr: `topk(1, sum(minio_cluster_capacity_usable_total_bytes{$__query}) by (instance))`,
LegendFormat: "",
Step: 300,
},