Skip to content

Commit f9c7f9c

Browse files
committed
Reworked signals to line up with dashboards and instance labels
1 parent bc3067a commit f9c7f9c

File tree

9 files changed

+168
-135
lines changed

9 files changed

+168
-135
lines changed

wildfly-mixin/config.libsonnet

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
local this = self,
3-
enableMultiCluster: false,
4-
filteringSelector: 'job="integrations/wildfly"', // set to apply static filters to all queries and alerts, i.e. job="integrations/wildfly"
3+
filteringSelector: 'job="integrations/wildfly"',
54
groupLabels: ['job', 'cluster'],
65
logLabels: ['job', 'cluster', 'instance'],
76
instanceLabels: ['instance'],
@@ -26,7 +25,9 @@
2625

2726
// Signals configuration
2827
signals+: {
29-
overview: (import './signals/overview.libsonnet')(this),
28+
overviewServer: (import './signals/overview-server.libsonnet')(this),
29+
overviewDeployment: (import './signals/overview-deployment.libsonnet')(this),
3030
datasource: (import './signals/datasource.libsonnet')(this),
31+
datasourceTransaction: (import './signals/datasource-transaction.libsonnet')(this),
3132
},
3233
}

wildfly-mixin/dashboards.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ local logslib = import 'logs-lib/logs/main.libsonnet';
5656
)
5757
) + root.applyCommon(
5858
vars.multiInstance + [
59-
g.dashboard.variable.query.new('datasource')
59+
g.dashboard.variable.query.new('data_source')
6060
+ g.dashboard.variable.custom.selectionOptions.withMulti(true)
6161
+ g.dashboard.variable.query.queryTypes.withLabelValues(label='data_source', metric='wildfly_datasources_pool_in_use_count{%(queriesSelectorGroupOnly)s}' % vars)
6262
+ g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus),

wildfly-mixin/dashboards_out/wildfly-datasource.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wildfly-mixin/dashboards_out/wildfly-overview.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wildfly-mixin/panels.libsonnet

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ local commonlib = import 'common-lib/common/main.libsonnet';
1010
g.panel.timeSeries.new('Requests')
1111
+ g.panel.timeSeries.panelOptions.withDescription('Requests rate over time')
1212
+ g.panel.timeSeries.queryOptions.withTargets([
13-
signals.overview.requestsRate.asTarget()
13+
signals.overviewServer.requestsRate.asTarget()
1414
+ g.query.prometheus.withInterval('2m')
1515
+ g.query.prometheus.withIntervalFactor(2),
1616
])
@@ -20,7 +20,7 @@ local commonlib = import 'common-lib/common/main.libsonnet';
2020
g.panel.timeSeries.new('Request errors')
2121
+ g.panel.timeSeries.panelOptions.withDescription('Rate of requests that result in 500 over time')
2222
+ g.panel.timeSeries.queryOptions.withTargets([
23-
signals.overview.requestErrorsRate.asTarget()
23+
signals.overviewServer.requestErrorsRate.asTarget()
2424
+ g.query.prometheus.withInterval('2m')
2525
+ g.query.prometheus.withIntervalFactor(2),
2626
])
@@ -35,7 +35,7 @@ local commonlib = import 'common-lib/common/main.libsonnet';
3535
g.panel.timeSeries.new('Network received throughput')
3636
+ g.panel.timeSeries.panelOptions.withDescription('Throughput rate of data received over time')
3737
+ g.panel.timeSeries.queryOptions.withTargets([
38-
signals.overview.networkReceivedThroughput.asTarget()
38+
signals.overviewServer.networkReceivedThroughput.asTarget()
3939
+ g.query.prometheus.withInterval('2m')
4040
+ g.query.prometheus.withIntervalFactor(2),
4141
])
@@ -46,7 +46,7 @@ local commonlib = import 'common-lib/common/main.libsonnet';
4646
g.panel.timeSeries.new('Network sent throughput')
4747
+ g.panel.timeSeries.panelOptions.withDescription('Throughput rate of data sent over time')
4848
+ g.panel.timeSeries.queryOptions.withTargets([
49-
signals.overview.networkSentThroughput.asTarget()
49+
signals.overviewServer.networkSentThroughput.asTarget()
5050
+ g.query.prometheus.withInterval('2m')
5151
+ g.query.prometheus.withIntervalFactor(2),
5252
])
@@ -57,11 +57,11 @@ local commonlib = import 'common-lib/common/main.libsonnet';
5757
])
5858
+ g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false),
5959

60-
connectionsActivePanel:
61-
g.panel.timeSeries.new('Active connections')
62-
+ g.panel.timeSeries.panelOptions.withDescription('Connections to the datasource over time')
60+
sessionsActivePanel:
61+
g.panel.timeSeries.new('Active sessions')
62+
+ g.panel.timeSeries.panelOptions.withDescription('Number of active sessions to deployment over time')
6363
+ g.panel.timeSeries.queryOptions.withTargets([
64-
signals.datasource.connectionsActive.asTarget()
64+
signals.overviewDeployment.activeSessions.asTarget()
6565
+ g.query.prometheus.withIntervalFactor(2),
6666
])
6767
+ g.panel.timeSeries.standardOptions.thresholds.withSteps([
@@ -70,38 +70,41 @@ local commonlib = import 'common-lib/common/main.libsonnet';
7070
])
7171
+ g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false),
7272

73-
connectionsIdlePanel:
74-
g.panel.timeSeries.new('Idle connections')
75-
+ g.panel.timeSeries.panelOptions.withDescription('Connections to the datasource over time')
73+
sessionsExpiredPanel:
74+
g.panel.timeSeries.new('Expired sessions')
75+
+ g.panel.timeSeries.panelOptions.withDescription('Number of sessions that have expired for a deployment over time')
7676
+ g.panel.timeSeries.queryOptions.withTargets([
77-
signals.datasource.connectionsIdle.asTarget()
77+
signals.overviewDeployment.expiredSessions.asTarget()
78+
+ g.query.prometheus.withInterval('2m')
7879
+ g.query.prometheus.withIntervalFactor(2),
7980
])
81+
+ g.panel.timeSeries.standardOptions.withDecimals(0)
8082
+ g.panel.timeSeries.standardOptions.thresholds.withSteps([
8183
{ color: 'green', value: null },
8284
{ color: 'red', value: 80 },
8385
])
8486
+ g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false),
8587

86-
transactionsCreatedPanel:
87-
g.panel.timeSeries.new('Created transactions')
88-
+ g.panel.timeSeries.panelOptions.withDescription('Number of transactions that were created over time')
88+
sessionsRejectedPanel:
89+
g.panel.timeSeries.new('Rejected sessions')
90+
+ g.panel.timeSeries.panelOptions.withDescription('Number of sessions that have been rejected from a deployment over time')
8991
+ g.panel.timeSeries.queryOptions.withTargets([
90-
signals.datasource.transactionsCreated.asTarget()
92+
signals.overviewDeployment.rejectedSessions.asTarget()
9193
+ g.query.prometheus.withInterval('2m')
9294
+ g.query.prometheus.withIntervalFactor(2),
9395
])
96+
+ g.panel.timeSeries.standardOptions.withDecimals(0)
9497
+ g.panel.timeSeries.standardOptions.thresholds.withSteps([
9598
{ color: 'green', value: null },
9699
{ color: 'red', value: 80 },
97100
])
98101
+ g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false),
99102

100-
transactionsInFlightPanel:
101-
g.panel.timeSeries.new('In-flight transactions')
102-
+ g.panel.timeSeries.panelOptions.withDescription('Number of transactions that are in-flight over time')
103+
connectionsActivePanel:
104+
g.panel.timeSeries.new('Active connections')
105+
+ g.panel.timeSeries.panelOptions.withDescription('Connections to the datasource over time')
103106
+ g.panel.timeSeries.queryOptions.withTargets([
104-
signals.datasource.transactionsInFlight.asTarget()
107+
signals.datasource.connectionsActive.asTarget()
105108
+ g.query.prometheus.withIntervalFactor(2),
106109
])
107110
+ g.panel.timeSeries.standardOptions.thresholds.withSteps([
@@ -110,12 +113,11 @@ local commonlib = import 'common-lib/common/main.libsonnet';
110113
])
111114
+ g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false),
112115

113-
transactionsAbortedPanel:
114-
g.panel.timeSeries.new('Aborted transactions')
115-
+ g.panel.timeSeries.panelOptions.withDescription('Number of transactions that have been aborted over time')
116+
connectionsIdlePanel:
117+
g.panel.timeSeries.new('Idle connections')
118+
+ g.panel.timeSeries.panelOptions.withDescription('Connections to the datasource over time')
116119
+ g.panel.timeSeries.queryOptions.withTargets([
117-
signals.datasource.transactionsAborted.asTarget()
118-
+ g.query.prometheus.withInterval('2m')
120+
signals.datasource.connectionsIdle.asTarget()
119121
+ g.query.prometheus.withIntervalFactor(2),
120122
])
121123
+ g.panel.timeSeries.standardOptions.thresholds.withSteps([
@@ -124,11 +126,12 @@ local commonlib = import 'common-lib/common/main.libsonnet';
124126
])
125127
+ g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false),
126128

127-
sessionsActivePanel:
128-
g.panel.timeSeries.new('Active sessions')
129-
+ g.panel.timeSeries.panelOptions.withDescription('Number of active sessions to deployment over time')
129+
transactionsCreatedPanel:
130+
g.panel.timeSeries.new('Created transactions')
131+
+ g.panel.timeSeries.panelOptions.withDescription('Number of transactions that were created over time')
130132
+ g.panel.timeSeries.queryOptions.withTargets([
131-
signals.overview.activeSessions.asTarget()
133+
signals.datasourceTransaction.transactionsCreated.asTarget()
134+
+ g.query.prometheus.withInterval('2m')
132135
+ g.query.prometheus.withIntervalFactor(2),
133136
])
134137
+ g.panel.timeSeries.standardOptions.thresholds.withSteps([
@@ -137,30 +140,27 @@ local commonlib = import 'common-lib/common/main.libsonnet';
137140
])
138141
+ g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false),
139142

140-
sessionsExpiredPanel:
141-
g.panel.timeSeries.new('Expired sessions')
142-
+ g.panel.timeSeries.panelOptions.withDescription('Number of sessions that have expired for a deployment over time')
143+
transactionsInFlightPanel:
144+
g.panel.timeSeries.new('In-flight transactions')
145+
+ g.panel.timeSeries.panelOptions.withDescription('Number of transactions that are in-flight over time')
143146
+ g.panel.timeSeries.queryOptions.withTargets([
144-
signals.overview.expiredSessions.asTarget()
145-
+ g.query.prometheus.withInterval('2m')
147+
signals.datasourceTransaction.transactionsInFlight.asTarget()
146148
+ g.query.prometheus.withIntervalFactor(2),
147149
])
148-
+ g.panel.timeSeries.standardOptions.withDecimals(0)
149150
+ g.panel.timeSeries.standardOptions.thresholds.withSteps([
150151
{ color: 'green', value: null },
151152
{ color: 'red', value: 80 },
152153
])
153154
+ g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false),
154155

155-
sessionsRejectedPanel:
156-
g.panel.timeSeries.new('Rejected sessions')
157-
+ g.panel.timeSeries.panelOptions.withDescription('Number of sessions that have been rejected from a deployment over time')
156+
transactionsAbortedPanel:
157+
g.panel.timeSeries.new('Aborted transactions')
158+
+ g.panel.timeSeries.panelOptions.withDescription('Number of transactions that have been aborted over time')
158159
+ g.panel.timeSeries.queryOptions.withTargets([
159-
signals.overview.rejectedSessions.asTarget()
160+
signals.datasourceTransaction.transactionsAborted.asTarget()
160161
+ g.query.prometheus.withInterval('2m')
161162
+ g.query.prometheus.withIntervalFactor(2),
162163
])
163-
+ g.panel.timeSeries.standardOptions.withDecimals(0)
164164
+ g.panel.timeSeries.standardOptions.thresholds.withSteps([
165165
{ color: 'green', value: null },
166166
{ color: 'red', value: 80 },
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
function(this)
2+
{
3+
filteringSelector: this.filteringSelector,
4+
groupLabels: this.groupLabels,
5+
instanceLabels: this.instanceLabels,
6+
enableLokiLogs: this.enableLokiLogs,
7+
aggLevel: 'none',
8+
aggFunction: 'avg',
9+
alertsInterval: '5m',
10+
discoveryMetric: {
11+
prometheus: 'wildfly_transactions_number_of_transactions_total',
12+
},
13+
signals:
14+
{ // Transactions signals
15+
transactionsCreated: {
16+
name: 'Created transactions',
17+
nameShort: 'Created transactions',
18+
type: 'counter',
19+
description: 'Number of transactions that were created over time',
20+
sources: {
21+
prometheus: {
22+
expr: 'wildfly_transactions_number_of_transactions_total{%(queriesSelector)s}',
23+
rangeFunction: 'increase',
24+
legendCustomTemplate: '{{instance}}',
25+
},
26+
},
27+
},
28+
transactionsInFlight: {
29+
name: 'In-flight transactions',
30+
nameShort: 'In-flight transactions',
31+
type: 'gauge',
32+
description: 'Number of transactions that are in-flight over time',
33+
sources: {
34+
prometheus: {
35+
expr: 'wildfly_transactions_number_of_inflight_transactions{%(queriesSelector)s}',
36+
legendCustomTemplate: '{{instance}}',
37+
},
38+
},
39+
},
40+
transactionsAborted: {
41+
name: 'Aborted transactions',
42+
nameShort: 'Aborted transactions',
43+
type: 'counter',
44+
description: 'Number of transactions that have been aborted over time',
45+
sources: {
46+
prometheus: {
47+
expr: 'wildfly_transactions_number_of_aborted_transactions_total{%(queriesSelector)s}',
48+
rangeFunction: 'increase',
49+
legendCustomTemplate: '{{instance}}',
50+
},
51+
},
52+
},
53+
},
54+
}
55+

wildfly-mixin/signals/datasource.libsonnet

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function(this)
33
{
44
filteringSelector: this.filteringSelector,
55
groupLabels: this.groupLabels,
6-
instanceLabels: this.instanceLabels,
6+
instanceLabels: this.instanceLabels + ['data_source'],
77
enableLokiLogs: this.enableLokiLogs,
88
aggLevel: 'none',
99
aggFunction: 'avg',
@@ -20,7 +20,7 @@ function(this)
2020
description: 'Connections to the datasource over time',
2121
sources: {
2222
prometheus: {
23-
expr: 'wildfly_datasources_pool_in_use_count{%(queriesSelector)s,data_source=~"$datasource"}',
23+
expr: 'wildfly_datasources_pool_in_use_count{%(queriesSelector)s}',
2424
legendCustomTemplate: '{{data_source}}',
2525
},
2626
},
@@ -32,49 +32,10 @@ function(this)
3232
description: 'Idle connections to the datasource over time',
3333
sources: {
3434
prometheus: {
35-
expr: 'wildfly_datasources_pool_idle_count{%(queriesSelector)s,data_source=~"$datasource"}',
35+
expr: 'wildfly_datasources_pool_idle_count{%(queriesSelector)s}',
3636
legendCustomTemplate: '{{data_source}}',
3737
},
3838
},
3939
},
40-
// Transactions signals
41-
transactionsCreated: {
42-
name: 'Created transactions',
43-
nameShort: 'Created transactions',
44-
type: 'counter',
45-
description: 'Number of transactions that were created over time',
46-
sources: {
47-
prometheus: {
48-
expr: 'wildfly_transactions_number_of_transactions_total{%(queriesSelector)s}',
49-
rangeFunction: 'increase',
50-
legendCustomTemplate: '{{instance}}',
51-
},
52-
},
53-
},
54-
transactionsInFlight: {
55-
name: 'In-flight transactions',
56-
nameShort: 'In-flight transactions',
57-
type: 'gauge',
58-
description: 'Number of transactions that are in-flight over time',
59-
sources: {
60-
prometheus: {
61-
expr: 'wildfly_transactions_number_of_inflight_transactions{%(queriesSelector)s}',
62-
legendCustomTemplate: '{{instance}}',
63-
},
64-
},
65-
},
66-
transactionsAborted: {
67-
name: 'Aborted transactions',
68-
nameShort: 'Aborted transactions',
69-
type: 'counter',
70-
description: 'Number of transactions that have been aborted over time',
71-
sources: {
72-
prometheus: {
73-
expr: 'wildfly_transactions_number_of_aborted_transactions_total{%(queriesSelector)s}',
74-
rangeFunction: 'increase',
75-
legendCustomTemplate: '{{instance}}',
76-
},
77-
},
78-
},
7940
},
8041
}

0 commit comments

Comments
 (0)