diff --git a/cmd/checkapi/allowlist.txt b/cmd/checkapi/allowlist.txt index 478e5e2d9166..78908d42ca35 100644 --- a/cmd/checkapi/allowlist.txt +++ b/cmd/checkapi/allowlist.txt @@ -1,5 +1,4 @@ connector/servicegraphconnector -exporter/awscloudwatchlogsexporter exporter/awskinesisexporter exporter/azuremonitorexporter exporter/coralogixexporter @@ -33,4 +32,4 @@ receiver/mysqlreceiver receiver/nsxtreceiver receiver/podmanreceiver receiver/pulsarreceiver -receiver/windowseventlogreceiver \ No newline at end of file +receiver/windowseventlogreceiver diff --git a/exporter/awscloudwatchlogsexporter/exporter.go b/exporter/awscloudwatchlogsexporter/exporter.go index 7ff06eeec778..2951b02a5977 100644 --- a/exporter/awscloudwatchlogsexporter/exporter.go +++ b/exporter/awscloudwatchlogsexporter/exporter.go @@ -26,7 +26,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs" ) -type exporter struct { +type cwlExporter struct { Config *Config logger *zap.Logger retryCount int @@ -47,7 +47,7 @@ type emfMetadata struct { LogStreamName string `json:"log_stream_name,omitempty"` } -func newCwLogsPusher(expConfig *Config, params exp.CreateSettings) (*exporter, error) { +func newCwLogsPusher(expConfig *Config, params exp.CreateSettings) (*cwlExporter, error) { if expConfig == nil { return nil, errors.New("awscloudwatchlogs exporter config is nil") } @@ -79,7 +79,7 @@ func newCwLogsPusher(expConfig *Config, params exp.CreateSettings) (*exporter, e pusherMap[pusherKey] = pusher - logsExporter := &exporter{ + logsExporter := &cwlExporter{ svcStructuredLog: svcStructuredLog, Config: expConfig, logger: params.Logger, @@ -108,7 +108,7 @@ func newCwLogsExporter(config component.Config, params exp.CreateSettings) (exp. ) } -func (e *exporter) consumeLogs(_ context.Context, ld plog.Logs) error { +func (e *cwlExporter) consumeLogs(_ context.Context, ld plog.Logs) error { logEvents, _ := logsToCWLogs(e.logger, ld, e.Config) if len(logEvents) == 0 { return nil @@ -146,7 +146,7 @@ func (e *exporter) consumeLogs(_ context.Context, ld plog.Logs) error { return nil } -func (e *exporter) getLogPusher(logEvent *cwlogs.Event) cwlogs.Pusher { +func (e *cwlExporter) getLogPusher(logEvent *cwlogs.Event) cwlogs.Pusher { e.pusherMapLock.Lock() defer e.pusherMapLock.Unlock() pusherKey := cwlogs.PusherKey{ @@ -160,7 +160,7 @@ func (e *exporter) getLogPusher(logEvent *cwlogs.Event) cwlogs.Pusher { return e.pusherMap[pusherKey] } -func (e *exporter) shutdown(_ context.Context) error { +func (e *cwlExporter) shutdown(_ context.Context) error { if e.pusherMap != nil { for _, pusher := range e.pusherMap { pusher.ForceFlush() diff --git a/exporter/awscloudwatchlogsexporter/factory.go b/exporter/awscloudwatchlogsexporter/factory.go index efdb366d1794..5973a088b39e 100644 --- a/exporter/awscloudwatchlogsexporter/factory.go +++ b/exporter/awscloudwatchlogsexporter/factory.go @@ -12,18 +12,18 @@ import ( "errors" "go.opentelemetry.io/collector/component" - exp "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter/internal/metadata" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil" ) -func NewFactory() exp.Factory { - return exp.NewFactory( +func NewFactory() exporter.Factory { + return exporter.NewFactory( metadata.Type, createDefaultConfig, - exp.WithLogs(createLogsExporter, metadata.LogsStability)) + exporter.WithLogs(createLogsExporter, metadata.LogsStability)) } func createDefaultConfig() component.Config { @@ -36,7 +36,7 @@ func createDefaultConfig() component.Config { } } -func createLogsExporter(_ context.Context, params exp.CreateSettings, config component.Config) (exp.Logs, error) { +func createLogsExporter(_ context.Context, params exporter.CreateSettings, config component.Config) (exporter.Logs, error) { expConfig, ok := config.(*Config) if !ok { return nil, errors.New("invalid configuration type; can't cast to awscloudwatchlogsexporter.Config")