Skip to content

Conversation

@crohr
Copy link
Contributor

@crohr crohr commented Jan 29, 2026

Summary

  • Adds isCloudWatchAgentRunning() function to check if the CloudWatch agent is running via amazon-cloudwatch-agent-ctl -a status
  • Modifies the configuration logic to start the agent with fetch-config if not running, or append config with append-config if already running
  • Fixes Makefile dist target to use correct Windows binary filename (main-windows-amd64.exe)

This ensures backwards compatibility as the native OTEL integration removes the default agent startup from RunsOn instances.

Closes #25

Test plan

  • Test on a runner where CloudWatch agent is already running (should use append-config)
  • Test on a runner where CloudWatch agent is NOT running (should use fetch-config to start it)
  • Verify metrics are collected in both scenarios

crohr added 3 commits January 29, 2026 16:22
When metrics are enabled, the action now checks if the CloudWatch agent
is already running before applying configuration. If the agent is not
running, it starts the agent with the configuration using `fetch-config`.
If the agent is already running, it appends the configuration using
`append-config` (previous behavior).

This ensures backwards compatibility as the native OTEL integration
removes the default agent startup from RunsOn instances.

Fixes #25
@crohr crohr force-pushed the fix/25-auto-start-cloudwatch-agent branch from 1c39943 to fe492ae Compare February 5, 2026 08:49
@crohr crohr merged commit 4bd75c6 into main Feb 11, 2026
19 checks passed
@crohr crohr deleted the fix/25-auto-start-cloudwatch-agent branch February 11, 2026 15:16
@crohr crohr restored the fix/25-auto-start-cloudwatch-agent branch February 11, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make sure to automatically start CloudWatch agent if not started yet

1 participant