Skip to content

Commit

Permalink
[AppSignals] Explicitly set the GCCollectionInterval for MetricsLimit…
Browse files Browse the repository at this point in the history
…er (#1093) (#1094)
  • Loading branch information
sky333999 authored Mar 15, 2024
1 parent 3516a0e commit 668bc8d
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 7 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
========================================================================
Amazon CloudWatch Agent 1.300034.1 (2024-03-14)
========================================================================
Bug fixes:
* [AppSignals] Explicitly set the default GC interval for metrics limiter

Enhancements:
* [ContainerInsights] Add InstanceType attribute to GPU metrics

Expand Down
11 changes: 6 additions & 5 deletions plugins/processors/awsappsignals/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type LimiterConfig struct {
Disabled bool `mapstructure:"disabled"`
LogDroppedMetrics bool `mapstructure:"log_dropped_metrics"`
RotationInterval time.Duration `mapstructure:"rotation_interval"`
GarbageCollectionInterval time.Duration `mapstructure:"-"`
GarbageCollectionInterval time.Duration `mapstructure:"garbage_collection_interval"`
ParentContext context.Context `mapstructure:"-"`
}

Expand All @@ -34,10 +34,11 @@ const (

func NewDefaultLimiterConfig() *LimiterConfig {
return &LimiterConfig{
Threshold: DefaultThreshold,
Disabled: false,
LogDroppedMetrics: false,
RotationInterval: DefaultRotationInterval,
Threshold: DefaultThreshold,
Disabled: false,
LogDroppedMetrics: false,
RotationInterval: DefaultRotationInterval,
GarbageCollectionInterval: DefaultGCInterval,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ processors:
drop_threshold: 500
log_dropped_metrics: true
rotation_interval: 10m0s
garbage_collection_interval: 10m0s
batch/containerinsights:
metadata_cardinality_limit: 1000
metadata_keys: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ processors:
drop_threshold: 500
log_dropped_metrics: true
rotation_interval: 10m0s
garbage_collection_interval: 10m0s
batch/containerinsights:
metadata_cardinality_limit: 1000
metadata_keys: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"limiter": {
"drop_threshold": 20,
"log_dropped_metrics": true,
"rotation_interval": "10m"
"rotation_interval": "10m",
"garbage_collection_interval": "10m"
},
"rules": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"limiter": {
"drop_threshold": 20,
"log_dropped_metrics": true,
"rotation_interval": "10m"
"rotation_interval": "10m",
"garbage_collection_interval": "10m"
},
"rules": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ limiter:
drop_threshold: 20
log_dropped_metrics: true
rotation_interval: 10m
garbage_collection_interval: 10m
rules:
- selectors:
- dimension: Operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ limiter:
drop_threshold: 20
log_dropped_metrics: true
rotation_interval: 10m
garbage_collection_interval: 10m
rules:
- selectors:
- dimension: Operation
Expand Down
11 changes: 11 additions & 0 deletions translator/translate/otel/processor/awsappsignals/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ func (t *translator) translateMetricLimiterConfig(conf *confmap.Conf, configKey
limiterConfig.LogDroppedMetrics = val
}
}
if rawVal, exists := configJson["garbage_collection_interval"]; exists {
if val, ok := rawVal.(string); !ok {
return nil, errors.New("type conversion error: garbage_collection_interval is not a string")
} else {
if interval, err := time.ParseDuration(val); err != nil {
return nil, errors.New("type conversion error: garbage_collection_interval is not a time string")
} else {
limiterConfig.GarbageCollectionInterval = interval
}
}
}
if rawVal, exists := configJson["rotation_interval"]; exists {
if val, ok := rawVal.(string); !ok {
return nil, errors.New("type conversion error: rotation_interval is not a string")
Expand Down

0 comments on commit 668bc8d

Please sign in to comment.