postgres_exporter/postgres_mixin/dashboards/panels.libsonnet
Joe Adams 5d10f23241 Rework postgres_mixin dashboard
Rework the postgres_mixing dashboard to be more composable. The goal is for this to be more maintainable long term. I don't know jsonnet very well, but following other projects, this appears to be in line.

This replaces the postgres-overview.json dashboard with an overview.json dashboard with the same panels. While the dashboard does not match perfectly, it does include the same data but with the correct metrics.

Signed-off-by: Joe Adams <github@joeadams.io>
2023-09-12 22:20:50 -04:00

31 lines
659 B
Plaintext

local g = import 'g.libsonnet';
{
stat: {
local stat = g.panel.stat,
base(title, targets):
stat.new(title)
+stat.queryOptions.withTargets(targets),
qps: self.base,
},
timeSeries: {
local timeSeries = g.panel.timeSeries,
base(title, targets):
timeSeries.new(title)
+timeSeries.queryOptions.withTargets(targets),
ratio(title, targets):
self.base(title, targets)
+ timeSeries.standardOptions.withUnit('percentunit'),
ratio1(title, targets):
self.ratio(title, targets)
+ timeSeries.standardOptions.withUnit('percentunit')
+ timeSeries.standardOptions.withMax(1)
}
}