factory.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. //go:generate mdatagen metadata.yaml
  4. package tencentcloudlogserviceexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tencentcloudlogserviceexporter"
  5. import (
  6. "context"
  7. "go.opentelemetry.io/collector/component"
  8. "go.opentelemetry.io/collector/exporter"
  9. "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tencentcloudlogserviceexporter/internal/metadata"
  10. )
  11. // NewFactory creates a factory for tencentcloud LogService exporter.
  12. func NewFactory() exporter.Factory {
  13. return exporter.NewFactory(
  14. metadata.Type,
  15. createDefaultConfig,
  16. exporter.WithLogs(createLogsExporter, metadata.LogsStability))
  17. }
  18. // CreateDefaultConfig creates the default configuration for exporter.
  19. func createDefaultConfig() component.Config {
  20. return &Config{}
  21. }
  22. func createLogsExporter(
  23. _ context.Context,
  24. set exporter.CreateSettings,
  25. cfg component.Config,
  26. ) (exp exporter.Logs, err error) {
  27. return newLogsExporter(set, cfg)
  28. }