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

StorageGRID collectors should support only_cluster_instance #2541

Closed
cgrinds opened this issue Dec 8, 2023 Discussed in #2540 · 1 comment · Fixed by #2542
Closed

StorageGRID collectors should support only_cluster_instance #2541

cgrinds opened this issue Dec 8, 2023 Discussed in #2540 · 1 comment · Fixed by #2542
Assignees
Labels

Comments

@cgrinds
Copy link
Collaborator

cgrinds commented Dec 8, 2023

Discussed in #2540

Thanks to @santosh725 for raising.

@cgrinds cgrinds added bug Something isn't working customer 24.02 labels Dec 8, 2023
@cgrinds cgrinds self-assigned this Dec 8, 2023
cgrinds added a commit that referenced this issue Dec 8, 2023
* fix: StorageGRID collectors should support only_cluster_instance

Fixes: #2541
@Hardikl Hardikl self-assigned this Feb 13, 2024
@Hardikl
Copy link
Contributor

Hardikl commented Feb 13, 2024

Without only_cluster_instance: true flag the SG metrics haven't been exported.

harvest % ./bin/poller -p sg-tudor -o Health --promPort 14001
2024-02-13T14:53:32+05:30 INF poller/poller.go:215 > Init Poller=sg-tudor asup=false confPath=conf config=harvest.yml configPath=harvest.yml daemon=false debug=false homePath= hostname=hardikl-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=18001 version="harvest version 24.02.1313-v23.11.0 (commit febb62c5) (build date 2024-02-13T13:36:45+0530) darwin/amd64"
2024-02-13T14:53:32+05:30 INF poller/poller.go:239 > started in foreground Poller=sg-tudor pid=27686
2024-02-13T14:53:34+05:30 INF collector/helpers.go:84 > best-fit template Poller=sg-tudor collector=StorageGrid:Health path=conf/storagegrid/11.6.0/health.yaml v=11.7.0
2024-02-13T14:53:34+05:30 INF storagegrid/storagegrid.go:83 > initialized Poller=sg-tudor collector=StorageGrid:Health
2024-02-13T14:53:34+05:30 INF poller/poller.go:357 > Autosupport scheduled. Poller=sg-tudor asupSchedule=24h
2024-02-13T14:53:34+05:30 INF poller/poller.go:366 > poller start-up complete Poller=sg-tudor
2024-02-13T14:53:34+05:30 INF prometheus/httpd.go:40 > server listen Poller=sg-tudor exporter=prometheus1 url=http://:18001/metrics
2024-02-13T14:53:34+05:30 INF poller/poller.go:523 > updated status, up collectors: 1 (of 1), up exporters: 1 (of 1) Poller=sg-tudor
2024-02-13T14:53:35+05:30 INF collector/collector.go:585 > Collected Poller=sg-tudor apiMs=245 calcMs=0 collector=StorageGrid:Health exportMs=0 instances=0 instancesExported=0 metrics=0 metricsExported=0 parseMs=0 pluginMs=0 pollMs=245 zBegin=1707816214846

Tested in main with commit febb62c

Template used for testing.

name: Health
query: grid/health
object: storagegrid

schedule:
  - data: 1m

counters:
  - alarms.critical => alarms_critical
  - alarms.major => alarms_major
  - alarms.minor => alarms_minor
  - nodes.connected => nodes_connected
  - nodes.administratively-down => nodes_admin_down
  - nodes.unknown => nodes_unknown

only_cluster_instance: true

export_options:
  include_all_labels: true
harvest % ./bin/poller -p sg-tudor -o Health --promPort 14001
2024-02-13T14:55:54+05:30 INF poller/poller.go:215 > Init Poller=sg-tudor asup=false confPath=conf config=harvest.yml configPath=harvest.yml daemon=false debug=false homePath= hostname=hardikl-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=14001 version="harvest version 24.02.1313-v23.11.0 (commit febb62c5) (build date 2024-02-13T13:36:45+0530) darwin/amd64"
2024-02-13T14:55:54+05:30 INF poller/poller.go:239 > started in foreground Poller=sg-tudor pid=27832
2024-02-13T14:55:56+05:30 INF collector/helpers.go:84 > best-fit template Poller=sg-tudor collector=StorageGrid:Health path=conf/storagegrid/11.6.0/health.yaml v=11.7.0
2024-02-13T14:55:56+05:30 INF storagegrid/storagegrid.go:83 > initialized Poller=sg-tudor collector=StorageGrid:Health
2024-02-13T14:55:56+05:30 INF poller/poller.go:357 > Autosupport scheduled. Poller=sg-tudor asupSchedule=24h
2024-02-13T14:55:56+05:30 INF poller/poller.go:366 > poller start-up complete Poller=sg-tudor
2024-02-13T14:55:56+05:30 INF prometheus/httpd.go:40 > server listen Poller=sg-tudor exporter=prometheus1 url=http://:14001/metrics
2024-02-13T14:55:56+05:30 INF poller/poller.go:523 > updated status, up collectors: 1 (of 1), up exporters: 1 (of 1) Poller=sg-tudor
2024-02-13T14:55:56+05:30 INF collector/collector.go:585 > Collected Poller=sg-tudor apiMs=239 calcMs=0 collector=StorageGrid:Health exportMs=0 instances=1 instancesExported=1 metrics=6 metricsExported=18 parseMs=0 pluginMs=0 pollMs=239 zBegin=1707816356415
2024-02-13T14:56:57+05:30 INF collector/collector.go:585 > Collected Poller=sg-tudor apiMs=714 calcMs=0 collector=StorageGrid:Health exportMs=0 instances=1 instancesExported=1 metrics=6 metricsExported=18 parseMs=0 pluginMs=0 pollMs=714 zBegin=1707816416416
2024-02-13T14:57:57+05:30 INF collector/collector.go:585 > Collected Poller=sg-tudor apiMs=712 calcMs=0 collector=StorageGrid:Health exportMs=0 instances=1 instancesExported=1 metrics=6 metricsExported=18 parseMs=0 pluginMs=0 pollMs=712 zBegin=1707816476418
2024-02-13T14:58:57+05:30 INF collector/collector.go:585 > Collected Poller=sg-tudor apiMs=721 calcMs=0 collector=StorageGrid:Health exportMs=0 instances=1 instancesExported=1 metrics=6 metricsExported=18 parseMs=0 pluginMs=0 pollMs=721 zBegin=1707816536419
harvest % curl -s http://localhost:14001/metrics | grep -Ev "#|metadata_"           
storagegrid_nodes_unknown{cluster="SG5712FP",datacenter="rtp"} 3
storagegrid_alarms_critical{cluster="SG5712FP",datacenter="rtp"} 0
storagegrid_alarms_major{cluster="SG5712FP",datacenter="rtp"} 0
storagegrid_alarms_minor{cluster="SG5712FP",datacenter="rtp"} 0
storagegrid_nodes_connected{cluster="SG5712FP",datacenter="rtp"} 2
storagegrid_nodes_admin_down{cluster="SG5712FP",datacenter="rtp"} 0
harvest % 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants