This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
PMM-5680 store agents logs #197
Open
qwest812
wants to merge
15
commits into
main
Choose a base branch
from
PMM-5680-store-logs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
3bc9d37
PMM-5680 store agents logs
qwest812 2db5722
Merge branch 'main' into PMM-5680-store-logs
qwest812 e1df266
PMM-5680 store agents logs
qwest812 1fc2698
PMM-5680 update dependency
qwest812 df0f287
PMM-5680 update dependency
qwest812 65cb23f
Merge branch 'main' into PMM-5680-store-logs
qwest812 1a9381c
PMM-5680 create zip file with pmm-agent logs
qwest812 4a86454
Merge branch 'main' into PMM-5680-store-logs
qwest812 ed34aaf
PMM-5680 pretty
qwest812 1e5e1ab
PMM-5680 remove TODO
qwest812 3d9236e
PMM-5680 save logs to file zip
qwest812 253991c
PMM-5680 pretty
qwest812 3b5020a
change request
qwest812 e23d761
fix bug
qwest812 f69bd1e
Merge branch 'main' into PMM-5680-store-logs
qwest812 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,11 +121,20 @@ func addClientData(ctx context.Context, zipW *zip.Writer) { | |
logrus.Errorf("%s", err) | ||
return | ||
} | ||
now := time.Now() | ||
for _, agent := range status.AgentsInfo { | ||
b, err := json.MarshalIndent(agent.Logs, "", " ") | ||
if err != nil { | ||
logrus.Debugf("%s", err) | ||
b = []byte(err.Error()) | ||
} | ||
b = append(b, '\n') | ||
addData(zipW, "logs/"+pointer.GetString(agent.AgentType)+".json", now, bytes.NewReader(b)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is the reason to make it json?
|
||
agent.Logs = nil | ||
} | ||
|
||
addVMAgentTargets(ctx, zipW, status.AgentsInfo) | ||
|
||
now := time.Now() | ||
|
||
b, err := json.MarshalIndent(status, "", " ") | ||
if err != nil { | ||
logrus.Debugf("%s", err) | ||
|
This file contains 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
Oops, something went wrong.
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.
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.
🚫 [golangci-lint] reported by reviewdog 🐶
append only allowed to cuddle with appended value (wsl)