123456789101112131415161718192021222324252627282930313233343536 |
- // Copyright The OpenTelemetry Authors
- // SPDX-License-Identifier: Apache-2.0
- package awscloudwatchmetricsreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscloudwatchmetricsreceiver"
- import (
- "context"
- "go.opentelemetry.io/collector/component"
- "go.opentelemetry.io/collector/consumer"
- "go.opentelemetry.io/collector/receiver"
- "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscloudwatchmetricsreceiver/internal/metadata"
- )
- // NewFactory creates a factory for awscloudwatchmetrics receiver.
- func NewFactory() receiver.Factory {
- return receiver.NewFactory(
- metadata.Type,
- createDefaultConfig,
- receiver.WithMetrics(createMetricsReceiver, metadata.MetricsStability),
- )
- }
- func createMetricsReceiver(_ context.Context, params receiver.CreateSettings, baseCfg component.Config, consumer consumer.Metrics) (receiver.Metrics, error) {
- cfg := baseCfg.(*Config)
- rcvr := newMetricReceiver(cfg, params.Logger, consumer)
- return rcvr, nil
- }
- func createDefaultConfig() component.Config {
- return &Config{
- PollInterval: defaultPollInterval,
- Metrics: &MetricsConfig{},
- }
- }
|