Skip to content

Commit b44be62

Browse files
committed
Updated signal files to align to dashboards. Reworked signals to better use builder pattern. Updated panels for best practices
1 parent 4dce8ec commit b44be62

22 files changed

+2464
-1971
lines changed

opensearch-mixin/config.libsonnet

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
{
22
local this = self,
3-
filteringSelector: if self.enableMultiCluster then 'cluster!="",opensearch_cluster!=""' else 'opensearch_cluster!=""',
4-
groupLabels: if self.enableMultiCluster then ['job', 'cluster', 'opensearch_cluster'] else ['job', 'opensearch_cluster'],
5-
logLabels: ['job', 'cluster', 'node'],
6-
instanceLabels: ['node'],
3+
filteringSelector: 'job="integrations/opensearch"',
4+
groupLabels: ['job', 'cluster', 'opensearch_cluster'],
5+
logLabels: ['job', 'cluster', 'opensearch_cluster'],
6+
instanceLabels: ['instance'],
77

8-
dashboardTags: [self.uid],
98
uid: 'opensearch',
9+
dashboardTags: [self.uid],
1010
dashboardNamePrefix: 'OpenSearch',
1111
dashboardPeriod: 'now-1h',
1212
dashboardTimezone: 'default',
1313
dashboardRefresh: '1m',
1414
metricsSource: 'prometheus', // metrics source for signals
1515

16-
// Agg Lists
17-
groupAggList: std.join(',', this.groupLabels),
18-
groupAggListWithInstance: std.join(',', this.groupLabels + this.instanceLabels),
19-
20-
// Multi-cluster support
21-
enableMultiCluster: false,
22-
opensearchSelector: if self.enableMultiCluster then 'job=~"$job", instance=~"$instance", cluster=~"$cluster"' else 'job=~"$job", instance=~"$instance"',
23-
2416
// Logging configuration
2517
enableLokiLogs: true,
2618
extraLogLabels: ['level', 'severity'], // Required by logs-lib
2719
logsVolumeGroupBy: 'level',
2820
showLogsVolume: true,
29-
logExpression: '{job=~"$job", cluster=~"$cluster", instance=~"$instance", exception_class=~".+"} | json | line_format "{{.severity}} {{.exception_class}} - {{.exception_message}}" | drop time_extracted, severity_extracted, exception_class_extracted, correlation_id_extracted',
3021

22+
// Agg Lists
23+
groupAggList: std.join(',', this.groupLabels),
24+
groupAggListWithInstance: std.join(',', this.groupLabels + this.instanceLabels),
25+
3126
// Alerts configuration
3227
alertsWarningShardReallocations: 0, // count
3328
alertsWarningShardUnassigned: 0, // count
@@ -42,11 +37,8 @@
4237

4338
// Signals configuration
4439
signals+: {
45-
cluster: (import './signals/cluster.libsonnet')(this),
46-
node: (import './signals/node.libsonnet')(this),
47-
topk: (import './signals/topk.libsonnet')(this),
48-
roles: (import './signals/roles.libsonnet')(this),
49-
search: (import './signals/search.libsonnet')(this),
50-
indexing: (import './signals/indexing.libsonnet')(this),
40+
clusterOverview: (import './signals/cluster-overview.libsonnet')(this),
41+
nodeOverview: (import './signals/node-overview.libsonnet')(this),
42+
searchAndIndexOverview: (import './signals/search-and-index-overview.libsonnet')(this),
5143
},
52-
}
44+
}

opensearch-mixin/dashboards.libsonnet

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ local logslib = import 'logs-lib/logs/main.libsonnet';
1616
{
1717

1818
'opensearch-cluster-overview.json':
19-
g.dashboard.new(this.config.dashboardNamePrefix + ' Cluster Overview')
19+
g.dashboard.new(this.config.dashboardNamePrefix + ' cluster overview')
2020
+ g.dashboard.withPanels(
2121
g.util.panel.resolveCollapsedFlagOnRows(
2222
g.util.grid.wrapPanels([
2323
this.grafana.rows.clusterOverviewRow,
24-
this.grafana.rows.rolesRow,
24+
this.grafana.rows.clusterRolesRow,
2525
this.grafana.rows.resourceUsageRow,
2626
this.grafana.rows.storageAndTasksRow,
2727
this.grafana.rows.searchPerformanceRow,
@@ -40,18 +40,24 @@ local logslib = import 'logs-lib/logs/main.libsonnet';
4040
period,
4141
),
4242
'opensearch-node-overview.json':
43-
g.dashboard.new(this.config.dashboardNamePrefix + ' Node Overview')
43+
g.dashboard.new(this.config.dashboardNamePrefix + ' node overview')
4444
+ g.dashboard.withPanels(
4545
g.util.panel.resolveCollapsedFlagOnRows(
4646
g.util.grid.wrapPanels([
47-
this.grafana.rows.nodeRolesRow,
4847
this.grafana.rows.nodeHealthRow,
48+
this.grafana.rows.nodeRolesRow,
4949
this.grafana.rows.nodeJVMRow,
5050
this.grafana.rows.threadPoolsRow,
5151
])
5252
)
5353
) + root.applyCommon(
54-
vars.multiInstance,
54+
vars.multiInstance + [
55+
g.dashboard.variable.query.new('node')
56+
+ g.dashboard.variable.custom.selectionOptions.withMulti(true)
57+
+ g.dashboard.variable.query.queryTypes.withLabelValues(label='node', metric='opensearch_os_cpu_percent{%(queriesSelector)s}' % vars)
58+
+ g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus),
59+
60+
],
5561
uid + '-node-overview',
5662
tags,
5763
links { opensearchNodeOverview+:: {} },
@@ -61,17 +67,22 @@ local logslib = import 'logs-lib/logs/main.libsonnet';
6167
period,
6268
),
6369
'opensearch-search-and-index-overview.json':
64-
g.dashboard.new(this.config.dashboardNamePrefix + ' Search and Index Overview')
70+
g.dashboard.new(this.config.dashboardNamePrefix + ' search and index overview')
6571
+ g.dashboard.withPanels(
6672
g.util.panel.resolveCollapsedFlagOnRows(
6773
g.util.grid.wrapPanels([
68-
this.grafana.rows.searchAndIndexSearchPerformanceRow,
74+
this.grafana.rows.searchAndIndexRequestPerformanceRow,
6975
this.grafana.rows.searchAndIndexIndexingPerformanceRow,
7076
this.grafana.rows.searchAndIndexCapacityRow,
7177
])
7278
)
7379
) + root.applyCommon(
74-
vars.multiInstance,
80+
vars.multiInstance + [
81+
g.dashboard.variable.query.new('index')
82+
+ g.dashboard.variable.custom.selectionOptions.withMulti(true)
83+
+ g.dashboard.variable.query.queryTypes.withLabelValues(label='index', metric='opensearch_index_search_fetch_count{%(queriesSelectorGroupOnly)s}' % vars)
84+
+ g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus),
85+
],
7586
uid + '-search-and-index-overview',
7687
tags,
7788
links { opensearchSearchAndIndexOverview+:: {} },
@@ -84,7 +95,7 @@ local logslib = import 'logs-lib/logs/main.libsonnet';
8495
} + if this.config.enableLokiLogs then {
8596
'opensearch-logs.json':
8697
logslib.new(
87-
this.config.dashboardNamePrefix + ' Logs',
98+
this.config.dashboardNamePrefix + ' logs',
8899
datasourceName=this.grafana.variables.datasources.loki.name,
89100
datasourceRegex=this.grafana.variables.datasources.loki.regex,
90101
filterSelector=this.config.filteringSelector,
@@ -96,7 +107,7 @@ local logslib = import 'logs-lib/logs/main.libsonnet';
96107
dashboards+:
97108
{
98109
logs+:
99-
root.applyCommon(vars.multiInstance, uid=uid + '-logs', tags=tags, links=links { logs+:: {} }, annotations=annotations, timezone=timezone, refresh=refresh, period=period),
110+
root.applyCommon(super.logs.templating.list, uid=uid + '-logs', tags=tags, links=links { logs+:: {} }, annotations=annotations, timezone=timezone, refresh=refresh, period=period),
100111
},
101112
panels+:
102113
{

0 commit comments

Comments
 (0)