feat(tools): cross-signal correlation with ArgoCD timeline (Phase 4/4)#107
Merged
Conversation
… 4/4) Add a read-only correlate.workload tool that merges the change timeline (k8s + docker) with ArgoCD sync history into one newest-first evidence chain and surfaces a candidate-cause line (the most recent non-event change/sync). ArgoCD is integrated as a change.ChangeSource via a new exported ArgoClient.AppHistory wrapper over the existing read-only v1 API. v1 correlates change + k8s events + Argo sync; Prometheus-metric and log/trace correlation are deferred to v2. Read-only, RiskLow. Phase 4 of #103. Signed-off-by: rlaope <piyrw9754@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
correlate.workload: a read-only tool that merges the change timeline (k8s + docker, which already includes k8s events) with ArgoCD sync history into one newest-first evidence chain, and surfaces a candidate-cause line (the most recent non-event change/sync in the window).change.ChangeSourcevia a new exportedArgoClient.AppHistorywrapper over the existing read-only v1 API (GET only, app nameurl.PathEscape-d).Closes #103.
What's new
internal/core/tools/gitops/argocd.go— exported(*ArgoClient).AppHistory(ctx, app)(reuses RawGet + parseArgoHistory).internal/core/tools/correlate/—correlate.workloadtool,argoSource(change.ChangeSource over Argo history),historyToEvents, register, tests.internal/wiring/tools.go— correlate registration (k8s hub + docker hub + gitops Argo clients); MarkSkipped when no source.internal/wiring/skills_test.go—correlate.workloadin canonicalToolNames.Scope
v1 correlates change + k8s events + ArgoCD sync, time-aligned, with symptom→candidate-cause. Prometheus-metric and log/trace correlation are deferred to v2 (noted for a follow-up issue).
Test plan
go build ./...go test ./...(history→event parse/since/unparseable; argoSource via mock; ambiguous-endpoint error; merge newest-first across sources; candidate-cause skips events & picks newest change/sync; partial-failure tolerance; all-fail hard error; workload-required; RiskLow)golangci-lint v2.12 run ./...→ 0 issuesFollow-ups (non-blocking, from review): align pre-existing
ArgoHistoryEntryjson tagdeployed_at→deployedAt; extract the now-duplicatedmatchesWorkloadinto a shareddockerclienthelper; v2 metric/log/trace correlation.🤖 Generated with Claude Code