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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

load multiple debug-metadata.properties during runtime #3024

Merged
merged 9 commits into from
Dec 4, 2023

Conversation

lbloder
Copy link
Collaborator

@lbloder lbloder commented Nov 6, 2023

馃摐 Description

Load all debug-metadata.properties and apply to SentryOptions.
Only the first debug-metadata.properties is taken into consideration for adding the Proguard UUID

馃挕 Motivation and Context

Fixes #2994

馃挌 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

Copy link
Contributor

github-actions bot commented Nov 6, 2023

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

Generated by 馃毇 dangerJS against 12eb43a

Copy link
Contributor

github-actions bot commented Nov 6, 2023

Performance metrics 馃殌

Plain With Sentry Diff
Startup time 396.58 ms 485.60 ms 89.02 ms
Size 1.72 MiB 2.27 MiB 554.95 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
b172d4e 352.92 ms 446.50 ms 93.58 ms
0bd723b 375.20 ms 452.41 ms 77.20 ms
283d83e 416.81 ms 497.22 ms 80.41 ms
283d83e 348.44 ms 392.06 ms 43.62 ms
0bd723b 395.44 ms 472.66 ms 77.22 ms
4e29063 384.14 ms 447.74 ms 63.60 ms
93a76ca 391.54 ms 475.65 ms 84.11 ms
0bf143e 368.35 ms 437.47 ms 69.12 ms
4e29063 364.08 ms 445.51 ms 81.43 ms
4bf95dd 345.96 ms 414.24 ms 68.28 ms

App size

Revision Plain With Sentry Diff
b172d4e 1.72 MiB 2.29 MiB 578.09 KiB
0bd723b 1.72 MiB 2.29 MiB 578.09 KiB
283d83e 1.72 MiB 2.29 MiB 577.69 KiB
283d83e 1.72 MiB 2.29 MiB 577.69 KiB
0bd723b 1.72 MiB 2.29 MiB 578.09 KiB
4e29063 1.72 MiB 2.29 MiB 578.38 KiB
93a76ca 1.72 MiB 2.29 MiB 576.75 KiB
0bf143e 1.72 MiB 2.29 MiB 576.50 KiB
4e29063 1.72 MiB 2.29 MiB 578.38 KiB
4bf95dd 1.72 MiB 2.29 MiB 576.40 KiB

Previous results on branch: feat/multiple-debug-meta.properties

Startup times

Revision Plain With Sentry Diff
bb69afa 420.90 ms 486.08 ms 65.18 ms
b5d05a5 368.24 ms 445.90 ms 77.66 ms
b950cf5 422.09 ms 508.16 ms 86.06 ms
943fdf8 402.53 ms 480.56 ms 78.03 ms
b87b12a 379.98 ms 469.46 ms 89.48 ms

App size

Revision Plain With Sentry Diff
bb69afa 1.72 MiB 2.29 MiB 577.37 KiB
b5d05a5 1.72 MiB 2.27 MiB 555.00 KiB
b950cf5 1.72 MiB 2.29 MiB 577.37 KiB
943fdf8 1.72 MiB 2.29 MiB 577.52 KiB
b87b12a 1.72 MiB 2.29 MiB 577.37 KiB

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Files Coverage 螖
...core/internal/debugmeta/AssetsDebugMetaLoader.java 88.88% <100.00%> (酶)
sentry/src/main/java/io/sentry/Sentry.java 85.95% <100.00%> (酶)
...sentry/internal/debugmeta/NoOpDebugMetaLoader.java 66.66% <酶> (酶)
...y/internal/debugmeta/ResourcesDebugMetaLoader.java 90.00% <100.00%> (+20.43%) 猬嗭笍
...ava/io/sentry/util/DebugMetaPropertiesApplier.java 81.81% <80.00%> (+0.86%) 猬嗭笍
...karta/SentrySpringServletContainerInitializer.java 0.00% <0.00%> (酶)

馃摙 Thoughts on this report? Let us know!

Copy link
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

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

Left some remarks. Most important is stream handling and exception handling.

} catch (IOException e) {
logger.log(SentryLevel.ERROR, e, "Failed to load %s", DEBUG_META_PROPERTIES_FILENAME);
} catch (RuntimeException e) {
Copy link
Member

Choose a reason for hiding this comment

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

h Should we move this into the while so we keep loading the files that do work?

while (resourceUrls.hasMoreElements()) {
URL currenturl = resourceUrls.nextElement();
Properties currentProperties = new Properties();
currentProperties.load(currenturl.openStream());
Copy link
Member

Choose a reason for hiding this comment

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

h Stream should be closed, e.g. try(...) { ...

final @Nullable String proguardUuid =
debugMetaProperties.getProperty("io.sentry.ProguardUuids");
debugMetaProperties.get(0).getProperty("io.sentry.ProguardUuids");
Copy link
Member

Choose a reason for hiding this comment

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

m I presume this is fine as there should never be more than one debug-meta.properties on Android but I guess it'd be safer to iterate over the list until we find a proguard ID. Would still be first one wins but I guess that's OK, can always improve later.

@lbloder lbloder marked this pull request as ready for review November 7, 2023 15:39
Copy link
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

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

LGTM, just needs conflicts resolved

# Conflicts:
#	CHANGELOG.md
#	sentry/api/sentry.api
#	sentry/src/main/java/io/sentry/util/DebugMetaPropertiesApplier.java
@lbloder lbloder merged commit ee349f9 into main Dec 4, 2023
19 checks passed
@lbloder lbloder deleted the feat/multiple-debug-meta.properties branch December 4, 2023 09:02
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.

Sentry should support multiple debug-meta.properties
2 participants