Skip to content

Commit 3b91d7d

Browse files
committed
Merge branch 'master' into ana/add-alert-for-gcpce-cpu
2 parents 5e77d88 + b4993cb commit 3b91d7d

File tree

20 files changed

+845
-109
lines changed

20 files changed

+845
-109
lines changed

.github/workflows/lint-mixins.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
name: Mixin
3+
4+
permissions:
5+
contents: read
6+
7+
on:
8+
# To conserve resources we only run tests against main in PRs
9+
pull_request:
10+
branches:
11+
- master
12+
13+
jobs:
14+
check-for-changed-mixins:
15+
name: Check for changes
16+
runs-on: ubuntu-latest
17+
outputs:
18+
changed-mixins: ${{ steps.changed-mixins.outputs.all_changed_files }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Setup Go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version: 1.18
29+
30+
- name: Install CI dependencies
31+
run: make install-ci-deps
32+
33+
- name: Get changed mixins
34+
id: changed-mixins
35+
uses: tj-actions/changed-files@v44
36+
with:
37+
dir_names: true
38+
dir_names_exclude_current_dir: true
39+
dir_names_max_depth: 1
40+
files: |
41+
**-mixin/
42+
**-observ-lib/
43+
matrix: true
44+
45+
- name: List all changed mixins
46+
run: echo '${{ steps.changed-mixins.outputs.all_changed_files }}'
47+
48+
lint-mixin:
49+
name: Run Mixtool
50+
runs-on: ubuntu-latest
51+
permissions:
52+
issues: write
53+
contents: write
54+
pull-requests: write
55+
repository-projects: write
56+
timeout-minutes: 15
57+
needs: [check-for-changed-mixins]
58+
strategy:
59+
matrix:
60+
mixin: ${{ fromJSON(needs.check-for-changed-mixins.outputs.changed-mixins) }}
61+
fail-fast: false
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v4
65+
with:
66+
fetch-depth: 0
67+
68+
- name: Setup Go
69+
uses: actions/setup-go@v5
70+
with:
71+
go-version: 1.18
72+
73+
- name: Install CI dependencies
74+
run: make install-ci-deps
75+
76+
- name: Install Mixin dependencies
77+
working-directory: ./${{ matrix.mixin }}
78+
run: jb install
79+
80+
- name: Lint Mixin
81+
working-directory: ./${{ matrix.mixin }}
82+
run: mixtool lint mixin.libsonnet

cilium-enterprise-mixin/alerts/ciliumAlerts.libsonnet

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,76 @@
272272
},
273273
],
274274
},
275+
{
276+
name: 'Cilium Clustermesh',
277+
rules: [
278+
{
279+
alert: 'CiliumAgentRemoteClusterNotReady',
280+
expr: 'count(cilium_clustermesh_remote_cluster_readiness_status < 1) by (%s) > 0' % std.join(', ', (['source_cluster', 'target_cluster'] + $._config.alertAggregationLabels)),
281+
labels: {
282+
severity: 'critical',
283+
},
284+
annotations: {
285+
summary: "Agent can't mesh with remote cluster.",
286+
description: "Agent can't mesh with {{$labels.target_cluster}}",
287+
},
288+
'for': '5m',
289+
},
290+
{
291+
alert: 'CiliumAgentRemoteClusterFailing',
292+
expr: 'sum(rate(cilium_clustermesh_remote_cluster_failures[5m])) by (%s) > 0' % std.join(', ', (['source_cluster', 'target_cluster'] + $._config.alertAggregationLabels)),
293+
labels: {
294+
severity: 'critical',
295+
},
296+
annotations: {
297+
summary: 'Agent fails to mesh with remote cluster.',
298+
description: 'Agent fails to mesh with {{$labels.target_cluster}}',
299+
},
300+
'for': '5m',
301+
},
302+
],
303+
},
304+
{
305+
name: 'Cilium Kvstoremesh',
306+
rules: [
307+
{
308+
alert: 'CiliumKvstoremeshRemoteClusterNotReady',
309+
expr: 'count(cilium_kvstoremesh_remote_cluster_readiness_status < 1) by (%s) > 0' % std.join(', ', (['source_cluster', 'target_cluster'] + $._config.alertAggregationLabels)),
310+
labels: {
311+
severity: 'critical',
312+
},
313+
annotations: {
314+
summary: "Kvstoremesh can't mesh with remote cluster.",
315+
description: "Kvstoremesh can't mesh with {{$labels.target_cluster}}",
316+
},
317+
'for': '5m',
318+
},
319+
{
320+
alert: 'CiliumKvstoremeshRemoteClusterFailing',
321+
expr: 'sum(rate(cilium_kvstoremesh_remote_cluster_failures[5m])) by (%s) > 0' % std.join(', ', (['source_cluster', 'target_cluster'] + $._config.alertAggregationLabels)),
322+
labels: {
323+
severity: 'critical',
324+
},
325+
annotations: {
326+
summary: 'Kvstoremesh fails to mesh with remote cluster.',
327+
description: 'Kvstoremesh fails to mesh with {{$labels.target_cluster}}',
328+
},
329+
'for': '5m',
330+
},
331+
{
332+
alert: 'CiliumKvstoremeshErrors',
333+
expr: 'sum(rate(cilium_kvstoremesh_kvstore_sync_errors_total[5m])) by (%s) > 0' % std.join(', ', (['source_cluster'] + $._config.alertAggregationLabels)),
334+
labels: {
335+
severity: 'critical',
336+
},
337+
annotations: {
338+
summary: 'Kvstoremesh fails to mesh with remote cluster.',
339+
description: 'Kvstoremesh fails to mesh with {{$labels.target_cluster}}',
340+
},
341+
'for': '5m',
342+
},
343+
],
344+
},
275345
],
276346
},
277347
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": 1,
3+
"dependencies": [],
4+
"legacyImports": false
5+
}
6+

common-lib/common/panels/cpu/stat/count.libsonnet

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ base {
1616

1717
stylize(allLayers=true):
1818
(if allLayers then super.stylize() else {})
19-
+ generic.info.stylize(allLayers=false),
19+
+ generic.info.stylize(allLayers=false)
20+
+ g.panel.stat.standardOptions.withUnit('none'),
2021

2122
}

common-lib/common/panels/disk/table/usage.libsonnet

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,13 @@ base {
245245
fieldOverride.byName.new('Available')
246246
+ fieldOverride.byName.withProperty('custom.width', '80'),
247247
fieldOverride.byName.new('Used, %')
248-
+ fieldOverride.byName.withProperty('custom.displayMode', 'basic')
248+
+ fieldOverride.byName.withProperty(
249+
'custom.cellOptions', {
250+
type: 'gauge',
251+
mode: 'basic',
252+
valueDisplayMode: 'text',
253+
}
254+
)
249255
+ fieldOverride.byName.withPropertiesFromOptions(
250256
table.standardOptions.withMax(1)
251257
+ table.standardOptions.withMin(0)

common-lib/common/variables/variables.libsonnet

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,21 @@ local utils = import '../utils.libsonnet';
5959
[root.datasources.prometheus]
6060
+ variablesFromLabels(groupLabels, instanceLabels, filteringSelector, multiInstance=false),
6161
queriesSelectorAdvancedSyntax:
62-
'%s' % [
63-
utils.labelsToPromQLSelectorAdvanced(groupLabels + instanceLabels),
64-
],
62+
std.join(
63+
',',
64+
std.filter(function(x) std.length(x) > 0, [
65+
filteringSelector,
66+
utils.labelsToPromQLSelectorAdvanced(groupLabels + instanceLabels),
67+
])
68+
),
6569
queriesSelector:
66-
'%s,%s' % [
67-
filteringSelector,
68-
utils.labelsToPromQLSelector(groupLabels + instanceLabels),
69-
],
70+
std.join(
71+
',',
72+
std.filter(function(x) std.length(x) > 0, [
73+
filteringSelector,
74+
utils.labelsToPromQLSelector(groupLabels + instanceLabels),
75+
])
76+
),
7077

7178
}
7279
+ if enableLokiLogs then self.withLokiLogs() else {},

logs-lib/jsonnetfile.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"source": {
66
"git": {
77
"remote": "https://github.com/grafana/grafonnet.git",
8-
"subdir": "gen/grafonnet-v10.0.0"
8+
"subdir": "gen/grafonnet-v11.0.0"
99
}
1010
},
1111
"version": "main"

logs-lib/logs/dashboards.libsonnet

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,20 @@ function(
1313
+ g.dashboard.withUid(g.util.string.slugify(title))
1414
+ g.dashboard.withVariables(variables.toArray)
1515
+ g.dashboard.withPanels(
16-
(
17-
if showLogsVolume then
18-
[panels.logsVolume
19-
+ g.panel.timeSeries.gridPos.withH(6)
20-
+ g.panel.timeSeries.gridPos.withW(24)]
21-
else []
16+
g.util.grid.wrapPanels(
17+
(
18+
if showLogsVolume then
19+
[panels.logsVolume
20+
+ g.panel.timeSeries.gridPos.withH(6)
21+
+ g.panel.timeSeries.gridPos.withW(24)]
22+
else []
23+
)
24+
+
25+
[
26+
panels.logs
27+
+ g.panel.logs.gridPos.withH(18)
28+
+ g.panel.logs.gridPos.withW(24),
29+
]
2230
)
23-
+
24-
[
25-
panels.logs
26-
+ g.panel.logs.gridPos.withH(18)
27-
+ g.panel.logs.gridPos.withW(24),
28-
]
2931
),
3032
}

logs-lib/logs/g.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import 'github.com/grafana/grafonnet/gen/grafonnet-v10.0.0/main.libsonnet'
1+
import 'github.com/grafana/grafonnet/gen/grafonnet-v11.0.0/main.libsonnet'

nginx-mixin/.lint

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ exclusions:
55
reason: "Units are undefined where panel description is clear, and the entity being graphed is not available in default set of available units."
66
template-datasource-rule:
77
reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion"
8+
template-job-rule:
9+
reason: "NGINX Overview dashboard does not use a job label"
10+
target-job-rule:
11+
reason: "NGINX Overview dashboard does not use a job label"
12+
target-rate-interval-rule:
13+
reason: "using $__rate_interval breaks the dashboard hence using [5m] instead"

0 commit comments

Comments
 (0)