Alloy Service Runtime Error: invalid memory address or nil pointer dereference

Hi,

i want to monitor several Windows Server over Grafana Cloud.
For that i used connections/add-new-connection/windows-exporter?page=alloy

  1. Test Alloy Connection works.
  2. Appended Integration and Logs to config.alloy (no individual edits)
  3. Restarted Service
  4. Test connection: No metrics were found for this integration.
  5. Server (2022 21H2) Event Viewer Application Error:

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

goroutine 828 [running]:
github com/prometheus-community/windows_exporter/pkg/collector/service.(*Collector).Collect(0xc003b52190, 0x0?, 0x0?)
/go/pkg/mod/github com/prometheus-community/windows_exporter@v0.27.2/pkg/collector/service/service.go:152 +0x33
github com/prometheus-community/windows_exporter/pkg/collector.(*Prometheus).execute(0xc0031e3ec0, {0xa7c368f, 0x7}, {0xbea2528, 0xc003b52190}, 0xc002694270, 0xc0001822a0)
/go/pkg/mod/github com/prometheus-community/windows_exporter@v0.27.2/pkg/collector/prometheus.go:176 +0x8f
github com/prometheus-community/windows_exporter/pkg/collector.(*Prometheus).Collect.func2({0xa7c368f, 0x7}, {0xbea2528?, 0xc003b52190?})
/go/pkg/mod/github com/prometheus-community/windows_exporter@v0.27.2/pkg/collector/prometheus.go:117 +0xa5
created by github com/prometheus-community/windows_exporter/pkg/collector.(*Prometheus).Collect in goroutine 822
/go/pkg/mod/github com/prometheus-community/windows_exporter@v0.27.2/pkg/collector/prometheus.go:115 +0x470

b)
level=error msg=“service exited with error” err=“exit status 2” exit_code=2

That is probably the reason why no metrics were found.
Does anyone know how to fix this?

Hello! Apologies - I believe you were affected by a bug in version 1.4.1 of Alloy. Please try using version 1.4.2. It should not have this problem.