factory.go 682 B

123456789101112131415161718192021
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. package sqlqueryreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/sqlqueryreceiver"
  4. import (
  5. "database/sql"
  6. "go.opentelemetry.io/collector/receiver"
  7. "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/sqlqueryreceiver/internal/metadata"
  8. )
  9. func NewFactory() receiver.Factory {
  10. return receiver.NewFactory(
  11. metadata.Type,
  12. createDefaultConfig,
  13. receiver.WithLogs(createLogsReceiverFunc(sql.Open, newDbClient), metadata.LogsStability),
  14. receiver.WithMetrics(createMetricsReceiverFunc(sql.Open, newDbClient), metadata.MetricsStability),
  15. )
  16. }