-
Notifications
You must be signed in to change notification settings - Fork 47
feat(logstream): Log streaming for argocd agent #569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
4d5e132
to
30aab14
Compare
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 2a08301)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit d07df62)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 161f2a4)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 30aab14)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit f8a6666)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit e820c35)
e820c35
to
3e1c2cd
Compare
Signed-off-by: Mangaal <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #569 +/- ##
==========================================
- Coverage 45.63% 45.56% -0.07%
==========================================
Files 90 92 +2
Lines 12020 12777 +757
==========================================
+ Hits 5485 5822 +337
- Misses 6090 6482 +392
- Partials 445 473 +28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@Mangaal I see this error intermittently on the UI. Works fine after requesting the logs again. I guess we are not handling
|
Signed-off-by: Mangaal <[email protected]>
@@ -0,0 +1,586 @@ | |||
package agent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the files are missing the Copyright
headers. Please include them.
agent/log.go
Outdated
} | ||
|
||
line, err := br.ReadString('\n') | ||
switch err { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't the argocd server process the logs before streaming to the UI? Just want to make sure the agent does not repeat the same work since it's only supposed to send back the responses from the k8s API. Can we directly send the chunks back and let the argocd server handle the raw logs? Then the agent doesn't have to go through the logs line by line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my first approach, I have tried sending raw log chunks back to the server since the argocd server handles them, but on the ui, they were displayed unprocessed. I will revisit.
"namespace": requestedNamespace, | ||
"pod": requestedName, | ||
"params": reqParams, | ||
"agent": agentName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add these fields above so that they are also available for the previous log statements?
// Unique identifier matching the original request/event UUID | ||
string request_uuid = 1; | ||
// Log data content. Recommended to be a single line including trailing newline | ||
string data = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use bytes as a data type instead of a string? Prevents the overhead of conversion at both the agent and the principal.
Signed-off-by: Mangaal <[email protected]>
Signed-off-by: Mangaal <[email protected]>
Signed-off-by: Mangaal <[email protected]>
@chetan-rns, Thanks for reviewing my PR. I’ve updated it and addressed your suggestions. Please take a look when you get a chance. |
This PR introduces a unidirectional(agent → principal) log streaming service and wires it into the resource-proxy path so the Principal can serve Kubernetes pod logs to the Argo CD UI. The Agent handles both static logs (follow=false) and live streaming (follow=true) with resume support.
What’s included:
Key feature:
Assisted-by: Cursor/Gemini etc
logs.mov