Skip to content

Commit

Permalink
test upgrade and fix unrelated components
Browse files Browse the repository at this point in the history
  • Loading branch information
jj22ee committed Nov 12, 2024
1 parent bd674ab commit a3ebd13
Show file tree
Hide file tree
Showing 15 changed files with 207 additions and 220 deletions.
4 changes: 2 additions & 2 deletions exporter/awscloudwatchlogsexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type Config struct {
Tags map[string]*string `mapstructure:"tags,omitempty"`

// Queue settings frm the exporterhelper
exporterhelper.QueueSettings `mapstructure:"sending_queue"`
exporterhelper.QueueConfig `mapstructure:"sending_queue"`

awsutil.AWSSessionSettings `mapstructure:",squash"`

Expand All @@ -69,7 +69,7 @@ func (config *Config) Validate() error {
return errors.New("'log_stream_name' must be set")
}

if err := config.QueueSettings.Validate(); err != nil {
if err := config.QueueConfig.Validate(); err != nil {
return err
}
if retErr := cwlogs.ValidateRetentionValue(config.LogRetention); retErr != nil {
Expand Down
22 changes: 11 additions & 11 deletions exporter/awscloudwatchlogsexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ func TestLoadConfig(t *testing.T) {
LogStreamName: "testing",
Endpoint: "",
AWSSessionSettings: awsutil.CreateDefaultSessionConfig(),
QueueSettings: exporterhelper.QueueSettings{
QueueConfig: exporterhelper.QueueConfig{
Enabled: true,
NumConsumers: 1,
QueueSize: exporterhelper.NewDefaultQueueSettings().QueueSize,
QueueSize: exporterhelper.NewDefaultQueueConfig().QueueSize,
},
},
},
Expand All @@ -64,7 +64,7 @@ func TestLoadConfig(t *testing.T) {
AWSSessionSettings: awsutil.CreateDefaultSessionConfig(),
LogGroupName: "test-2",
LogStreamName: "testing",
QueueSettings: exporterhelper.QueueSettings{
QueueConfig: exporterhelper.QueueConfig{
Enabled: true,
NumConsumers: 1,
QueueSize: 2,
Expand Down Expand Up @@ -118,10 +118,10 @@ func TestRetentionValidateCorrect(t *testing.T) {
Endpoint: "",
LogRetention: 365,
AWSSessionSettings: awsutil.CreateDefaultSessionConfig(),
QueueSettings: exporterhelper.QueueSettings{
QueueConfig: exporterhelper.QueueConfig{
Enabled: true,
NumConsumers: 1,
QueueSize: exporterhelper.NewDefaultQueueSettings().QueueSize,
QueueSize: exporterhelper.NewDefaultQueueConfig().QueueSize,
},
}
assert.NoError(t, component.ValidateConfig(cfg))
Expand All @@ -137,9 +137,9 @@ func TestRetentionValidateWrong(t *testing.T) {
Endpoint: "",
LogRetention: 366,
AWSSessionSettings: awsutil.CreateDefaultSessionConfig(),
QueueSettings: exporterhelper.QueueSettings{
QueueConfig: exporterhelper.QueueConfig{
Enabled: true,
QueueSize: exporterhelper.NewDefaultQueueSettings().QueueSize,
QueueSize: exporterhelper.NewDefaultQueueConfig().QueueSize,
},
}
assert.Error(t, component.ValidateConfig(wrongcfg))
Expand Down Expand Up @@ -221,10 +221,10 @@ func TestValidateTags(t *testing.T) {
Endpoint: "",
Tags: tt.tags,
AWSSessionSettings: awsutil.CreateDefaultSessionConfig(),
QueueSettings: exporterhelper.QueueSettings{
QueueConfig: exporterhelper.QueueConfig{
Enabled: true,
NumConsumers: 1,
QueueSize: exporterhelper.NewDefaultQueueSettings().QueueSize,
QueueSize: exporterhelper.NewDefaultQueueConfig().QueueSize,
},
}
if tt.errorMessage != "" {
Expand Down Expand Up @@ -278,10 +278,10 @@ func TestRawLogEmfOnlyCombination(t *testing.T) {
Endpoint: "",
LogRetention: 365,
AWSSessionSettings: awsutil.CreateDefaultSessionConfig(),
QueueSettings: exporterhelper.QueueSettings{
QueueConfig: exporterhelper.QueueConfig{
Enabled: true,
NumConsumers: 1,
QueueSize: exporterhelper.NewDefaultQueueSettings().QueueSize,
QueueSize: exporterhelper.NewDefaultQueueConfig().QueueSize,
},
RawLog: tt.RawLog,
EmfOnly: tt.EmfOnly,
Expand Down
2 changes: 1 addition & 1 deletion exporter/awscloudwatchlogsexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func newCwLogsExporter(config component.Config, params exp.Settings) (exp.Logs,
params,
config,
logsPusher.consumeLogs,
exporterhelper.WithQueue(expConfig.QueueSettings),
exporterhelper.WithQueue(expConfig.QueueConfig),
exporterhelper.WithRetry(expConfig.BackOffConfig),
exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}),
exporterhelper.WithStart(logsPusher.start),
Expand Down
6 changes: 3 additions & 3 deletions exporter/awscloudwatchlogsexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ func NewFactory() exporter.Factory {
}

func createDefaultConfig() component.Config {
queueSettings := exporterhelper.NewDefaultQueueSettings()
QueueConfig := exporterhelper.NewDefaultQueueConfig()
// For backwards compatibilitiy, we default to 1 consumer
queueSettings.NumConsumers = 1
QueueConfig.NumConsumers = 1

return &Config{
BackOffConfig: configretry.NewDefaultBackOffConfig(),
AWSSessionSettings: awsutil.CreateDefaultSessionConfig(),
QueueSettings: queueSettings,
QueueConfig: QueueConfig,
}
}

Expand Down
4 changes: 2 additions & 2 deletions exporter/awscloudwatchlogsexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ func TestDefaultConfig_exporterSettings(t *testing.T) {
want := &Config{
BackOffConfig: configretry.NewDefaultBackOffConfig(),
AWSSessionSettings: awsutil.CreateDefaultSessionConfig(),
QueueSettings: exporterhelper.QueueSettings{
QueueConfig: exporterhelper.QueueConfig{
Enabled: true,
NumConsumers: 1,
QueueSize: exporterhelper.NewDefaultQueueSettings().QueueSize,
QueueSize: exporterhelper.NewDefaultQueueConfig().QueueSize,
},
}
assert.Equal(t, want, createDefaultConfig())
Expand Down
40 changes: 18 additions & 22 deletions exporter/awscloudwatchlogsexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ require (
github.com/aws/aws-sdk-go v1.53.11
github.com/cenkalti/backoff/v4 v4.3.0
github.com/google/uuid v1.6.0
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.103.0
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs v0.103.0
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.111.0
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs v0.111.0
github.com/stretchr/testify v1.9.0
go.opentelemetry.io/collector/component v0.111.0
go.opentelemetry.io/collector/config/configretry v0.103.0
go.opentelemetry.io/collector/confmap v0.103.0
go.opentelemetry.io/collector/consumer v0.103.0
go.opentelemetry.io/collector/exporter v0.103.0
go.opentelemetry.io/collector/config/configretry v1.17.0
go.opentelemetry.io/collector/confmap v1.17.0
go.opentelemetry.io/collector/consumer v0.111.0
go.opentelemetry.io/collector/exporter v0.111.0
go.opentelemetry.io/collector/pdata v1.17.0
go.opentelemetry.io/otel/metric v1.30.0
go.opentelemetry.io/otel/trace v1.30.0
Expand All @@ -27,14 +27,11 @@ require (
github.com/amazon-contributing/opentelemetry-collector-contrib/override/aws v0.0.0-20241107200025-113eee2da3ff // indirect
github.com/aws/aws-sdk-go-v2 v1.22.2 // indirect
github.com/aws/smithy-go v1.16.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/go-viper/mapstructure/v2 v2.1.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
Expand All @@ -45,24 +42,25 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.54.0 // indirect
github.com/prometheus/procfs v0.15.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
go.opentelemetry.io/collector v0.103.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.111.0 // indirect
go.opentelemetry.io/collector/extension v0.103.0 // indirect
go.opentelemetry.io/collector/featuregate v1.10.0 // indirect
go.opentelemetry.io/collector/receiver v0.103.0 // indirect
go.opentelemetry.io/collector/consumer/consumerprofiles v0.111.0 // indirect
go.opentelemetry.io/collector/consumer/consumertest v0.111.0 // indirect
go.opentelemetry.io/collector/exporter/exporterprofiles v0.111.0 // indirect
go.opentelemetry.io/collector/extension v0.111.0 // indirect
go.opentelemetry.io/collector/extension/experimental/storage v0.111.0 // indirect
go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect
go.opentelemetry.io/collector/pdata/pprofile v0.111.0 // indirect
go.opentelemetry.io/collector/pipeline v0.111.0 // indirect
go.opentelemetry.io/collector/receiver v0.111.0 // indirect
go.opentelemetry.io/collector/receiver/receiverprofiles v0.111.0 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect
go.opentelemetry.io/otel/sdk v1.30.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.17.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand All @@ -76,8 +74,6 @@ replace github.com/amazon-contributing/opentelemetry-collector-contrib/override/

replace github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware => ../../extension/awsmiddleware

replace go.opentelemetry.io/collector/component v0.111.0 => go.opentelemetry.io/collector/component v0.103.0

retract (
v0.76.2
v0.76.1
Expand Down
Loading

0 comments on commit a3ebd13

Please sign in to comment.