Skip to content

Commit f56b211

Browse files
authored
Update windows observ lib (#1102)
- Rename CPU count -> Cores in fleet table - Change filesystem space available TS graph to bytes (same as linux) - Add networkErrorsAndDroppedPerSec(use in overview) and networkErrorsAndDroppedPerSecTopK(use in fleet dashboard) panels for errs and drops together - Add fleet table footer (same as linux)
1 parent 6281873 commit f56b211

File tree

2 files changed

+62
-11
lines changed

2 files changed

+62
-11
lines changed

windows-observ-lib/dashboards.libsonnet

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ local logslib = import 'github.com/grafana/jsonnet-libs/logs-lib/logs/main.libso
2727
panels.memotyUsageTopKPercent { gridPos+: { w: 24 } },
2828
panels.diskIOutilPercentTopK { gridPos+: { w: 12 } },
2929
panels.diskUsagePercentTopK { gridPos+: { w: 12 } },
30-
panels.networkErrorsAndDroppedPerSec { gridPos+: { w: 24 } },
30+
panels.networkErrorsAndDroppedPerSecTopK { gridPos+: { w: 24 } },
3131
], 12, 7
3232
)
3333
)
@@ -57,7 +57,7 @@ local logslib = import 'github.com/grafana/jsonnet-libs/logs-lib/logs/main.libso
5757
panels.diskUsage { gridPos+: { w: 12, h: 8 } },
5858
g.panel.row.new('Network'),
5959
panels.networkUsagePerSec { gridPos+: { w: 12, h: 8 } },
60-
panels.networkErrorsPerSec { gridPos+: { w: 12, h: 8 } },
60+
panels.networkErrorsAndDroppedPerSec { gridPos+: { w: 12, h: 8 } },
6161
], 6, 2
6262
)
6363
)
@@ -92,7 +92,7 @@ local logslib = import 'github.com/grafana/jsonnet-libs/logs-lib/logs/main.libso
9292
g.util.grid.wrapPanels(
9393
[
9494
g.panel.row.new('Disk'),
95-
panels.diskUsagePercent,
95+
panels.diskFreeTs,
9696
panels.diskUsage,
9797
panels.diskIOBytesPerSec,
9898
panels.diskIOps,

windows-observ-lib/panels.libsonnet

Lines changed: 59 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ local utils = commonlib.utils;
2424
t.cpuCount
2525
+ g.query.prometheus.withFormat('table')
2626
+ g.query.prometheus.withInstant(true)
27-
+ g.query.prometheus.withRefId('CPU count'),
27+
+ g.query.prometheus.withRefId('Cores'),
2828
t.cpuUsage
2929
+ g.query.prometheus.withFormat('table')
3030
+ g.query.prometheus.withInstant(true)
@@ -56,6 +56,18 @@ local utils = commonlib.utils;
5656
],
5757
description="All Windows instances' perfomance at a glance."
5858
)
59+
+ g.panel.table.options.withFooter(
60+
value={
61+
reducer: ['sum'],
62+
show: true,
63+
fields: [
64+
'Value #Cores',
65+
'Value #Load 1',
66+
'Value #Memory total',
67+
'Value #Disk C: total',
68+
],
69+
}
70+
)
5971
+ commonlib.panels.system.table.uptime.stylizeByName('Uptime')
6072
+ table.standardOptions.withOverridesMixin([
6173
fieldOverride.byRegexp.new('Product|^Hostname$')
@@ -78,7 +90,7 @@ local utils = commonlib.utils;
7890
url: 'd/%s?var-${__field.name}=${__value.text}&${__url_time_range}' % [this.grafana.dashboards.fleet.uid],
7991
},
8092
]),
81-
fieldOverride.byName.new('CPU count')
93+
fieldOverride.byName.new('Cores')
8294
+ fieldOverride.byName.withProperty('custom.width', '120'),
8395
fieldOverride.byName.new('CPU usage')
8496
+ fieldOverride.byName.withProperty('custom.width', '120')
@@ -195,7 +207,7 @@ local utils = commonlib.utils;
195207
commonlib.panels.system.statusHistory.ntp.new(
196208
'NTP status',
197209
targets=[t.timeNtpStatus],
198-
description=''
210+
description='Status of time synchronization.'
199211
)
200212
+ g.panel.timeSeries.standardOptions.withNoValue('No data. Please check that "time" collector is enabled.'),
201213
timeNtpDelay:
@@ -279,9 +291,14 @@ local utils = commonlib.utils;
279291
+ g.query.prometheus.withInstant(true),
280292
groupLabel='volume'
281293
),
282-
diskUsagePercent: commonlib.panels.disk.timeSeries.usagePercent.new(
283-
targets=[t.diskUsagePercent]
284-
),
294+
diskFreeTs:
295+
commonlib.panels.disk.timeSeries.available.new(
296+
'Filesystem space availabe',
297+
targets=[
298+
t.diskFree,
299+
],
300+
description='Filesystem space utilisation in bytes.'
301+
),
285302
diskUsagePercentTopK: commonlib.panels.generic.timeSeries.topkPercentage.new(
286303
title='Disk space usage',
287304
target=t.diskUsagePercent,
@@ -348,12 +365,42 @@ local utils = commonlib.utils;
348365
)
349366
{ options+: { reduceOptions+: { fields: '/^hostname$/' } } },
350367
networkErrorsAndDroppedPerSec:
368+
commonlib.panels.network.timeSeries.errors.new(
369+
'Network errors and dropped packets',
370+
targets=
371+
[
372+
t.networkOutErrorsPerSec,
373+
t.networkInErrorsPerSec,
374+
t.networkInUknownPerSec,
375+
t.networkOutDroppedPerSec,
376+
t.networkInDroppedPerSec,
377+
],
378+
description=|||
379+
**Network errors**:
380+
381+
Network errors refer to issues that occur during the transmission of data across a network.
382+
383+
These errors can result from various factors, including physical issues, jitter, collisions, noise and interference.
384+
385+
Monitoring network errors is essential for diagnosing and resolving issues, as they can indicate problems with network hardware or environmental factors affecting network quality.
386+
387+
**Dropped packets**:
388+
389+
Dropped packets occur when data packets traveling through a network are intentionally discarded or lost due to congestion, resource limitations, or network configuration issues.
390+
391+
Common causes include network congestion, buffer overflows, QoS settings, and network errors, as corrupted or incomplete packets may be discarded by receiving devices.
392+
393+
Dropped packets can impact network performance and lead to issues such as degraded voice or video quality in real-time applications.
394+
|||
395+
)
396+
+ commonlib.panels.network.timeSeries.errors.withNegateOutPackets(),
397+
networkErrorsAndDroppedPerSecTopK:
351398
commonlib.panels.network.timeSeries.errors.new(
352399
'Network errors and dropped packets',
353400
targets=std.map(
354401
function(t) t
355402
{
356-
expr: '(' + t.expr + ')>0.5',
403+
expr: 'topk(25, ' + t.expr + ')>0.5',
357404
legendFormat: '{{' + this.config.instanceLabels[0] + '}}: ' + std.get(t, 'legendFormat', '{{ nic }}'),
358405
},
359406
[
@@ -365,6 +412,8 @@ local utils = commonlib.utils;
365412
]
366413
),
367414
description=|||
415+
Top 25.
416+
368417
**Network errors**:
369418
370419
Network errors refer to issues that occur during the transmission of data across a network.
@@ -381,7 +430,9 @@ local utils = commonlib.utils;
381430
382431
Dropped packets can impact network performance and lead to issues such as degraded voice or video quality in real-time applications.
383432
|||
384-
),
433+
)
434+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withDrawStyle('points')
435+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withPointSize(5),
385436

386437
networkErrorsPerSec: commonlib.panels.network.timeSeries.errors.new('Network errors',
387438
targets=[t.networkInErrorsPerSec, t.networkOutErrorsPerSec, t.networkInUknownPerSec])

0 commit comments

Comments
 (0)