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

Add an option for opting out of pretty print #2871

Merged
merged 5 commits into from
Aug 17, 2023

Conversation

adinauer
Copy link
Member

📜 Description

A new option to disable pretty printing of events in the debug log.

💡 Motivation and Context

In backend applications there's often many errors and transactions as well as other logs making it hard to look at / copy an event. With pretty print disabled an event takes up only a single line and can more easily be copy pasted to another tool for formatting where output doesn't get rotated out etc.

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Jul 28, 2023

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 263df12

@github-actions
Copy link
Contributor

github-actions bot commented Jul 28, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 328.11 ms 371.64 ms 43.53 ms
Size 1.72 MiB 2.29 MiB 575.91 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
c03a05e 390.40 ms 419.35 ms 28.94 ms
4c237f8 319.84 ms 354.47 ms 34.63 ms
8820c5c 330.60 ms 416.86 ms 86.26 ms
0310da5 381.20 ms 404.50 ms 23.30 ms
496bdfd 301.22 ms 343.96 ms 42.73 ms
caf50ec 302.36 ms 325.25 ms 22.89 ms
9246ed4 281.79 ms 352.08 ms 70.29 ms
fe10f05 294.30 ms 346.84 ms 52.54 ms
adf8fe3 300.49 ms 357.36 ms 56.87 ms
fe10f05 314.71 ms 360.62 ms 45.90 ms

App size

Revision Plain With Sentry Diff
c03a05e 1.72 MiB 2.29 MiB 574.43 KiB
4c237f8 1.72 MiB 2.29 MiB 575.58 KiB
8820c5c 1.72 MiB 2.28 MiB 571.82 KiB
0310da5 1.72 MiB 2.28 MiB 573.45 KiB
496bdfd 1.72 MiB 2.28 MiB 571.82 KiB
caf50ec 1.72 MiB 2.29 MiB 575.24 KiB
9246ed4 1.72 MiB 2.28 MiB 572.22 KiB
fe10f05 1.72 MiB 2.29 MiB 575.54 KiB
adf8fe3 1.72 MiB 2.29 MiB 575.24 KiB
fe10f05 1.72 MiB 2.29 MiB 575.54 KiB

Previous results on branch: feat/opt-out-of-pretty-print

Startup times

Revision Plain With Sentry Diff
077e4e9 294.19 ms 345.30 ms 51.11 ms
462f8f7 341.45 ms 384.18 ms 42.73 ms

App size

Revision Plain With Sentry Diff
077e4e9 1.72 MiB 2.29 MiB 575.91 KiB
462f8f7 1.72 MiB 2.29 MiB 575.63 KiB

@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (3f6f636) 79.61% compared to head (263df12) 79.62%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #2871   +/-   ##
=========================================
  Coverage     79.61%   79.62%           
- Complexity     6038     6043    +5     
=========================================
  Files           469      469           
  Lines         23307    23318   +11     
  Branches       3177     3178    +1     
=========================================
+ Hits          18555    18566   +11     
  Misses         3355     3355           
  Partials       1397     1397           
Files Changed Coverage Δ
...entry/src/main/java/io/sentry/ExternalOptions.java 98.11% <100.00%> (+0.06%) ⬆️
sentry/src/main/java/io/sentry/JsonSerializer.java 90.67% <100.00%> (ø)
sentry/src/main/java/io/sentry/SentryOptions.java 80.43% <100.00%> (+0.23%) ⬆️

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

@adinauer
Copy link
Member Author

adinauer commented Aug 2, 2023

@romtsn @markushi @stefanosiano what do you think about the naming? I'd like to decide on a name before going ahead and implementing other forms of configuration for this new property.

@markushi
Copy link
Member

markushi commented Aug 8, 2023

@romtsn @markushi @stefanosiano what do you think about the naming? I'd like to decide on a name before going ahead and implementing other forms of configuration for this new property.

prettyPrintSerializationOutput sounds good to me, IMHO enablePrettySerializationOutput could work well too.

@adinauer
Copy link
Member Author

adinauer commented Aug 9, 2023

Renamed it to enablePrettySerializationOutput and added it to ExternalOptions. Didn't add it to Android Manifest options, as I've never heard any Android user request this. Let me know if I should add it.

@adinauer adinauer marked this pull request as ready for review August 9, 2023 10:36
Copy link
Member

@markushi markushi left a comment

Choose a reason for hiding this comment

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

LGTM!

@adinauer adinauer merged commit 9e60fc1 into main Aug 17, 2023
20 checks passed
@adinauer adinauer deleted the feat/opt-out-of-pretty-print branch August 17, 2023 14:35
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.

2 participants