Skip to content

Commit

Permalink
temporarily disable enhanced flag (#101)
Browse files Browse the repository at this point in the history
* temporarily disable enhanced flag

* fix linter error

* fix linter error, test error
  • Loading branch information
chadpatel authored Sep 27, 2023
1 parent 346e94a commit 25715e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions exporter/awsemfexporter/emf_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ func wrapErrorIfBadRequest(err error) error {
return err
}

func isEnhancedContainerInsights(config *Config) bool {
return config.EnhancedContainerInsights && !config.DisableMetricExtraction
func isEnhancedContainerInsights(_ *Config) bool {
return false // temporarily disable, also need to rename _config to config
// return config.EnhancedContainerInsights && !config.DisableMetricExtraction
}
2 changes: 1 addition & 1 deletion exporter/awsemfexporter/emf_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func TestIsEnhancedContainerInsights(t *testing.T) {
cfg := factory.CreateDefaultConfig().(*Config)
cfg.EnhancedContainerInsights = true
cfg.DisableMetricExtraction = false
assert.True(t, isEnhancedContainerInsights(cfg))
assert.False(t, isEnhancedContainerInsights(cfg))
cfg.EnhancedContainerInsights = false
assert.False(t, isEnhancedContainerInsights(cfg))
cfg.EnhancedContainerInsights = true
Expand Down
1 change: 1 addition & 0 deletions internal/aws/cwlogs/cwlog_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func NewClient(logger *zap.Logger, awsConfig *aws.Config, buildInfo component.Bu
client := cloudwatchlogs.New(sess, awsConfig)
client.Handlers.Build.PushBackNamed(handler.NewRequestCompressionHandler([]string{"PutLogEvents"}, logger))
client.Handlers.Build.PushBackNamed(handler.RequestStructuredLogHandler)
// temporarily disable the flag
client.Handlers.Build.PushFrontNamed(newCollectorUserAgentHandler(buildInfo, logGroupName, enhancedContainerInsights))
return newCloudWatchLogClient(client, logRetention, tags, logger)
}
Expand Down

0 comments on commit 25715e6

Please sign in to comment.