-
Notifications
You must be signed in to change notification settings - Fork 346
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
Support timestamp filter in antctl supportbundle command #2389
Support timestamp filter in antctl supportbundle command #2389
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2389 +/- ##
==========================================
+ Coverage 60.57% 65.31% +4.74%
==========================================
Files 286 286
Lines 23053 26506 +3453
==========================================
+ Hits 13964 17312 +3348
+ Misses 7624 7598 -26
- Partials 1465 1596 +131
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
LGTM, a minor comment
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.
LGTM
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.
Sorry for the late review.
Have you given any thought to using an arbitrary time stamp instead?
BTW, some commits are not signed.
3689b11
to
3c6022e
Compare
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.
Sorry for the late review.
Have you given any thought to using an arbitrary time stamp instead?BTW, some commits are not signed.
I have seen usages of timestamp in log filters and can perhaps perform more advanced queries like last 5 hours or between certain timestamps.
99380f2
to
4ee6f22
Compare
Use timestamp certainly is better, only require some extra work(reading logs file and extract the required parts). |
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.
1 comment otherwise lgtm, but perhaps others may want to chime in on whether to support timestamps or days is fine as a filter
60a358e
to
74b4ab6
Compare
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.
Thanks for the change!
pkg/support/dump.go
Outdated
@@ -184,6 +256,8 @@ type agentDumper struct { | |||
ovsCtlClient ovsctl.OVSCtlClient | |||
aq agentquerier.AgentQuerier | |||
npq querier.AgentNetworkPolicyInfoQuerier | |||
// days is for log filter |
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.
wrong comment
return err | ||
} | ||
return fileCopy(d.fs, path.Join(basedir, "logs", "ovs"), logDir, "ovs") | ||
return directoryCopy(d.fs, path.Join(basedir, "logs", "ovs"), logDir, "ovs", timeFilter) |
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.
I just thought of ovs log has different time format:
2020-11-24T10:00:56.837Z|00036|memory|INFO|415440 kB peak resident set size after 10.0 seconds
2020-11-24T10:00:56.837Z|00037|memory|INFO|handlers:35 ofconns:1 ports:2 revalidators:13 rules:37 udpif keys:1
2020-11-24T10:01:00.680Z|00038|connmgr|INFO|br-int<->unix#0: 34 flow_mods 10 s ago (33 adds, 1 deletes)
So the timeFilter won't work
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.
I have checked the code again. This was by design, alougth i'm not sure it's a good choice. The timefilter is based on the timestamp records in the log filename, which was generated by klog. If no timestamp found in the filename, the whole log file is returned, and it applied to the ovs logs. I assumed it's much smaller than the agent/controller log and does not need to do timestamp filter.
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.
A bad assumption i guess.
@@ -0,0 +1,21 @@ | |||
package support |
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.
Add license header
return err | ||
} | ||
// Dump kubelet logs. | ||
if err := fileCopy(d.fs, path.Join(basedir, "logs", "kubelet"), antreaWindowsKubeletLogDir, "kubelet"); err != nil { | ||
if err := directoryCopy(d.fs, path.Join(basedir, "logs", "kubelet"), antreaWindowsKubeletLogDir, "kubelet", timeFilter); err != nil { |
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.
Does kubelet have same time format?
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.
kubelet has the same format.
@tnqn All updated, please take a look if you got time. |
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.
LGTM, thanks
Thanks for the review |
/test-all |
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.
LGTM
This PR is based on antrea-io#1560, besides conflict fixes, the additional changes are: 1. change days filter to timestamp filter 2. revert the interface changes and use struct fields Co-authored-by: Weiqiang Tang <weiqiangt@vmware.com> Signed-off-by: Hang Yan <yhang@vmware.com>
5972d51
to
0ced809
Compare
merge conflict are fixed |
/test-all |
This PR is based on #1560, besides conflict fixes, the additional changes are: 1. change days filter to timestamp filter 2. revert the interface changes and use struct fields Co-authored-by: Weiqiang Tang <weiqiangt@vmware.com> Signed-off-by: Hang Yan <yhang@vmware.com>
This PR is based on #1560, besides conflict fixes, the additional
changes are:
Co-authored-by: Weiqiang Tang weiqiangt@vmware.com
Signed-off-by: Hang Yan yhang@vmware.com