feat: add CloudWatch backed Kubernetes events query support#282
feat: add CloudWatch backed Kubernetes events query support#282chalindukodikara wants to merge 2 commits into
Conversation
Signed-off-by: Chalindu Kodikara <chalindumkodikara@gmail.com>
Signed-off-by: Chalindu Kodikara <chalindumkodikara@gmail.com>
📝 WalkthroughWalkthroughAdds Kubernetes events support to the CloudWatch observability adapter, including dedicated log-group configuration and provisioning, component/workflow event queries, a new API handler, deployment wiring, tests, and installation documentation. ChangesCloudWatch Kubernetes events support
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant QueryEvents
participant CloudWatchClient
participant CloudWatchLogs
Client->>QueryEvents: POST /api/v1/events/query
QueryEvents->>CloudWatchClient: Select component or workflow query
CloudWatchClient->>CloudWatchLogs: Run Logs Insights query
CloudWatchLogs-->>CloudWatchClient: Return event rows
CloudWatchClient-->>QueryEvents: Return normalized EventsResult
QueryEvents-->>Client: Return events response
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
observability-logs-aws-cloudwatch/README.md (3)
202-209: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winFix "three paths" to "four paths".
The text says "The CloudWatch adapter needs permissions for three paths:" but now lists four numbered items (including the new "Kubernetes event queries over the events log group").
📝 Proposed fix
-The CloudWatch adapter needs permissions for three paths: +The CloudWatch adapter needs permissions for four paths:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@observability-logs-aws-cloudwatch/README.md` around lines 202 - 209, Update the IAM permissions introduction in the README to state that the CloudWatch adapter needs permissions for four paths, matching the four numbered items listed below.
815-821: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate "attach both" to reflect three policies.
The static-credentials section says "Create an IAM user and attach both:" but now lists three items: the Adapter IAM policy, the Setup Job IAM policy, and
CloudWatchAgentServerPolicy.📝 Proposed fix
-Create an IAM user and attach both: +Create an IAM user and attach the following:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@observability-logs-aws-cloudwatch/README.md` around lines 815 - 821, Update the Step 2 heading sentence in the README from “attach both” to “attach all three” so it accurately introduces the Adapter IAM policy, Setup Job IAM policy, and CloudWatchAgentServerPolicy.
1387-1389: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAdd a v0.3.x compatibility row. The README now uses module version 0.3.0 in the install commands, but the compatibility table still only lists v0.2.x → v1.1.x; add v0.3.x or update the note if 0.3.0 is still tied to v1.1.x.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@observability-logs-aws-cloudwatch/README.md` around lines 1387 - 1389, Add a v0.3.x entry to the README compatibility table, mapping it to the appropriate OpenChoreo version consistent with the v0.3.0 installation commands; if it remains compatible with v1.1.x, record that mapping explicitly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@observability-logs-aws-cloudwatch/README.md`:
- Around line 202-209: Update the IAM permissions introduction in the README to
state that the CloudWatch adapter needs permissions for four paths, matching the
four numbered items listed below.
- Around line 815-821: Update the Step 2 heading sentence in the README from
“attach both” to “attach all three” so it accurately introduces the Adapter IAM
policy, Setup Job IAM policy, and CloudWatchAgentServerPolicy.
- Around line 1387-1389: Add a v0.3.x entry to the README compatibility table,
mapping it to the appropriate OpenChoreo version consistent with the v0.3.0
installation commands; if it remains compatible with v1.1.x, record that mapping
explicitly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 462e1cbe-f2c0-4646-806b-5aa603162b12
⛔ Files ignored due to path filters (2)
observability-logs-aws-cloudwatch/internal/api/gen/models.gen.gois excluded by!**/gen/**observability-logs-aws-cloudwatch/internal/api/gen/server.gen.gois excluded by!**/gen/**
📒 Files selected for processing (22)
observability-events-otel-collector/README.mdobservability-logs-aws-cloudwatch/Makefileobservability-logs-aws-cloudwatch/README.mdobservability-logs-aws-cloudwatch/VERSIONobservability-logs-aws-cloudwatch/helm/templates/_helpers.tplobservability-logs-aws-cloudwatch/helm/templates/adapter/configmap.yamlobservability-logs-aws-cloudwatch/helm/templates/cloudwatch-setup/job.yamlobservability-logs-aws-cloudwatch/helm/values.yamlobservability-logs-aws-cloudwatch/init/setup-cloudwatch.shobservability-logs-aws-cloudwatch/internal/cloudwatch/client.goobservability-logs-aws-cloudwatch/internal/cloudwatch/event_labels.goobservability-logs-aws-cloudwatch/internal/cloudwatch/event_queries.goobservability-logs-aws-cloudwatch/internal/cloudwatch/event_queries_test.goobservability-logs-aws-cloudwatch/internal/cloudwatch/event_types.goobservability-logs-aws-cloudwatch/internal/cloudwatch/events.goobservability-logs-aws-cloudwatch/internal/cloudwatch/events_test.goobservability-logs-aws-cloudwatch/internal/config.goobservability-logs-aws-cloudwatch/internal/config_test.goobservability-logs-aws-cloudwatch/internal/event_handlers_test.goobservability-logs-aws-cloudwatch/internal/handlers.goobservability-logs-aws-cloudwatch/internal/handlers_test.goobservability-logs-aws-cloudwatch/main.go
Purpose
Enable observability-logs-aws-cloudwatch to query Kubernetes events from CloudWatch Logs, scoped by OpenChoreo component or workflow, with event ingestion handled by observability-events-otel-collector.
Approach
Adds Kubernetes event query support to observability-logs-aws-cloudwatch, backed by CloudWatch Logs Insights. This brings the CloudWatch logs adapter closer to parity with the OpenSearch/OpenObserve logs adapters by implementing:
Related Issues
Checklist
Remarks
Summary by CodeRabbit
New Features
Documentation
Chores