mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
performancecounter: Add the possibility to request formatted values (#1830)
This commit is contained in:
@@ -78,6 +78,7 @@ import (
|
||||
"github.com/prometheus-community/windows_exporter/internal/pdh"
|
||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"golang.org/x/sys/windows/registry"
|
||||
)
|
||||
|
||||
// NewWithFlags To be called by the exporter for collector initialization before running kingpin.Parse.
|
||||
@@ -231,6 +232,7 @@ func (c *Collection) Build(logger *slog.Logger) error {
|
||||
|
||||
for err := range errCh {
|
||||
if errors.Is(err, pdh.ErrNoData) ||
|
||||
errors.Is(err, registry.ErrNotExist) ||
|
||||
errors.Is(err, pdh.NewPdhError(pdh.CstatusNoObject)) ||
|
||||
errors.Is(err, pdh.NewPdhError(pdh.CstatusNoCounter)) ||
|
||||
errors.Is(err, mi.MI_RESULT_INVALID_NAMESPACE) {
|
||||
|
||||
Reference in New Issue
Block a user