Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit ec56f34

Browse files
author
Andrey Vazhenin
committed
DMP-3004: added notes, fix the err checking
1 parent 2714d78 commit ec56f34

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

namespaces.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ func (nc nsCollector) describe(ch chan<- *prometheus.Desc) {
271271
}
272272

273273
func (nc nsCollector) parseStorage(s string, d string) (string, error) {
274+
// the function remove the storage prefix metrics for each device:
275+
// d is storage-engine.device[ix]
276+
// s is all storage metrics that has been scraped
277+
// storage-engine.device[ix].age -> age
278+
// https://www.aerospike.com/docs/reference/metrics/#storage-engine.device[ix].age
274279
buf := bytes.Buffer{}
275280
for _, l := range strings.Split(s, ";") {
276281
for _, v := range strings.Split(l, ":") {
@@ -334,6 +339,11 @@ func (nc nsCollector) collect(conn *as.Connection) ([]prometheus.Metric, error)
334339

335340
for mountName, metricName := range nsInfoStorageDevices {
336341
nsInfoStorage, err = nc.parseStorage(nsInfoStorage, metricName)
342+
343+
if err != nil {
344+
return nil, err
345+
}
346+
337347
metrics = append(
338348
metrics,
339349
infoCollect(cmetrics(nc), nsInfoStorage, ns, mountName)...,

0 commit comments

Comments
 (0)