Skip to content

Commit 310ba61

Browse files
okankoAMZParamadonmusa-asadmitali-salvijefchien
authored
Rebasing Target Allocator Branch to Main (#266)
* Adding support for NodeJS auto instrumentation and integ tests (#220) * Support configurable resources for NodeJS. (#225) * Supporting JMX annotations (#240) * Add support for a supplemental YAML configuration for the CloudWatchAgent (#241) * Changed naming for OTLP container ports from agent JSON (#252) * Updated Release Notes for 1.8.0 (#251) * Adjust EKS add-on integration test service count expectations (#256) * Add integration tests for JMX. (#250) * Implemented Target Allocator Container (#214) * Implemented TargetAllocator resource deployments. (#208) * Update cmd/amazon-cloudwatch-agent-target-allocator/config/config.go Co-authored-by: Musa <[email protected]> * Update internal/config/main.go Co-authored-by: Musa <[email protected]> --------- Co-authored-by: Parampreet Singh <[email protected]> Co-authored-by: Musa <[email protected]> Co-authored-by: Mitali Salvi <[email protected]> Co-authored-by: Jeffrey Chien <[email protected]>
1 parent f82db5a commit 310ba61

File tree

61 files changed

+2736
-193
lines changed

Some content is hidden

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

61 files changed

+2736
-193
lines changed

.github/workflows/operator-integration-test.yml

Lines changed: 70 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
kubectl wait --for=condition=Ready pod --all -n default
7979
kubectl get pods -A
8080
kubectl describe pods -n default
81-
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/java/default_instrumentation_java_env_variables.json
81+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/java/default_instrumentation_java_env_variables.json app_signals
8282
8383
- name: Test for defined instrumentation resources for Java
8484
run: |
@@ -87,7 +87,7 @@ jobs:
8787
sleep 5
8888
kubectl wait --for=condition=Ready pod --all -n default
8989
90-
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/manifests/cmd/ns_instrumentation_env_variables.json
90+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/manifests/cmd/ns_instrumentation_env_variables.json app_signals
9191
kubectl delete instrumentation sample-instrumentation
9292
9393
- name: Test for default instrumentation resources for python
@@ -97,15 +97,15 @@ jobs:
9797
kubectl wait --for=condition=Ready pod --all -n default
9898
kubectl get pods -A
9999
kubectl describe pods -n default
100-
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python/default_instrumentation_python_env_variables.json
100+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python/default_instrumentation_python_env_variables.json app_signals
101101
102102
- name: Test for defined instrumentation resources for python
103103
run: |
104104
kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml
105105
kubectl delete pods --all -n default
106106
sleep 5
107107
kubectl wait --for=condition=Ready pod --all -n default
108-
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/manifests/cmd/ns_instrumentation_env_variables.json
108+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/manifests/cmd/ns_instrumentation_env_variables.json app_signals
109109
kubectl delete instrumentation sample-instrumentation
110110
111111
- name: Test for default instrumentation resources for dotnet
@@ -116,15 +116,15 @@ jobs:
116116
kubectl wait --for=condition=Available deployment/nginx -n default
117117
kubectl get pods -A
118118
kubectl describe pods -n default
119-
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/dotnet/default_instrumentation_dotnet_env_variables.json
119+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/dotnet/default_instrumentation_dotnet_env_variables.json app_signals
120120
121121
- name: Test for defined instrumentation resources for dotnet
122122
run: |
123123
kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml
124124
kubectl delete pods --all -n default
125125
sleep 5
126126
kubectl wait --for=condition=Ready pod --all -n default
127-
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/manifests/cmd/ns_instrumentation_env_variables.json
127+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/manifests/cmd/ns_instrumentation_env_variables.json app_signals
128128
kubectl delete instrumentation sample-instrumentation
129129
130130
- name: Test for default instrumentation resources for nodejs
@@ -137,7 +137,7 @@ jobs:
137137
kubectl wait --for=condition=Available deployment/nginx -n default
138138
kubectl get pods -A
139139
kubectl describe pods -n default
140-
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/nodejs/default_instrumentation_nodejs_env_variables.json
140+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/nodejs/default_instrumentation_nodejs_env_variables.json app_signals
141141
142142
- name: Test for defined instrumentation resources for nodejs
143143
run: |
@@ -146,7 +146,7 @@ jobs:
146146
sleep 5
147147
kubectl wait --for=condition=Available deployment/nginx -n default
148148
sleep 5
149-
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/manifests/cmd/ns_instrumentation_env_variables.json
149+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/manifests/cmd/ns_instrumentation_env_variables.json app_signals
150150
kubectl delete instrumentation sample-instrumentation
151151
152152
- name: Test for default instrumentation resources for all languages
@@ -155,8 +155,7 @@ jobs:
155155
sleep 5
156156
kubectl wait --for=condition=Available deployment/nginx -n default
157157
sleep 5
158-
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/all-languages/default_instrumentation_all-languages_env_variables.json
159-
158+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/all-languages/default_instrumentation_all-languages_env_variables.json app_signals
160159
161160
- name: Test for defined instrumentation resources for all languages
162161
run: |
@@ -165,9 +164,69 @@ jobs:
165164
sleep 5
166165
kubectl wait --for=condition=Available deployment/nginx -n default
167166
sleep 5
168-
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/manifests/cmd/ns_instrumentation_env_variables.json
167+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/manifests/cmd/ns_instrumentation_env_variables.json app_signals
169168
kubectl delete instrumentation sample-instrumentation
170169
170+
- name: Test for default instrumentation resources for jmx
171+
run: |
172+
kubectl delete pods --all -n default
173+
sleep 5
174+
cat integration-tests/jmx/sample-deployment-jmx.yaml
175+
kubectl apply -f integration-tests/jmx/sample-deployment-jmx.yaml
176+
sleep 5
177+
kubectl wait --for=condition=Available deployment/nginx -n default
178+
kubectl get pods -A
179+
kubectl describe pods -n default
180+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/jmx/default_instrumentation_jmx_env_variables.json app_signals
181+
182+
- name: Test for defined instrumentation resources for jmx
183+
run: |
184+
kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml
185+
kubectl delete pods --all -n default
186+
sleep 5
187+
kubectl wait --for=condition=Available deployment/nginx -n default
188+
sleep 5
189+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/manifests/cmd/ns_instrumentation_env_variables.json app_signals
190+
kubectl delete instrumentation sample-instrumentation
191+
192+
- name: Test case for cloudwatch agent without app signals pod creation
193+
run: |
194+
kubectl delete daemonset cloudwatch-agent -n amazon-cloudwatch
195+
sleep 5
196+
kubectl apply -f integration-tests/manifests/cloudwatch-agent-daemonset-no-app-signals.yaml -n amazon-cloudwatch
197+
sleep 20
198+
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
199+
200+
pod_name="$(kubectl get pods -n amazon-cloudwatch -l app.kubernetes.io/component=amazon-cloudwatch-agent,app.kubernetes.io/instance=amazon-cloudwatch.cloudwatch-agent -o=jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}')"
201+
if [ -z "$pod_name" ]; then
202+
echo "Pod $pod_name is not created. Exiting with ERROR."
203+
echo "Pod is not created test case: FAIL"
204+
else
205+
echo "Pod $pod_name is created."
206+
echo "Pod is created test case: PASS"
207+
fi
208+
209+
- name: Test for default instrumentation resources for jmx without app signals
210+
run: |
211+
kubectl delete pods --all -n default
212+
sleep 5
213+
cat integration-tests/jmx/sample-deployment-jmx.yaml
214+
kubectl apply -f integration-tests/jmx/sample-deployment-jmx.yaml
215+
sleep 5
216+
kubectl wait --for=condition=Available deployment/nginx -n default
217+
kubectl get pods -A
218+
kubectl describe pods -n default
219+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/jmx/default_instrumentation_jmx_env_variables_no_app_signals.json no_app_signals
220+
221+
- name: Test for defined instrumentation resources for jmx without app signals
222+
run: |
223+
kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml
224+
kubectl delete pods --all -n default
225+
sleep 5
226+
kubectl wait --for=condition=Available deployment/nginx -n default
227+
sleep 5
228+
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/manifests/cmd/ns_instrumentation_env_variables.json app_signals
229+
kubectl delete instrumentation sample-instrumentation
171230
172231
DeploymentAnnotationsTest:
173232
name: DeploymentAnnotationsTest

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ IMG ?= ${IMG_PREFIX}/${IMG_REPO}:${VERSION}
1818
ARCH ?= $(shell go env GOARCH)
1919

2020
TARGET_ALLOCATOR_IMG_REPO ?= target-allocator
21-
TARGET_ALLOCATOR_IMG ?=${IMG_PREFIX}/${TARGET_ALLOCATOR_IMG_REPO}:${TARGET_ALLOCATOR_VERSION}
21+
TARGET_ALLOCATOR_IMG ?= ${IMG_PREFIX}/${TARGET_ALLOCATOR_IMG_REPO}:${TARGET_ALLOCATOR_VERSION}
2222

2323
# Options for 'bundle-build'
2424
ifneq ($(origin CHANNELS), undefined)

RELEASE_NOTES

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
========================================================================
2+
Amazon CloudWatch Agent Operator v1.8.0 (2024-10-17)
3+
========================================================================
4+
Enhancements:
5+
* Support JMX annotations
6+
* Support supplemental OTEL YAML configuration
7+
* [ApplicationSignals] Support configurable resources for NodeJS
8+
* [ApplicationSignals] Only add Application Signals ports to service when enabled in agent configuration
9+
110
========================================================================
211
Amazon CloudWatch Agent Operator v1.7.0 (2024-09-03)
312
========================================================================

apis/v1alpha1/amazoncloudwatchagent_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ type AmazonCloudWatchAgentSpec struct {
173173
// Config is the raw JSON to be used as the collector's configuration. Refer to the OpenTelemetry Collector documentation for details.
174174
// +required
175175
Config string `json:"config,omitempty"`
176+
// Config is the raw YAML to be used as the collector's configuration. Refer to the OpenTelemetry Collector documentation for details.
177+
// +optional
178+
OtelConfig string `json:"otelConfig,omitempty"`
176179
// VolumeMounts represents the mount points to use in the underlying collector deployment(s)
177180
// +optional
178181
// +listType=atomic

apis/v1alpha2/amazoncloudwatchagent_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ type AmazonCloudWatchAgentSpec struct {
9898
// Config is the raw JSON to be used as the collector's configuration. Refer to the OpenTelemetry Collector documentation for details.
9999
// +required
100100
Config string `json:"config,omitempty"`
101+
// Config is the raw YAML to be used as the collector's configuration. Refer to the OpenTelemetry Collector documentation for details.
102+
// +optional
103+
OtelConfig string `json:"otelConfig,omitempty"`
101104
// VolumeMounts represents the mount points to use in the underlying collector deployment(s)
102105
// +optional
103106
// +listType=atomic

config/crd/bases/cloudwatch.aws.amazon.com_amazoncloudwatchagents.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4502,6 +4502,11 @@ spec:
45024502
type: boolean
45034503
type: object
45044504
type: object
4505+
otelConfig:
4506+
description: Config is the raw YAML to be used as the collector's
4507+
configuration. Refer to the OpenTelemetry Collector documentation
4508+
for details.
4509+
type: string
45054510
podAnnotations:
45064511
additionalProperties:
45074512
type: string

integration-tests/all-languages/default_instrumentation_all-languages_env_variables.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"DOTNET_ADDITIONAL_DEPS": "/otel-auto-instrumentation-dotnet/AdditionalDeps",
2121
"OTEL_DOTNET_AUTO_HOME": "/otel-auto-instrumentation-dotnet",
2222
"DOTNET_SHARED_STORE": "/otel-auto-instrumentation-dotnet/store",
23-
"CORECLR_ENABLE_PROFILING": "1"
24-
25-
}
23+
"CORECLR_ENABLE_PROFILING": "1",
24+
"OTEL_AWS_JMX_EXPORTER_METRICS_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4314/v1/metrics",
25+
"OTEL_JMX_TARGET_SYSTEM": "jvm,tomcat,kafka,kafka-consumer,kafka-producer"
26+
}

integration-tests/all-languages/sample-deployment-all-languages.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ spec:
1414
instrumentation.opentelemetry.io/inject-python: "true"
1515
instrumentation.opentelemetry.io/inject-java: "true"
1616
instrumentation.opentelemetry.io/inject-dotnet: "true"
17+
instrumentation.opentelemetry.io/inject-nodejs: "true"
18+
cloudwatch.aws.amazon.com/inject-jmx-jvm: "true"
19+
cloudwatch.aws.amazon.com/inject-jmx-tomcat: "true"
20+
cloudwatch.aws.amazon.com/inject-jmx-kafka: "true"
21+
cloudwatch.aws.amazon.com/inject-jmx-kafka-consumer: "true"
22+
cloudwatch.aws.amazon.com/inject-jmx-kafka-producer: "true"
1723
spec:
1824
containers:
1925
- name: nginx

integration-tests/eks/resourceCount_linuxonly_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ package eks_addon
99
const (
1010
// Services count for CW agent on Linux and Windows
1111
serviceCountLinux = 6
12-
serviceCountWindows = 6
12+
serviceCountWindows = 4
1313

1414
// DaemonSet count for CW agent on Linux and Windows
1515
daemonsetCountLinux = 4

integration-tests/eks/resourceCount_windowslinux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ package eks_addon
99
const (
1010
// Services count for CW agent on Linux and Windows
1111
serviceCountLinux = 6
12-
serviceCountWindows = 6
12+
serviceCountWindows = 4
1313

1414
// DaemonSet count for CW agent on Linux and Windows
1515
daemonsetCountLinux = 4

0 commit comments

Comments
 (0)