1234567891011121314151617181920212223242526272829303132333435 |
- // Copyright The OpenTelemetry Authors
- // SPDX-License-Identifier: Apache-2.0
- package influxdbreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/influxdbreceiver"
- import (
- "context"
- "go.opentelemetry.io/collector/component"
- "go.opentelemetry.io/collector/config/confighttp"
- "go.opentelemetry.io/collector/consumer"
- "go.opentelemetry.io/collector/receiver"
- "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/influxdbreceiver/internal/metadata"
- )
- func NewFactory() receiver.Factory {
- return receiver.NewFactory(
- metadata.Type,
- createDefaultConfig,
- receiver.WithMetrics(createMetricsReceiver, metadata.MetricsStability))
- }
- // createDefaultConfig creates the default configuration for receiver.
- func createDefaultConfig() component.Config {
- return &Config{
- HTTPServerSettings: confighttp.HTTPServerSettings{
- Endpoint: "0.0.0.0:8086",
- },
- }
- }
- func createMetricsReceiver(_ context.Context, params receiver.CreateSettings, cfg component.Config, nextConsumer consumer.Metrics) (receiver.Metrics, error) {
- return newMetricsReceiver(cfg.(*Config), params, nextConsumer)
- }
|