Skip to content
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

Improvements to logging in mdmproxy #20201

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Improvements to logging in mdmproxy #20201

wants to merge 1 commit into from

Conversation

zwass
Copy link
Member

@zwass zwass commented Jul 3, 2024

  • Add --debug flag to log Fleet requests and responses
  • Add --log-skipped flag to disable logging most garbage requests by default

- Add --debug flag to log Fleet requests and responses
- Add --log-skipped flag to disable logging most garbage requests by default
@zwass zwass requested a review from a team as a code owner July 3, 2024 16:57
Copy link
Member

@roperzh roperzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

strings.Contains(r.URL.Path, ".py") ||
strings.Contains(r.URL.Path, "wp-") ||
strings.Contains(r.URL.Path, "private") ||
(r.URL.Path == "/" && r.Method == http.MethodPost)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we find out this is not enough, we could also skip requests that don't contain Content-Type: application/x-apple-aspen-mdm-checkin or Content-Type: application/x-apple-aspen-mdm

}
r.Body = io.NopCloser(bytes.NewReader(b))

log.Println("Fleet response: ", string(b))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we print any extra information here? worried about the logs being harder to distinguish with multiple concurrent requests.

guessing this is just for staging testing with very few devices so not a concern, feel free to ignore if so

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.20%. Comparing base (fceff75) to head (8298d8d).
Report is 75 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20201      +/-   ##
==========================================
- Coverage   62.65%   55.20%   -7.45%     
==========================================
  Files        1405     1409       +4     
  Lines      131562   132012     +450     
  Branches     3216     3216              
==========================================
- Hits        82429    72878    -9551     
- Misses      42810    53198   +10388     
+ Partials     6323     5936     -387     
Flag Coverage Δ
backend 55.31% <ø> (-8.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants