mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-05-04 08:58:03 +00:00
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>
31 lines
659 B
Plaintext
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)
|
|
}
|
|
}
|