feat: plugin call should be invoked even template object has no records
Tested with Rest qtree template where filtered qtrees such that no qtrees would be exported/populated.
qtree_labels records would be zero, but
quota_disk_limit and other quota records would be populated as expected.
verified local ci tests as well.
Side effect of this change: Rest.go and Zapi.go warn line always be logged, might be spamming if no qtree objects.
Handled these cases:
- No instances without flag in Rest:
harvest % ./bin/poller -p sar -c Rest -o Qtree --promPort 13001
2024-07-09T15:17:59+05:30 INF poller/poller.go:226 > Init Poller=sar asup=false confPath=conf config=harvest.yml configPath=harvest.yml cwd=/Users/hardikl/Documents/Harvest/harvest daemon=false debug=false homePath= hostname=hardikl-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=13001 version="harvest version 24.07.09-1 (commit b1bcc9f5) (build date 2024-07-09T15:17:28+0530) darwin/amd64"
2024-07-09T15:17:59+05:30 INF poller/poller.go:250 > started in foreground Poller=sar pid=10882
2024-07-09T15:18:00+05:30 INF collector/helpers.go:96 > best-fit template Poller=sar collector=Rest:Qtree jitter=none path=conf/rest/9.12.0/qtree.yaml v=9.15.1
2024-07-09T15:18:01+05:30 INF poller/poller.go:380 > Autosupport scheduled. Poller=sar asupSchedule=24h
2024-07-09T15:18:01+05:30 INF prometheus/httpd.go:40 > server listen Poller=sar exporter=prometheus1 url=http://:13001/metrics
2024-07-09T15:18:01+05:30 INF poller/poller.go:389 > poller start-up complete Poller=sar
2024-07-09T15:18:01+05:30 INF poller/poller.go:544 > updated status, up collectors: 1 (of 1), up exporters: 1 (of 1) Poller=sar
2024-07-09T15:18:01+05:30 INF poller/poller.go:1301 > Metadata Poller=sar maxRssKB=10560 rssKB=10560 version="harvest version 24.07.09-1 (commit b1bcc9f5) (build date 2024-07-09T15:17:28+0530) darwin/amd64"
2024-07-09T15:18:01+05:30 INF collector/collector.go:591 > Collected Poller=sar apiMs=403 bytesRx=0 collector=Rest:Qtree metrics=0 numCalls=0 pollMs=403 task=counter zBegin=1720518481520
2024-07-09T15:18:05+05:30 WRN rest/rest.go:407 > no Qtree instances on cluster Poller=sar collector=Rest:Qtree
2024-07-09T15:18:05+05:30 INF collector/collector.go:395 > no instances, entering standby Poller=sar collector=Rest:Qtree task=data
- No instances with flag in Rest:
harvest % ./bin/poller -p sar -c Rest -o Qtree --promPort 13001
2024-07-09T14:40:57+05:30 INF poller/poller.go:226 > Init Poller=sar asup=false confPath=conf config=harvest.yml configPath=harvest.yml cwd=/Users/hardikl/Documents/Harvest/harvest daemon=false debug=false homePath= hostname=hardikl-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=13001 version="harvest version 24.07.09-1 (commit b1bcc9f5) (build date 2024-07-09T14:40:46+0530) darwin/amd64"
2024-07-09T14:40:57+05:30 INF poller/poller.go:250 > started in foreground Poller=sar pid=6102
2024-07-09T14:40:58+05:30 INF collector/helpers.go:96 > best-fit template Poller=sar collector=Rest:Qtree jitter=none path=conf/rest/9.12.0/qtree.yaml v=9.15.1
2024-07-09T14:40:59+05:30 INF poller/poller.go:380 > Autosupport scheduled. Poller=sar asupSchedule=24h
2024-07-09T14:40:59+05:30 INF poller/poller.go:389 > poller start-up complete Poller=sar
2024-07-09T14:40:59+05:30 INF prometheus/httpd.go:40 > server listen Poller=sar exporter=prometheus1 url=http://:13001/metrics
2024-07-09T14:41:00+05:30 INF poller/poller.go:544 > updated status, up collectors: 1 (of 1), up exporters: 1 (of 1) Poller=sar
2024-07-09T14:41:00+05:30 INF poller/poller.go:1301 > Metadata Poller=sar maxRssKB=10528 rssKB=10528 version="harvest version 24.07.09-1 (commit b1bcc9f5) (build date 2024-07-09T14:40:46+0530) darwin/amd64"
2024-07-09T14:41:00+05:30 INF collector/collector.go:591 > Collected Poller=sar apiMs=438 bytesRx=0 collector=Rest:Qtree metrics=0 numCalls=0 pollMs=438 task=counter zBegin=1720516259703
2024-07-09T14:41:04+05:30 WRN rest/rest.go:407 > no Qtree instances on cluster Poller=sar collector=Rest:Qtree
2024-07-09T14:41:05+05:30 INF qtree/qtree.go:197 > Collected Poller=sar metrics=484 numQuotas=44 object=Qtree plugin=Rest:Qtree
2024-07-09T14:41:05+05:30 INF collector/collector.go:591 > Collected Poller=sar apiMs=0 bytesRx=28912 calcMs=0 collector=Rest:Qtree exportMs=6 instances=0 instancesExported=484 metrics=0 metricsExported=506 numCalls=1 parseMs=0 pluginInstances=44 pluginMs=1107 pollMs=5307 zBegin=1720516260141
- Error with flag in Rest:
harvest % ./bin/poller -p sar -c Rest -o Qtree --promPort 13001
2024-07-09T14:42:52+05:30 INF poller/poller.go:226 > Init Poller=sar asup=false confPath=conf config=harvest.yml configPath=harvest.yml cwd=/Users/hardikl/Documents/Harvest/harvest daemon=false debug=false homePath= hostname=hardikl-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=13001 version="harvest version 24.07.09-1 (commit b1bcc9f5) (build date 2024-07-09T14:42:43+0530) darwin/amd64"
2024-07-09T14:42:52+05:30 INF poller/poller.go:250 > started in foreground Poller=sar pid=6346
2024-07-09T14:42:54+05:30 INF collector/helpers.go:96 > best-fit template Poller=sar collector=Rest:Qtree jitter=none path=conf/rest/9.12.0/qtree.yaml v=9.15.1
2024-07-09T14:42:55+05:30 INF poller/poller.go:380 > Autosupport scheduled. Poller=sar asupSchedule=24h
2024-07-09T14:42:55+05:30 INF poller/poller.go:389 > poller start-up complete Poller=sar
2024-07-09T14:42:55+05:30 INF prometheus/httpd.go:40 > server listen Poller=sar exporter=prometheus1 url=http://:13001/metrics
2024-07-09T14:42:55+05:30 INF poller/poller.go:544 > updated status, up collectors: 1 (of 1), up exporters: 1 (of 1) Poller=sar
2024-07-09T14:42:55+05:30 INF poller/poller.go:1301 > Metadata Poller=sar maxRssKB=10444 rssKB=10444 version="harvest version 24.07.09-1 (commit b1bcc9f5) (build date 2024-07-09T14:42:43+0530) darwin/amd64"
2024-07-09T14:42:55+05:30 INF collector/collector.go:591 > Collected Poller=sar apiMs=420 bytesRx=0 collector=Rest:Qtree metrics=0 numCalls=0 pollMs=421 task=counter zBegin=1720516375192
2024-07-09T14:43:00+05:30 WRN rest/rest.go:402 > error while fetching Qtree records on cluster Poller=sar collector=Rest:Qtree
2024-07-09T14:43:02+05:30 INF qtree/qtree.go:197 > Collected Poller=sar metrics=484 numQuotas=44 object=Qtree plugin=Rest:Qtree
2024-07-09T14:43:02+05:30 INF collector/collector.go:591 > Collected Poller=sar apiMs=0 bytesRx=28912 calcMs=0 collector=Rest:Qtree exportMs=5 instances=0 instancesExported=484 metrics=0 metricsExported=506 numCalls=1 parseMs=0 pluginInstances=44 pluginMs=1807 pollMs=6585 zBegin=1720516375613
- No instances without flag in Zapi:
harvest % ./bin/poller -p sar -c Zapi -o Qtree --promPort 13001
2024-07-09T15:13:46+05:30 INF poller/poller.go:226 > Init Poller=sar asup=false confPath=conf config=harvest.yml configPath=harvest.yml cwd=/Users/hardikl/Documents/Harvest/harvest daemon=false debug=false homePath= hostname=hardikl-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=13001 version="harvest version 24.07.09-1 (commit b1bcc9f5) (build date 2024-07-09T15:13:09+0530) darwin/amd64"
2024-07-09T15:13:46+05:30 INF poller/poller.go:250 > started in foreground Poller=sar pid=10515
2024-07-09T15:13:49+05:30 INF collector/helpers.go:96 > best-fit template Poller=sar collector=Zapi:Qtree jitter=none path=conf/zapi/cdot/9.8.0/qtree.yaml v=9.15.1
2024-07-09T15:13:51+05:30 INF poller/poller.go:380 > Autosupport scheduled. Poller=sar asupSchedule=24h
2024-07-09T15:13:51+05:30 INF poller/poller.go:389 > poller start-up complete Poller=sar
2024-07-09T15:13:51+05:30 INF prometheus/httpd.go:40 > server listen Poller=sar exporter=prometheus1 url=http://:13001/metrics
2024-07-09T15:13:51+05:30 INF poller/poller.go:544 > updated status, up collectors: 1 (of 1), up exporters: 1 (of 1) Poller=sar
2024-07-09T15:13:51+05:30 INF poller/poller.go:1301 > Metadata Poller=sar maxRssKB=10840 rssKB=10840 version="harvest version 24.07.09-1 (commit b1bcc9f5) (build date 2024-07-09T15:13:09+0530) darwin/amd64"
2024-07-09T15:13:57+05:30 WRN collector/zapi.go:415 > no Qtree instances on cluster Poller=sar collector=Zapi:Qtree
2024-07-09T15:13:57+05:30 INF collector/collector.go:395 > no instances, entering standby Poller=sar collector=Zapi:Qtree task=data
- No instances with flag in Zapi:
harvest % ./bin/poller -p sar -c Zapi -o Qtree --promPort 13001
2024-07-09T15:14:56+05:30 INF poller/poller.go:226 > Init Poller=sar asup=false confPath=conf config=harvest.yml configPath=harvest.yml cwd=/Users/hardikl/Documents/Harvest/harvest daemon=false debug=false homePath= hostname=hardikl-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=13001 version="harvest version 24.07.09-1 (commit b1bcc9f5) (build date 2024-07-09T15:13:09+0530) darwin/amd64"
2024-07-09T15:14:56+05:30 INF poller/poller.go:250 > started in foreground Poller=sar pid=10564
2024-07-09T15:14:59+05:30 INF collector/helpers.go:96 > best-fit template Poller=sar collector=Zapi:Qtree jitter=none path=conf/zapi/cdot/9.8.0/qtree.yaml v=9.15.1
2024-07-09T15:15:00+05:30 INF poller/poller.go:380 > Autosupport scheduled. Poller=sar asupSchedule=24h
2024-07-09T15:15:00+05:30 INF poller/poller.go:389 > poller start-up complete Poller=sar
2024-07-09T15:15:00+05:30 INF prometheus/httpd.go:40 > server listen Poller=sar exporter=prometheus1 url=http://:13001/metrics
2024-07-09T15:15:00+05:30 INF poller/poller.go:544 > updated status, up collectors: 1 (of 1), up exporters: 1 (of 1) Poller=sar
2024-07-09T15:15:00+05:30 INF poller/poller.go:1301 > Metadata Poller=sar maxRssKB=10832 rssKB=10832 version="harvest version 24.07.09-1 (commit b1bcc9f5) (build date 2024-07-09T15:13:09+0530) darwin/amd64"
2024-07-09T15:15:05+05:30 WRN collector/zapi.go:415 > no Qtree instances on cluster Poller=sar collector=Zapi:Qtree
2024-07-09T15:15:07+05:30 INF qtree/qtree.go:232 > Collected Poller=sar apiD=1.751s batchSize=500 metrics=392 numQuotas=49 object=Qtree parseD=20ms plugin=Zapi:Qtree
- Error with flag in Zapi:
harvest % ./bin/poller -p sar -c Zapi -o Qtree --promPort 13001
2024-07-09T15:00:59+05:30 INF poller/poller.go:226 > Init Poller=sar asup=false confPath=conf config=harvest.yml configPath=harvest.yml cwd=/Users/hardikl/Documents/Harvest/harvest daemon=false debug=false homePath= hostname=hardikl-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=13001 version="harvest version 24.07.09-1 (commit b1bcc9f5) (build date 2024-07-09T15:00:47+0530) darwin/amd64"
2024-07-09T15:00:59+05:30 INF poller/poller.go:250 > started in foreground Poller=sar pid=8659
2024-07-09T15:01:02+05:30 INF collector/helpers.go:96 > best-fit template Poller=sar collector=Zapi:Qtree jitter=none path=conf/zapi/cdot/9.8.0/qtree.yaml v=9.15.1
2024-07-09T15:01:03+05:30 INF poller/poller.go:380 > Autosupport scheduled. Poller=sar asupSchedule=24h
2024-07-09T15:01:03+05:30 INF poller/poller.go:389 > poller start-up complete Poller=sar
2024-07-09T15:01:03+05:30 INF prometheus/httpd.go:40 > server listen Poller=sar exporter=prometheus1 url=http://:13001/metrics
2024-07-09T15:01:04+05:30 INF poller/poller.go:544 > updated status, up collectors: 1 (of 1), up exporters: 1 (of 1) Poller=sar
2024-07-09T15:01:04+05:30 INF poller/poller.go:1301 > Metadata Poller=sar maxRssKB=10852 rssKB=10852 version="harvest version 24.07.09-1 (commit b1bcc9f5) (build date 2024-07-09T15:00:47+0530) darwin/amd64"
2024-07-09T15:01:06+05:30 WRN collector/zapi.go:344 > error while fetching Qtree records on cluster Poller=sar collector=Zapi:Qtree
2024-07-09T15:01:07+05:30 INF qtree/qtree.go:232 > Collected Poller=sar apiD=1.154s batchSize=500 metrics=392 numQuotas=49 object=Qtree parseD=7ms plugin=Zapi:Qtree
2024-07-09T15:01:07+05:30 INF collector/collector.go:591 > Collected Poller=sar apiMs=0 bytesRx=29769 calcMs=0 collector=Zapi:Qtree exportMs=4 instances=0 instancesExported=392 metrics=0 metricsExported=408 numCalls=1 parseMs=0 pluginInstances=49 pluginMs=1163 pollMs=3914 zBegin=1720517463787
Changes done for
- [x] Rest
- [x] Without qtreeMetrics, historicalLabels -> tested only quota_xxx without qtree labels were generated
- [x] With only historicalLabels -> tested qtree_xxx and quota_xxx with qtree labels were generated
- [x] with only qtreeMetrics -> tested quota_xxx and qtree_xxx generated without qtree labels
- [x] Zapi cdot
- [x] Without qtreeMetrics, historicalLabels -> tested only quota_xxx without qtree labels were generated
- [x] With only qtreeMetrics -> tested quota_xxx and qtree_xxx generated without qtree labels
- [x] With only historicalLabels -> tested qtree_xxx and quota_xxx with qtree labels were generated
- [x] Zapi 7mode
- [x] Without qtreeMetrics, historicalLabels -> tested only quota_xxx without qtree labels were generated
- [x] With only qtreeMetrics -> tested quota_xxx and qtree_xxx generated without qtree labels
- [x] With only historicalLabels -> tested qtree_xxx and quota_xxx with qtree labels were generated
Challenges found so far:
- There are cases where
qtree="", in that case calling qtree api call and fetching 4 labels populate in map or some other way and adding them in quota metrics won't be working.
Challenges found so far:
2. Current quota metrics value would be -1, when response is -, whereas if historicalLabels flag is applied, metric value should be 0, which would be quite challenging.