Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding generated instances/metrics count in Health plugin log #3074

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

Hardikl
Copy link
Contributor

@Hardikl Hardikl commented Jul 30, 2024

harvest % ./bin/poller -p sarzapi -o Health --promPort 13001
2024-07-30T15:19:53+05:30 INF poller/poller.go:227 > Init Poller=sarzapi asup=false confPath=conf config=harvest.yml configPath=harvest.yml cwd=/Users/hardikl/Documents/Harvest/harvest daemon=false homePath= hostname=hardikl-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=13001 version="harvest version 24.07.30-1 (commit 9897862e) (build date 2024-07-30T15:11:58+0530) darwin/amd64"
2024-07-30T15:19:53+05:30 INF poller/poller.go:251 > started in foreground Poller=sarzapi pid=13159
2024-07-30T15:19:54+05:30 INF collector/helpers.go:97 > best-fit template Poller=sarzapi collector=Rest:Health jitter=none path=conf/rest/9.6.0/health.yaml v=9.15.1
2024-07-30T15:19:56+05:30 WRN poller/poller.go:762 > init collector-object error="template name is empty. Make sure the object is defined in your default.yaml, confPath: [conf]" Poller=sarzapi collector=Ems object=Health
2024-07-30T15:19:56+05:30 INF poller/poller.go:378 > Autosupport scheduled. Poller=sarzapi asupSchedule=24h
2024-07-30T15:19:56+05:30 INF poller/poller.go:387 > poller start-up complete Poller=sarzapi
2024-07-30T15:19:56+05:30 INF prometheus/httpd.go:40 > server listen Poller=sarzapi exporter=prometheus1 url=http://:13001/metrics
2024-07-30T15:19:57+05:30 INF poller/poller.go:595 > updated status, up collectors: 1 (of 1), up exporters: 1 (of 1) Poller=sarzapi
2024-07-30T15:19:57+05:30 INF poller/poller.go:1352 > Metadata Poller=sarzapi maxRssKB=10644 rssKB=10644 version="harvest version 24.07.30-1 (commit 9897862e) (build date 2024-07-30T15:11:58+0530) darwin/amd64"
2024-07-30T15:19:57+05:30 INF collector/collector.go:595 > Collected Poller=sarzapi apiMs=422 bytesRx=0 collector=Rest:Health metrics=0 numCalls=0 pollMs=422 task=counter zBegin=1722332996763
2024-07-30T15:19:57+05:30 INF health/health.go:658 > Collected Poller=sarzapi metrics=0 numDiskAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:19:58+05:30 INF health/health.go:560 > Collected Poller=sarzapi metrics=0 numShelfAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:19:58+05:30 INF health/health.go:614 > Collected Poller=sarzapi metrics=0 numSupportAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:19:59+05:30 INF health/health.go:465 > Collected Poller=sarzapi metrics=0 numNodeAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:19:59+05:30 INF health/health.go:512 > Collected Poller=sarzapi metrics=0 numHAAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:20:00+05:30 INF health/health.go:428 > Collected Poller=sarzapi metrics=0 numNetworkEthernetPortAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:20:00+05:30 INF health/health.go:386 > Collected Poller=sarzapi metrics=0 numNetworkFcpPortAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:20:01+05:30 INF health/health.go:346 > Collected Poller=sarzapi metrics=5 numNetworkInterfaceAlerts=5 object=Health plugin=Rest:Health
2024-07-30T15:20:01+05:30 INF health/health.go:306 > Collected Poller=sarzapi metrics=0 numVolumeRansomwareAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:20:02+05:30 INF health/health.go:247 > Collected Poller=sarzapi metrics=0 numVolumeMoveAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:20:02+05:30 INF health/health.go:207 > Collected Poller=sarzapi metrics=1 numLicenseAlerts=1 object=Health plugin=Rest:Health
2024-07-30T15:20:02+05:30 INF collector/collector.go:595 > Collected Poller=sarzapi apiMs=317 bytesRx=6484 calcMs=0 collector=Rest:Health exportMs=0 instances=1 instancesExported=6 metrics=2 metricsExported=10 numCalls=13 parseMs=0 pluginInstances=0 pluginMs=5163 pollMs=5480 zBegin=1722332997185
2024-07-30T15:22:59+05:30 INF health/health.go:658 > Collected Poller=sarzapi metrics=0 numDiskAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:22:59+05:30 INF health/health.go:560 > Collected Poller=sarzapi metrics=0 numShelfAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:23:00+05:30 INF health/health.go:614 > Collected Poller=sarzapi metrics=0 numSupportAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:23:00+05:30 INF health/health.go:465 > Collected Poller=sarzapi metrics=0 numNodeAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:23:00+05:30 INF health/health.go:512 > Collected Poller=sarzapi metrics=0 numHAAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:23:01+05:30 INF health/health.go:428 > Collected Poller=sarzapi metrics=0 numNetworkEthernetPortAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:23:01+05:30 INF health/health.go:386 > Collected Poller=sarzapi metrics=0 numNetworkFcpPortAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:23:02+05:30 INF health/health.go:346 > Collected Poller=sarzapi metrics=5 numNetworkInterfaceAlerts=5 object=Health plugin=Rest:Health
2024-07-30T15:23:02+05:30 INF health/health.go:306 > Collected Poller=sarzapi metrics=0 numVolumeRansomwareAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:23:03+05:30 INF health/health.go:247 > Collected Poller=sarzapi metrics=0 numVolumeMoveAlerts=0 object=Health plugin=Rest:Health
2024-07-30T15:23:04+05:30 INF health/health.go:207 > Collected Poller=sarzapi metrics=1 numLicenseAlerts=1 object=Health plugin=Rest:Health
2024-07-30T15:23:04+05:30 INF collector/collector.go:595 > Collected Poller=sarzapi apiMs=966 bytesRx=6484 calcMs=0 collector=Rest:Health exportMs=0 instances=1 instancesExported=6 metrics=2 metricsExported=10 numCalls=13 parseMs=0 pluginInstances=0 pluginMs=5871 pollMs=6837 zBegin=1722333177189
image image

@Hardikl
Copy link
Contributor Author

Hardikl commented Jul 30, 2024

Updated the logic:

harvest % ./bin/poller -p sar -o Health --promPort 13001
2024-07-30T20:03:22+05:30 INF poller/poller.go:227 > Init Poller=sarzapi asup=false confPath=conf config=harvest.yml configPath=harvest.yml cwd=/Users/hardikl/Documents/Harvest/harvest daemon=false homePath= hostname=hardikl-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=13001 version="harvest version 24.07.30-1 (commit da4e95a) (build date 2024-07-30T20:03:16+0530) darwin/amd64"
2024-07-30T20:03:22+05:30 INF poller/poller.go:251 > started in foreground Poller=sarzapi pid=24269
2024-07-30T20:03:23+05:30 INF collector/helpers.go:97 > best-fit template Poller=sarzapi collector=Rest:Health jitter=none path=conf/rest/9.6.0/health.yaml v=9.15.1
2024-07-30T20:03:25+05:30 WRN poller/poller.go:762 > init collector-object error="template name is empty. Make sure the object is defined in your default.yaml, confPath: [conf]" Poller=sarzapi collector=Ems object=Health
2024-07-30T20:03:25+05:30 INF poller/poller.go:378 > Autosupport scheduled. Poller=sarzapi asupSchedule=24h
2024-07-30T20:03:25+05:30 INF poller/poller.go:387 > poller start-up complete Poller=sarzapi
2024-07-30T20:03:25+05:30 INF prometheus/httpd.go:40 > server listen Poller=sarzapi exporter=prometheus1 url=http://:13001/metrics
2024-07-30T20:03:26+05:30 INF poller/poller.go:595 > updated status, up collectors: 1 (of 1), up exporters: 1 (of 1) Poller=sarzapi
2024-07-30T20:03:26+05:30 INF poller/poller.go:1352 > Metadata Poller=sarzapi maxRssKB=10712 rssKB=10712 version="harvest version 24.07.30-1 (commit da4e95a) (build date 2024-07-30T20:03:16+0530) darwin/amd64"
2024-07-30T20:03:26+05:30 INF collector/collector.go:595 > Collected Poller=sarzapi apiMs=404 bytesRx=0 collector=Rest:Health metrics=0 numCalls=0 pollMs=405 task=counter zBegin=1722350005902
2024-07-30T20:03:31+05:30 INF health/health.go:180 > Collected Poller=sarzapi numDiskAlerts=0 numHAAlerts=0 numLicenseAlerts=1 numNetworkEthernetPortAlerts=0 numNetworkFcpPortAlerts=0 numNetworkInterfaceAlerts=5 numNodeAlerts=0 numResolutionInstanceCount=0 numShelfAlerts=0 numSupportAlerts=0 numVolumeMoveAlerts=0 numVolumeRansomwareAlerts=0 object=Health plugin=Rest:Health
2024-07-30T20:03:31+05:30 INF collector/collector.go:595 > Collected Poller=sarzapi apiMs=321 bytesRx=6484 calcMs=0 collector=Rest:Health exportMs=0 instances=1 instancesExported=6 metrics=2 metricsExported=10 numCalls=13 parseMs=0 pluginInstances=6 pluginMs=5179 pollMs=5500 zBegin=1722350006306
2024-07-30T20:06:33+05:30 INF health/health.go:180 > Collected Poller=sarzapi numDiskAlerts=0 numHAAlerts=0 numLicenseAlerts=1 numNetworkEthernetPortAlerts=0 numNetworkFcpPortAlerts=0 numNetworkInterfaceAlerts=5 numNodeAlerts=0 numResolutionInstanceCount=0 numShelfAlerts=0 numSupportAlerts=0 numVolumeMoveAlerts=0 numVolumeRansomwareAlerts=0 object=Health plugin=Rest:Health
2024-07-30T20:06:33+05:30 INF collector/collector.go:595 > Collected Poller=sarzapi apiMs=938 bytesRx=6484 calcMs=0 collector=Rest:Health exportMs=0 instances=1 instancesExported=6 metrics=2 metricsExported=10 numCalls=13 parseMs=0 pluginInstances=6 pluginMs=5840 pollMs=6778 zBegin=1722350186250

With this change,
collector can log detail of plugin instances via pluginInstances and health can log at each generated instances.

@cgrinds cgrinds merged commit a7c3b9e into main Jul 31, 2024
6 checks passed
@cgrinds cgrinds deleted the hl_health_plug branch July 31, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants