Skip to content

Commit 8f70ab5

Browse files
authored
Merge branch 'main' into feature/windows-regex-filtering
2 parents 94fcd20 + d705a03 commit 8f70ab5

File tree

70 files changed

+2639
-320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2639
-320
lines changed

.github/workflows/build-test-artifacts.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ on:
1515
- '!.github/workflows/build-test-artifacts.yml'
1616
- '!.github/workflows/integration-test.yml'
1717
- '!.github/workflows/application-signals-e2e-test.yml'
18+
schedule:
19+
- cron: '0 11 * * 1,2,3,4,5' # Every day at 11:00 UTC on Monday to Friday
1820
workflow_dispatch:
1921
inputs:
2022
test-image-before-upload:
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: MIT
3+
name: EKS Cluster Scaling
4+
5+
on:
6+
schedule:
7+
- cron: '0 9 * * 0' # Scale up: Runs every Sunday at 9:00 AM
8+
- cron: '0 21 * * 1' # Scale down: Runs every Monday at 9:00 PM
9+
workflow_dispatch:
10+
inputs:
11+
region:
12+
description: 'AWS Region'
13+
required: true
14+
type: string
15+
default: 'us-west-2'
16+
cluster_name:
17+
description: 'EKS Cluster Name'
18+
required: true
19+
type: string
20+
default: 'eks-performance'
21+
desired_capacity_per_nodegroup:
22+
description: 'Desired capacity for each node group'
23+
required: true
24+
type: number
25+
default: 500
26+
node_group_count:
27+
description: 'Count of node groups'
28+
type: number
29+
default: 10
30+
31+
env:
32+
AWS_REGION: ${{ inputs.region || 'us-west-2' }}
33+
CLUSTER_NAME: ${{ inputs.cluster_name || 'eks-performance' }}
34+
NODE_GROUP_COUNT: ${{ inputs.node_group_count || 10 }}
35+
DESIRED_CAPACITY_PER_NODEGROUP: ${{ inputs.desired_capacity_per_nodegroup || 500 }}
36+
TERRAFORM_AWS_ASSUME_ROLE: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }}
37+
TERRAFORM_AWS_ASSUME_ROLE_DURATION: 3600 # 1 hour duration
38+
CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test"
39+
CWA_GITHUB_TEST_REPO_URL: "https://github.com/aws/amazon-cloudwatch-agent-test.git"
40+
CWA_GITHUB_TEST_REPO_BRANCH: "main"
41+
42+
jobs:
43+
scale-eks-cluster:
44+
runs-on: ubuntu-latest
45+
permissions:
46+
id-token: write
47+
contents: read
48+
steps:
49+
- uses: actions/checkout@v3
50+
with:
51+
repository: ${{ env.CWA_GITHUB_TEST_REPO_NAME }}
52+
ref: ${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}
53+
54+
- name: Configure AWS Credentials
55+
uses: aws-actions/configure-aws-credentials@v4
56+
with:
57+
role-to-assume: ${{ env.TERRAFORM_AWS_ASSUME_ROLE}}
58+
aws-region: ${{ inputs.region || 'us-west-2' }}
59+
role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }}
60+
61+
- name: Install kubectl
62+
uses: azure/setup-kubectl@v3
63+
with:
64+
version: 'latest'
65+
66+
- name: Update kubeconfig for EKS cluster
67+
run: |
68+
aws eks update-kubeconfig --name $CLUSTER_NAME --region $AWS_REGION
69+
70+
- name: Scale up node groups (Sunday)
71+
if: github.event.schedule == '0 9 * * 0'
72+
run: |
73+
echo "Starting scale UP operation with desired capacity: $DESIRED_CAPACITY_PER_NODEGROUP"
74+
75+
for i in $(seq 1 $NODE_GROUP_COUNT); do
76+
echo "Scaling node group: $CLUSTER_NAME-node-${i} to $DESIRED_CAPACITY_PER_NODEGROUP"
77+
aws eks update-nodegroup-config \
78+
--cluster-name $CLUSTER_NAME \
79+
--nodegroup-name $CLUSTER_NAME-node-${i} \
80+
--region $AWS_REGION \
81+
--scaling-config desiredSize=$DESIRED_CAPACITY_PER_NODEGROUP
82+
83+
echo "Waiting 1 minute before scaling next node group..."
84+
sleep 60
85+
done
86+
87+
- name: Scale down node groups (Monday)
88+
if: github.event.schedule == '0 21 * * 1'
89+
run: |
90+
echo "Starting scale DOWN operation with desired capacity: 0"
91+
92+
for i in $(seq 1 $NODE_GROUP_COUNT); do
93+
echo "Scaling node group: $CLUSTER_NAME-node-${i} to 0"
94+
aws eks update-nodegroup-config \
95+
--cluster-name $CLUSTER_NAME \
96+
--nodegroup-name $CLUSTER_NAME-node-${i} \
97+
--region $AWS_REGION \
98+
--scaling-config desiredSize=0
99+
100+
echo "Waiting 1 minute before scaling next node group..."
101+
sleep 60
102+
done
103+
104+
- name: Scale node groups (Manual)
105+
if: github.event_name == 'workflow_dispatch'
106+
run: |
107+
echo "Starting manual scaling operation with desired capacity: $DESIRED_CAPACITY_PER_NODEGROUP"
108+
109+
for i in $(seq 1 $NODE_GROUP_COUNT); do
110+
echo "Scaling node group: $CLUSTER_NAME-node-${i} to $DESIRED_CAPACITY_PER_NODEGROUP"
111+
aws eks update-nodegroup-config \
112+
--cluster-name $CLUSTER_NAME \
113+
--nodegroup-name $CLUSTER_NAME-node-${i} \
114+
--region $AWS_REGION \
115+
--scaling-config desiredSize=$DESIRED_CAPACITY_PER_NODEGROUP
116+
117+
done
118+
119+
- name: Validate total node count
120+
run: |
121+
echo "Waiting 20 minutes for scaling operations to complete..."
122+
sleep 1200
123+
124+
echo "Validating total number of nodes in the cluster..."
125+
ACTUAL_NODE_COUNT=$(kubectl get nodes --no-headers | wc -l)
126+
127+
# Determine expected count based on trigger type
128+
if [ "${{ github.event.schedule }}" = "0 21 * * 1" ]; then
129+
EXPECTED_NODE_COUNT=$(($NODE_GROUP_COUNT * 0))
130+
else
131+
EXPECTED_NODE_COUNT=$(($NODE_GROUP_COUNT * $DESIRED_CAPACITY_PER_NODEGROUP))
132+
fi
133+
134+
echo "Expected total nodes: $EXPECTED_NODE_COUNT"
135+
echo "Actual total nodes: $ACTUAL_NODE_COUNT"
136+
137+
if [ "$ACTUAL_NODE_COUNT" -eq "$EXPECTED_NODE_COUNT" ]; then
138+
echo "Validation successful! Node count matches expected value."
139+
else
140+
echo "Validation failed. Expected $EXPECTED_NODE_COUNT nodes but found $ACTUAL_NODE_COUNT nodes."
141+
exit 1
142+
fi

RELEASE_NOTES

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
========================================================================
2+
Amazon CloudWatch Agent 1.300058.0 (2025-07-17)
3+
========================================================================
4+
Enhancements:
5+
* [ContainerInsights] Added ability to set CollectionRole via environment variable
6+
* [ContainerInsights] Increased data cache TTL and cleanup interval to support metric collection intervals greater than 300s
7+
* [Logs] Set default concurrency for multi-threaded log processing
8+
* [Logs] Improved log state file handling for Windows event logs
9+
* [Logs] Increased maximum log event size to 1MB and improved handling of large log lines
10+
111
========================================================================
212
Amazon CloudWatch Agent 1.300057.0 (2025-06-16)
313
========================================================================

cfg/envconfig/envconfig.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const (
1919
AWS_SDK_LOG_LEVEL = "AWS_SDK_LOG_LEVEL" //nolint:revive
2020
CWAGENT_USER_AGENT = "CWAGENT_USER_AGENT" //nolint:revive
2121
CWAGENT_LOG_LEVEL = "CWAGENT_LOG_LEVEL" //nolint:revive
22+
CWAGENT_ROLE = "CWAGENT_ROLE" //nolint:revive
2223
CWAGENT_USAGE_DATA = "CWAGENT_USAGE_DATA" //nolint:revive
2324
IMDS_NUMBER_RETRY = "IMDS_NUMBER_RETRY" //nolint:revive
2425
RunInContainer = "RUN_IN_CONTAINER"
@@ -42,8 +43,9 @@ const (
4243
)
4344

4445
const (
45-
// TrueValue is the expected string set on an environment variable to indicate true.
46-
TrueValue = "True"
46+
TrueValue = "True" // TrueValue is the expected string set on an environment variable to indicate true.
47+
LEADER = "LEADER" //nolint:revive
48+
NODE = "NODE" //nolint:revive
4749
)
4850

4951
var (

cmd/config-translator/translator_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,14 @@ func TestLogWindowsEventConfig(t *testing.T) {
111111
expectedErrorMap3 := map[string]int{}
112112
expectedErrorMap3["enum"] = 1
113113
checkIfSchemaValidateAsExpected(t, "../../translator/config/sampleSchema/invalidLogWindowsEventsWithInvalidEventFormatType.json", false, expectedErrorMap3)
114-
115-
//New tests for event_ids feature
116114
checkIfSchemaValidateAsExpected(t, "../../translator/config/sampleSchema/invalidLogWindowsEventsWithInvalidEventFormatType.json", false, expectedErrorMap3)
117115
expectedErrorMap4 := map[string]int{}
118116
expectedErrorMap4["invalid_type"] = 1
119117
checkIfSchemaValidateAsExpected(t, "../../translator/config/sampleSchema/invalidLogWindowsEventsWithInvalidEventIdsType.json", false, expectedErrorMap4)
120-
121118
expectedErrorMap5 := map[string]int{}
122119
expectedErrorMap5["required"] = 1
123120
expectedErrorMap5["number_any_of"] = 1
124121
checkIfSchemaValidateAsExpected(t, "../../translator/config/sampleSchema/invalidLogWindowsEventsWithMissingEventIdsAndEventLevels.json", false, expectedErrorMap5)
125-
126122
expectedErrorMap6 := map[string]int{}
127123
expectedErrorMap6["invalid_type"] = 1
128124
expectedErrorMap6["enum"] = 1

go.mod

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,46 @@ replace github.com/influxdata/telegraf => github.com/aws/telegraf v0.10.2-0.2025
77
// Replace with https://github.com/amazon-contributing/opentelemetry-collector-contrib, there are no requirements for all receivers/processors/exporters
88
// to be all replaced since there are some changes that will always be from upstream
99
replace (
10-
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter => github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.0.0-20250618011628-c38f9eb9d96a
11-
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter => github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsemfexporter v0.0.0-20250618011628-c38f9eb9d96a
12-
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter => github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsxrayexporter v0.0.0-20250618011628-c38f9eb9d96a
10+
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter => github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.0.0-20250717174233-f514045fc484
11+
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter => github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsemfexporter v0.0.0-20250717174233-f514045fc484
12+
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter => github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsxrayexporter v0.0.0-20250717174233-f514045fc484
1313
)
1414

1515
replace (
16-
github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware => github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware v0.0.0-20250618011628-c38f9eb9d96a
17-
github.com/open-telemetry/opentelemetry-collector-contrib/extension/awsproxy => github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsproxy v0.0.0-20250618011628-c38f9eb9d96a
16+
github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware => github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware v0.0.0-20250717174233-f514045fc484
17+
github.com/open-telemetry/opentelemetry-collector-contrib/extension/awsproxy => github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsproxy v0.0.0-20250717174233-f514045fc484
1818
)
1919

2020
replace (
21-
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/awsutil v0.0.0-20250618011628-c38f9eb9d96a
22-
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/containerinsight => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/containerinsight v0.0.0-20250618011628-c38f9eb9d96a
23-
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/cwlogs v0.0.0-20250618011628-c38f9eb9d96a
24-
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/k8s => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/k8s v0.0.0-20250618011628-c38f9eb9d96a
25-
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/proxy v0.0.0-20250618011628-c38f9eb9d96a
26-
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/xray v0.0.0-20250618011628-c38f9eb9d96a
27-
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/coreinternal v0.0.0-20250618011628-c38f9eb9d96a
28-
github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/k8sconfig v0.0.0-20250618011628-c38f9eb9d96a
29-
github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/kubelet v0.0.0-20250618011628-c38f9eb9d96a
30-
github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/metadataproviders v0.0.0-20250618011628-c38f9eb9d96a
21+
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/awsutil v0.0.0-20250717174233-f514045fc484
22+
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/containerinsight => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/containerinsight v0.0.0-20250717174233-f514045fc484
23+
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/cwlogs v0.0.0-20250717174233-f514045fc484
24+
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/k8s => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/k8s v0.0.0-20250717174233-f514045fc484
25+
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/metrics v0.0.0-20250717174233-f514045fc484
26+
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/proxy v0.0.0-20250717174233-f514045fc484
27+
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/xray v0.0.0-20250717174233-f514045fc484
28+
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/coreinternal v0.0.0-20250717174233-f514045fc484
29+
github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/k8sconfig v0.0.0-20250717174233-f514045fc484
30+
github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/kubelet v0.0.0-20250717174233-f514045fc484
31+
github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/metadataproviders v0.0.0-20250717174233-f514045fc484
3132
)
3233

3334
replace (
3435
// For clear resource attributes after copy functionality https://github.com/amazon-contributing/opentelemetry-collector-contrib/pull/148
35-
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry => github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.0.0-20250618011628-c38f9eb9d96a
36-
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/stanza v0.0.0-20250618011628-c38f9eb9d96a
36+
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry => github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.0.0-20250717174233-f514045fc484
37+
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/stanza v0.0.0-20250717174233-f514045fc484
3738
// Replace with contrib to revert upstream change https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/20519
38-
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus => github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/translator/prometheus v0.0.0-20250618011628-c38f9eb9d96a
39+
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus => github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/translator/prometheus v0.0.0-20250717174233-f514045fc484
3940
)
4041

41-
replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor => github.com/amazon-contributing/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.0.0-20250618011628-c38f9eb9d96a
42+
replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor => github.com/amazon-contributing/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.0.0-20250717174233-f514045fc484
4243

4344
replace (
44-
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.0.0-20250618011628-c38f9eb9d96a
45-
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver v0.0.0-20250618011628-c38f9eb9d96a
46-
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awsxrayreceiver v0.0.0-20250618011628-c38f9eb9d96a
47-
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jmxreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/jmxreceiver v0.0.0-20250618011628-c38f9eb9d96a
48-
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.0.0-20250618011628-c38f9eb9d96a
45+
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.0.0-20250717174233-f514045fc484
46+
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver v0.0.0-20250717174233-f514045fc484
47+
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awsxrayreceiver v0.0.0-20250717174233-f514045fc484
48+
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jmxreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/jmxreceiver v0.0.0-20250717174233-f514045fc484
49+
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.0.0-20250717174233-f514045fc484
4950
)
5051

5152
// Temporary fix, pending PR https://github.com/shirou/gopsutil/pull/957
@@ -312,7 +313,7 @@ require (
312313
github.com/eapache/go-resiliency v1.7.0 // indirect
313314
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
314315
github.com/eapache/queue v1.1.0 // indirect
315-
github.com/ebitengine/purego v0.8.2 // indirect
316+
github.com/ebitengine/purego v0.8.4 // indirect
316317
github.com/edsrzf/mmap-go v1.2.0 // indirect
317318
github.com/elastic/go-grok v0.3.1 // indirect
318319
github.com/elastic/lunes v0.1.0 // indirect

0 commit comments

Comments
 (0)