factory.go 1.0 KB

1234567891011121314151617181920212223242526272829
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. package windowsperfcountersreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowsperfcountersreceiver"
  4. import (
  5. "go.opentelemetry.io/collector/component"
  6. "go.opentelemetry.io/collector/receiver"
  7. "go.opentelemetry.io/collector/receiver/scraperhelper"
  8. "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowsperfcountersreceiver/internal/metadata"
  9. )
  10. // This file implements Factory for WindowsPerfCounters receiver.
  11. // NewFactory creates a new factory for windows perf counters receiver.
  12. func NewFactory() receiver.Factory {
  13. return receiver.NewFactory(
  14. metadata.Type,
  15. createDefaultConfig,
  16. receiver.WithMetrics(createMetricsReceiver, metadata.MetricsStability))
  17. }
  18. // createDefaultConfig creates the default configuration for receiver.
  19. func createDefaultConfig() component.Config {
  20. return &Config{
  21. ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(metadata.Type),
  22. }
  23. }