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

panic when using service collector with the NewFromConfig code path #1645

Closed
erikbaranowski opened this issue Sep 27, 2024 · 2 comments
Closed
Labels

Comments

@erikbaranowski
Copy link

erikbaranowski commented Sep 27, 2024

Current Behavior

panic when using service collector with the NewFromConfig code path

Expected Behavior

no panic

Steps To Reproduce

Run Grafana Alloy version 1.4.1 with the service collector enabled. It embeds the windows_exporter v0.27.2

prometheus.exporter.windows "integrations_windows_exporter" {
  enabled_collectors = ["service"]
}

Environment

  • windows_exporter Version: v0.27.* through v0.28.*
  • Windows Server Version: N/A

windows_exporter logs

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x7ff7ecaeaf33]

goroutine 694 [running]:
github.com/prometheus-community/windows_exporter/pkg/collector/service.(*Collector).Collect(0xc0034be960, 0xc0033a7f84?, 0x2?)
        C:/Users/erikr/go/pkg/mod/github.com/prometheus-community/[email protected]/pkg/collector/service/service.go:152 +0x33
github.com/prometheus-community/windows_exporter/pkg/collector.(*Prometheus).execute(0xc00349dc80, {0x7ff7ef7c7e98, 0x7}, {0x7ff7f0d92928, 0xc0034be960}, 0xc003684600, 0xc00252e840)
        C:/Users/erikr/go/pkg/mod/github.com/prometheus-community/[email protected]/pkg/collector/prometheus.go:176 +0x8f
github.com/prometheus-community/windows_exporter/pkg/collector.(*Prometheus).Collect.func2({0x7ff7ef7c7e98, 0x7}, {0x7ff7f0d92928?, 0xc0034be960?})
        C:/Users/erikr/go/pkg/mod/github.com/prometheus-community/[email protected]/pkg/collector/prometheus.go:117 +0xa5
created by github.com/prometheus-community/windows_exporter/pkg/collector.(*Prometheus).Collect in goroutine 773
        C:/Users/erikr/go/pkg/mod/github.com/prometheus-community/[email protected]/pkg/collector/prometheus.go:115 +0x470
exit status 2

Anything else?

related to: grafana/alloy#1744
code fix: https://github.com/prometheus-community/windows_exporter/compare/v0.27.2...erikbaranowski:windows_exporter:service-collector-small-fix?expand=1

I'm not sure the process to get a backported bug fix PR open for the windows_exporter but I'm happy to assist if I can.

@jkroepke
Copy link
Member

@erikbaranowski we need more tests... 🙂

I just applied a fix for v0.27.x, coming as v0.27.3

@jkroepke
Copy link
Member

0.27.3 and 0.28.2 are released.

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

No branches or pull requests

2 participants