Perfmon panic when no matches to wildcard instance

Metricbeat version: 7.4.2
Windows version: Windows Server 2019

Perfmon part of the metricbeat.yml:

-   metricsets:
    - perfmon
    module: windows
    perfmon.group_measurements_by_instance: true
    perfmon.ignore_non_existent_counters: true
    period: 10s
    perfmon.counters:
    -   instance_label: web_netclr
        measurement_label: netclr.exceptions.per_sec
        query: \.NET CLR Exceptions(*w3wp*)\# of Exceps Thrown / sec
    -   instance_label: web_netclr
        measurement_label: netclr.memory.gc_time.pct
        query: \.NET CLR Memory(*w3wp*)\% Time in GC

Powershell output for query Get-Counter -Counter "\.NET CLR Memory(*w3wp*)\% Time in GC" is empty because that counter doesn't exists yet due this being new server.

Crash message:

2019-11-19T13:05:22.709+0100	FATAL	[metricbeat]	instance/beat.go:157	Failed due to panic.	{"panic": "runtime error: index out of range", "stack": "github.com/elastic/beats/libbeat/cmd/instance.Run.func1.1\n\t/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:158\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:522\nruntime.panicindex\n\t/usr/local/go/src/runtime/panic.go:44\ngithub.com/elastic/beats/metricbeat/module/windows/perfmon.UTF16ToStringArray\n\t/go/src/github.com/elastic/beats/metricbeat/module/windows/perfmon/pdh_query_windows.go:203\ngithub.com/elastic/beats/metricbeat/module/windows/perfmon.(*Query).ExpandWildCardPath\n\t/go/src/github.com/elastic/beats/metricbeat/module/windows/perfmon/pdh_query_windows.go:133\ngithub.com/elastic/beats/metricbeat/module/windows/perfmon.NewReader\n\t/go/src/github.com/elastic/beats/metricbeat/module/windows/perfmon/reader.go:63\ngithub.com/elastic/beats/metricbeat/module/windows/perfmon.New\n\t/go/src/github.com/elastic/beats/metricbeat/module/windows/perfmon/perfmon.go:79\ngithub.com/elastic/beats/metricbeat/mb.initMetricSets\n\t/go/src/github.com/elastic/beats/metricbeat/mb/builders.go:139\ngithub.com/elastic/beats/metricbeat/mb.NewModule\n\t/go/src/github.com/elastic/beats/metricbeat/mb/builders.go:65\ngithub.com/elastic/beats/metricbeat/mb/module.NewWrapper\n\t/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:84\ngithub.com/elastic/beats/metricbeat/beater.newMetricbeat\n\t/go/src/github.com/elastic/beats/metricbeat/beater/metricbeat.go:145\ngithub.com/elastic/beats/metricbeat/beater.Creator.func1\n\t/go/src/github.com/elastic/beats/metricbeat/beater/metricbeat.go:76\ngithub.com/elastic/beats/libbeat/cmd/instance.(*Beat).createBeater\n\t/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:352\ngithub.com/elastic/beats/libbeat/cmd/instance.(*Beat).launch\n\t/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:383\ngithub.com/elastic/beats/libbeat/cmd/instance.Run.func1\n\t/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:182\ngithub.com/elastic/beats/libbeat/cmd/instance.Run\n\t/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:183\ngithub.com/elastic/beats/libbeat/cmd.genRunCmd.func1\n\t/go/src/github.com/elastic/beats/libbeat/cmd/run.go:36\ngithub.com/elastic/beats/vendor/github.com/spf13/cobra.(*Command).execute\n\t/go/src/github.com/elastic/beats/vendor/github.com/spf13/cobra/command.go:704\ngithub.com/elastic/beats/vendor/github.com/spf13/cobra.(*Command).ExecuteC\n\t/go/src/github.com/elastic/beats/vendor/github.com/spf13/cobra/command.go:785\ngithub.com/elastic/beats/vendor/github.com/spf13/cobra.(*Command).Execute\n\t/go/src/github.com/elastic/beats/vendor/github.com/spf13/cobra/command.go:738\nmain.main\n\t/go/src/github.com/elastic/beats/x-pack/metricbeat/main.go:21\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:200"}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.