Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pgbouncer-mixin/config.libsonnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
local this = self,
// any modular library should include as inputs:
// 'dashboardNamePrefix' - Use as prefix for all Dashboards and (optional) rule groups
// 'filteringSelector' - Static selector to apply to ALL dashboard variables of type query, panel queries, alerts and recording rules.
Expand All @@ -16,6 +17,7 @@
dashboardTags: [self.uid],
uid: 'pgbouncer',
dashboardNamePrefix: '',
metricsSource: ['prometheus'],

// additional params can be added if needed
dashboardPeriod: 'now-1h',
Expand All @@ -34,4 +36,12 @@
extraLogLabels: ['level'],
logsVolumeGroupBy: 'level',
showLogsVolume: true,

// Signals configuration
signals+: {
connections: (import './signals/connections.libsonnet')(this),
stats: (import './signals/stats.libsonnet')(this),
config: (import './signals/config.libsonnet')(this),
cluster: (import './signals/cluster.libsonnet')(this),
},
}
6 changes: 3 additions & 3 deletions pgbouncer-mixin/dashboards.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local logslib = import 'logs-lib/logs/main.libsonnet';
local panels = this.grafana.panels;
local stat = g.panel.stat;
{
overview:
'overview.json':
g.dashboard.new(prefix + 'PgBouncer overview')
+ g.dashboard.withPanels(
g.util.grid.wrapPanels(
Expand Down Expand Up @@ -45,7 +45,7 @@ local logslib = import 'logs-lib/logs/main.libsonnet';
)
// hide link to self
+ root.applyCommon(vars.singleInstance, uid + '-overview', tags, links { pgbouncerOverview+:: {} }, annotations, timezone, refresh, period),
clusterOverview:
'clusterOverview.json':
g.dashboard.new(prefix + 'PgBouncer cluster overview')
+ g.dashboard.withPanels(
g.util.grid.wrapPanels(
Expand All @@ -64,7 +64,7 @@ local logslib = import 'logs-lib/logs/main.libsonnet';
+
if this.config.enableLokiLogs then
{
logs:
'logs.json':
logslib.new(
prefix + 'PgBouncer logs',
datasourceName=this.grafana.variables.datasources.loki.name,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading