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

Hubs/Scopes Merge 23 - Use new API for CRONS integrations #3347

Merged
merged 29 commits into from
Apr 22, 2024

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Apr 12, 2024

#skip-changelog

📜 Description

💡 Motivation and Context

💚 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 Apr 12, 2024

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

Generated by 🚫 dangerJS against 1c5eab3

@@ -49,13 +52,14 @@ public void jobToBeExecuted(final @NotNull JobExecutionContext context) {
if (maybeSlug == null) {
return;
}
scopes.pushScope();
final @NotNull ISentryLifecycleToken lifecycleToken = scopes.pushIsolationScope();
Copy link
Member Author

Choose a reason for hiding this comment

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

For this it likely makes sense to have it isolated.

@@ -86,7 +87,7 @@ public Object invoke(final @NotNull MethodInvocation invocation) throws Throwabl
return invocation.proceed();
}

scopes.pushScope();
final @NotNull ISentryLifecycleToken lifecycleToken = scopes.pushIsolationScope();
Copy link
Member Author

@adinauer adinauer Apr 12, 2024

Choose a reason for hiding this comment

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

Not 100% sure here, maybe we should make it configurable whether this isolates or not (pushScope vs. pushIsolationScope). The @SentryCheckIn annotation may be used on jobs but can also be used on any method where it may not make sense to isolate but rather keep e.g. the request scope.

Copy link
Member Author

Choose a reason for hiding this comment

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

Default should probably be isolated.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah makes sense!
If any user code within invocation.proceed(); performs changes via the static API, e.g. Sentry.setTag(), those will be written to the isolation scope which is created here, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, static API and configureScope default to isolation scope for non Android.

Copy link
Member Author

Choose a reason for hiding this comment

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

The more I think about API, the more I think we should just find a sane default and only deliver that as a starting point. We can always add more API if users actually ask for it.

@@ -30,12 +31,11 @@ public static <U> U withCheckIn(
final @Nullable MonitorConfig monitorConfig,
final @NotNull Callable<U> callable)
throws Exception {
final @NotNull ISentryLifecycleToken lifecycleToken = Sentry.pushIsolationScope();
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe this should also be configurable to use pushScope or pushIsolationScope.

Copy link
Member Author

Choose a reason for hiding this comment

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

Default should probably also be isolated. Add overload with isolated: true/false, defaulting to true

Copy link
Contributor

github-actions bot commented Apr 12, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 299.32 ms 398.02 ms 98.70 ms
Size 1.70 MiB 2.28 MiB 595.91 KiB

Previous results on branch: feat/hsm-23-cron-integrations

Startup times

Revision Plain With Sentry Diff
be0e19c 386.12 ms 455.02 ms 68.90 ms
1f86db1 441.51 ms 517.69 ms 76.18 ms

App size

Revision Plain With Sentry Diff
be0e19c 1.70 MiB 2.28 MiB 595.91 KiB
1f86db1 1.70 MiB 2.28 MiB 595.91 KiB

Base automatically changed from feat/hsm-22-combine-scopes to 8.x.x April 22, 2024 12:47
@adinauer adinauer merged commit 28144c6 into 8.x.x Apr 22, 2024
5 of 19 checks passed
@adinauer adinauer deleted the feat/hsm-23-cron-integrations branch April 22, 2024 13:13
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.

3 participants