// Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 //go:build windows // +build windows package windowsperfcountersreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowsperfcountersreceiver" import ( "context" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/scraperhelper" ) // createMetricsReceiver creates a metrics receiver based on provided config. func createMetricsReceiver( ctx context.Context, params receiver.CreateSettings, cfg component.Config, consumer consumer.Metrics, ) (receiver.Metrics, error) { oCfg := cfg.(*Config) scraper := newScraper(oCfg, params.TelemetrySettings) scrp, err := scraperhelper.NewScraper( params.ID.String(), scraper.scrape, scraperhelper.WithStart(scraper.start), scraperhelper.WithShutdown(scraper.shutdown), ) if err != nil { return nil, err } return scraperhelper.NewScraperControllerReceiver( &oCfg.ScraperControllerSettings, params, consumer, scraperhelper.AddScraper(scrp), ) }