Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
7c8774d
almost all passing
the-mann Mar 10, 2025
95b11c2
passing
the-mann Mar 10, 2025
2a6d9df
check pod template labels instead of workload labels
the-mann Mar 10, 2025
b50163c
Provide Monitor functions (except Mutate) workload instead of pod tem…
the-mann Mar 10, 2025
3ce94cf
big progress
the-mann Mar 12, 2025
97ee02b
more progress
the-mann Mar 12, 2025
24c29cd
works
the-mann Mar 13, 2025
b2d6c1c
blah
the-mann Mar 19, 2025
c70f7f8
blah
the-mann Mar 19, 2025
e47e85a
fix logging, add more testing
the-mann Mar 19, 2025
6ab7980
remove unnecessary HasSynced
the-mann Mar 19, 2025
82750e1
Handle service deletion, service update. test service deletion
the-mann Mar 20, 2025
a886b9a
Improve backwards compatability, make MutateAndPatchAll work with bot…
the-mann Mar 21, 2025
9d6b4a7
Maintain legacy autoAnnotateAutoInstrumentation behavior.
the-mann Mar 21, 2025
1216808
Clean up
the-mann Mar 24, 2025
b5a0e96
undo dockerfile update
the-mann Mar 24, 2025
e1cf759
Fix integration tests
the-mann Mar 25, 2025
33df3e8
Rename auto_monitor*.go files to monitor*.go, rename AutoRestart to R…
the-mann Mar 26, 2025
734966f
Enable multi instrumentation feature flag, enable skip multi instrume…
the-mann Mar 27, 2025
ed696e5
come up with actual commit message
the-mann Apr 9, 2025
319e18a
Update tests to expect `namespace` in exclude and `customSelector` to…
the-mann Apr 9, 2025
42f6e23
add transformer, warning function
the-mann Apr 9, 2025
d35ed59
fix integration tests to work with new exclude syntax
the-mann Apr 10, 2025
fbafe30
namespace-level exclude should update pod template, but namespace-lev…
the-mann Apr 11, 2025
d65c9f0
Use correct autoAnnotationConfigStr to create Instrumentation Annotator
the-mann Apr 23, 2025
eecdc14
Restart namespace for AutoMonitor based on `restartPods`, always rest…
the-mann Apr 23, 2025
185ff81
omit languages, exclude, and customselector when empty
the-mann Apr 23, 2025
c28093a
add more integ tests for AutoMonitor
the-mann Apr 23, 2025
707856b
fix permutation 9 (don't use kube-system)
the-mann Apr 24, 2025
a702b6a
improve comments
the-mann Apr 25, 2025
d9c3a00
Fix integ tests
the-mann Apr 25, 2025
20b463c
add `DISABLE_AUTO_MONITOR` environment variable
the-mann Apr 25, 2025
47e3b80
update github workflow to run new integration tests
the-mann Apr 25, 2025
d533077
Merge remote-tracking branch 'origin/main' into mpmann/appsignals-1-step
the-mann Apr 25, 2025
936f0c2
Add controller manager name flag for minikube deployment
the-mann Apr 25, 2025
4a86baf
Add controller manager name flag for minikube deployment
the-mann Apr 25, 2025
cabba78
Add manifest files
the-mann Apr 25, 2025
955e643
temp: add log for cloudwatch controller manager for instrumentation t…
the-mann Apr 25, 2025
a2007b0
temp: add log for cloudwatch controller manager for instrumentation t…
the-mann Apr 25, 2025
d55e3cf
Correctly return nil when automonitor and autoannotation are disabled
the-mann Apr 25, 2025
aae6fd5
Remove redundant annotation config clears
the-mann Apr 25, 2025
e603175
Refactor annotation functions
the-mann Apr 25, 2025
3bfe07c
disable autoannotation if autoAnnotationConfig is empty and AutoMonit…
the-mann Apr 25, 2025
0ffe221
Add namespace MutateObject tests, fix namespace mutation.
the-mann May 1, 2025
3b7cb97
Add default exclusion for kube-system and amazon-cloudwatch
the-mann May 1, 2025
68101a0
Split MutateAndPatchAll into MutateAndPatchWorklads and MutateAndPatc…
the-mann May 1, 2025
efbe7c3
Add license
the-mann May 1, 2025
88ade73
Do not modify feature flag values, instead override at podmutator lev…
the-mann May 1, 2025
464bf37
Update generated api.md
the-mann May 1, 2025
8007439
Fix linter issues
the-mann May 1, 2025
5552674
Revert Dockerfile change
the-mann May 7, 2025
9c8bc8d
Implement feedback
the-mann May 7, 2025
b68d141
Remove integ tests
the-mann May 7, 2025
0ce0a2b
Add Integ tests
the-mann May 7, 2025
37719c8
merge test files into single test file
movence May 5, 2025
b670fbf
update test cases and clean ups
movence May 8, 2025
c445128
fix flaky tests
movence May 9, 2025
e1c756b
Merge remote-tracking branch 'origin/main' into hsookim/appsignals-1-…
the-mann May 12, 2025
88cb816
fix linting
the-mann May 12, 2025
499b9b4
fix linting
the-mann May 12, 2025
d83fde7
parallelize test run
the-mann May 12, 2025
5be0f19
share docker image
the-mann May 12, 2025
0da82c3
share docker image
the-mann May 12, 2025
d7d6233
share docker image
the-mann May 12, 2025
09a114b
cache go dependencies
the-mann May 12, 2025
9789ee6
cache go dependencies
the-mann May 12, 2025
c0ae5d9
cache go dependencies
the-mann May 12, 2025
6966cea
cache more image builds
the-mann May 12, 2025
7bd2878
add integ tests
movence May 9, 2025
799778e
sync updates
movence May 13, 2025
56b5e1d
missing blocks
movence May 13, 2025
9039274
Fix automonitor unit test flakeyness by extending service informer wa…
the-mann May 13, 2025
212b606
Combine monitor and annotation update into one kubectl call
the-mann May 13, 2025
a660894
fix linting
the-mann May 13, 2025
220167b
add .dockerignore to slim down build
the-mann May 13, 2025
06089a2
Rework RestartWorkload to use kubectl
the-mann May 13, 2025
2c7e2ad
try wait command instead
the-mann May 13, 2025
763996e
Revert "try wait command instead"
the-mann May 13, 2025
4a23268
Revert "Rework RestartWorkload to use kubectl"
the-mann May 13, 2025
1dd0a81
don't skip validation for empty annotations
the-mann May 13, 2025
d3947ea
give operator more time to start up
the-mann May 13, 2025
4d599a8
add sleep to restart
the-mann May 13, 2025
ec04efe
fix nsDatabase
the-mann May 13, 2025
ed4b2fb
fix 17
the-mann May 13, 2025
b4801ae
validate pod init containers instead of pod annotations.
the-mann May 13, 2025
988c1eb
fix TestServiceThenDeployment
the-mann May 13, 2025
4e39db8
fix 21
the-mann May 13, 2025
1d0ef86
improve logging
the-mann May 14, 2025
52c6aa7
fix test 21
the-mann May 14, 2025
e288425
fix test 21
the-mann May 14, 2025
d8b8e46
fix logging
the-mann May 14, 2025
6a94cde
Reduce throttling by adding SharedIndexInformers for workloads
the-mann May 14, 2025
a940c37
use patching
the-mann May 14, 2025
5f0693b
use patching
the-mann May 14, 2025
8571943
use patching
the-mann May 14, 2025
bc2a0b3
Add TestDeploymentThenServiceRestartPodsEnabledSameManifest integrati…
the-mann May 14, 2025
8b5fbfc
remove sleeps to speed up tests
the-mann May 14, 2025
5d3ae8f
revert remove sleep to speed up tests
the-mann May 14, 2025
52afaf2
Move informer initialization logic to util.go
the-mann May 15, 2025
ca244fc
move follow up changes to mpmann/auto-monitor-follow-up branch
the-mann May 15, 2025
655ac06
Auto Monitor follow up changes (#311)
the-mann May 22, 2025
2bfcbf2
fix linting issues
the-mann May 22, 2025
e50c0eb
Add delay to make operator integ tests more consistent
the-mann May 22, 2025
5db0bbd
add more delay
the-mann Sep 26, 2025
3dfbd6b
Merge remote-tracking branch 'origin/main' into hsookim/appsignals-1-…
the-mann Sep 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*_test.go
integration-tests
bin
.github
amazon-cloudwatch-agent-operator
158 changes: 142 additions & 16 deletions .github/workflows/operator-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ permissions:
jobs:
InstrumentationTest:
name: InstrumentationTest
needs: [BuildAndCacheImage]
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -31,7 +32,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-go@v5
- name: Start minikube
uses: medyagh/setup-minikube@master

Expand All @@ -44,11 +45,17 @@ jobs:
sleep 10
kubectl get pods -A

- name: Build image
- name: Restore cached Docker image
uses: actions/cache@v3
with:
path: image.tar
key: docker-image-${{ github.sha }}

- name: Load Docker image
run: |
eval $(minikube docker-env)
make container
docker images
docker load < image.tar


- name: Deploy operator to minikube
run: |
Expand Down Expand Up @@ -78,6 +85,7 @@ jobs:
kubectl wait --for=condition=Ready pod --all -n default
kubectl get pods -A
kubectl describe pods -n default
kubectl logs deployment/cloudwatch-controller-manager --all-containers=true -n amazon-cloudwatch
go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/java/default_instrumentation_java_env_variables.json app_signals

- name: Test for defined instrumentation resources for Java
Expand Down Expand Up @@ -230,6 +238,7 @@ jobs:

DeploymentAnnotationsTest:
name: DeploymentAnnotationsTest
needs: [BuildAndCacheImage]
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -239,6 +248,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v5

- name: Start minikube
uses: medyagh/setup-minikube@master
Expand All @@ -252,11 +262,16 @@ jobs:
sleep 10
kubectl get pods -A

- name: Build image
- name: Restore cached Docker image
uses: actions/cache@v3
with:
path: image.tar
key: docker-image-${{ github.sha }}

- name: Load Docker image
run: |
eval $(minikube docker-env)
make container
docker images
docker load < image.tar

- name: Deploy operator to minikube
run: |
Expand All @@ -280,9 +295,97 @@ jobs:
go test -v -run TestNodeJSOnlyDeployment ./integration-tests/manifests/annotations -timeout 30m
sleep 5
go test -v -run TestAnnotationsOnMultipleResources ./integration-tests/manifests/annotations -timeout 30m
DefineAutoMonitorTestMatrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v5
- name: Generate test list
id: tests
run: |
cd integration-tests/manifests/automonitor/ && \
echo "tests<<EOF" >> $GITHUB_OUTPUT
go test -list . | sed -e '$d' >> $GITHUB_OUTPUT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, can we call the test directly using absolute path?

Suggested change
go test -list . | sed -e '$d' >> $GITHUB_OUTPUT
go test -list integration-tests/manifest/automonitor/ | sed -e '$d' >> $GITHUB_OUTPUT

echo "EOF" >> $GITHUB_OUTPUT
- name: Create test matrix
id: set-matrix
run: |
TESTS=$(echo "${{ steps.tests.outputs.tests }}" | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "matrix={\"test\":${TESTS}}" >> $GITHUB_OUTPUT
BuildAndCacheImage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v5
- name: Build image
run: |
make container
docker save $(docker images --format '{{.Repository}}:{{.Tag}}' | grep operator | head -n 1) > image.tar

- name: Cache Docker image
uses: actions/cache@v3
with:
path: image.tar
key: docker-image-${{ github.sha }}

AutoMonitorTest:
name: AutoMonitorTest
runs-on: ubuntu-latest
needs: [DefineAutoMonitorTestMatrix, BuildAndCacheImage]
permissions:
id-token: write
contents: read
strategy:
matrix: ${{fromJson(needs.DefineAutoMonitorTestMatrix.outputs.matrix)}}
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v5

- name: Start minikube
uses: medyagh/setup-minikube@master

- name: Deploy cert-manager to minikube
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: at some point we should combine the start minikube, deploy cert-manager, and verify minikube and cert manager steps into their own workflow since they're used everywhere

run:
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml

- name: Verify minikube and cert-manager
run: |
sleep 10
kubectl get pods -A

- name: Restore cached Docker image
uses: actions/cache@v3
with:
path: image.tar
key: docker-image-${{ github.sha }}

- name: Load Docker image
run: |
eval $(minikube docker-env)
docker load < image.tar

- name: Deploy operator to minikube
run: |
make deploy

- name: Test AutoMonitor-created annotations
run: |
kubectl get pods -A
kubectl describe pods -n default
go test -v ./integration-tests/manifests/automonitor -run ^${{ matrix.test }}$ -timeout 60m -controllerManagerName 'cloudwatch-controller-manager'

DaemonsetAnnotationsTest:
name: DaemonsetAnnotationsTest
needs: [BuildAndCacheImage]
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -292,6 +395,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v5

- name: Start minikube
uses: medyagh/setup-minikube@master
Expand All @@ -305,11 +409,17 @@ jobs:
sleep 10
kubectl get pods -A

- name: Build image
- name: Restore cached Docker image
uses: actions/cache@v3
with:
path: image.tar
key: docker-image-${{ github.sha }}

- name: Load Docker image
run: |
eval $(minikube docker-env)
make container
docker images
docker load < image.tar


- name: Deploy operator to minikube
run: |
Expand All @@ -336,6 +446,7 @@ jobs:

StatefulsetAnnotationsTest:
name: StatefulsetAnnotationsTest
needs: [BuildAndCacheImage]
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -345,6 +456,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v5

- name: Start minikube
uses: medyagh/setup-minikube@master
Expand All @@ -358,11 +470,17 @@ jobs:
sleep 10
kubectl get pods -A

- name: Build image
- name: Restore cached Docker image
uses: actions/cache@v3
with:
path: image.tar
key: docker-image-${{ github.sha }}

- name: Load Docker image
run: |
eval $(minikube docker-env)
make container
docker images
docker load < image.tar


- name: Deploy operator to minikube
run: |
Expand Down Expand Up @@ -390,6 +508,7 @@ jobs:

NamespaceAnnotationsTest:
name: NamespaceAnnotationsTest
needs: [BuildAndCacheImage]
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -399,6 +518,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v5

- name: Start minikube
uses: medyagh/setup-minikube@master
Expand All @@ -411,11 +531,17 @@ jobs:
run: |
kubectl get pods -A

- name: Build image
- name: Restore cached Docker image
uses: actions/cache@v3
with:
path: image.tar
key: docker-image-${{ github.sha }}

- name: Load Docker image
run: |
eval $(minikube docker-env)
make container
docker images
docker load < image.tar


- name: Deploy operator to minikube
run: |
Expand Down
32 changes: 32 additions & 0 deletions integration-tests/manifests/admin-dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of these manifests are pretty much identical but just different names. Can we re-use just 1?

kind: Deployment
metadata:
name: admin-dashboard
labels:
app: admin-dashboard
spec:
replicas: 1
selector:
matchLabels:
app: admin-dashboard
template:
metadata:
labels:
app: admin-dashboard
spec:
containers:
- name: admin-dashboard-container
image: nginx:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: admin-dashboard-service
spec:
selector:
app: admin-dashboard
ports:
- port: 80
targetPort: 80
Loading
Loading