-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Replace Hub
docs with Scopes
#12377
Replace Hub
docs with Scopes
#12377
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
Bundle ReportChanges will decrease total bundle size by 255.4kB (-1.26%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
The default SDK integrations will push and pop scopes intelligently. For | ||
instance web framework integrations will create and destroy scopes around your | ||
routes or controllers. | ||
```java |
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.
Should we also add Kotlin samples here?
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.
Yeah, let's do it in a follow up PR, I've created getsentry/sentry-java#4067 so we don't forget.
|
||
You can modify the isolation scope via `Sentry.configureScope(ScopeType.ISOLATION, isolationScope -> { ... })`, but usually you'll just use the `Sentry.setXXX` methods to set data on the currently active isolation scope: | ||
|
||
```java |
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.
Should we also add a Kotlin sample here?
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.
Yeah, let's do it in a follow up PR, I've created getsentry/sentry-java#4067 so we don't forget.
|
||
The current scope is the local scope that is currently active. Unlike the rarely-forked isolation scope, the current scope may be forked more frequently and under the hood. It can be used to store data that should only be applied to specific events. In most cases, you should not access this scope directly, but use `Sentry.withScope` to create a new scope that is only active for a specific part of your code: | ||
|
||
```java |
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.
Should we also add a Kotlin sample here?
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.
Yeah, let's do it in a follow up PR, I've created getsentry/sentry-java#4067 so we don't forget.
|
||
Note, there are exceptions to this, where values from all scopes are merged. This is the case for breadcrumbs, tags, extras, contexts, attachments and event processors. | ||
|
||
```java |
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.
Should we also add a Kotlin sample here?
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.
Yeah, let's do it in a follow up PR, I've created getsentry/sentry-java#4067 so we don't forget.
platform-includes/enriching-events/scopes/with-isolation-scope/java.mdx
Outdated
Show resolved
Hide resolved
@@ -91,6 +156,7 @@ caught, and all errors that occur will be silently ignored and **not** reported. | |||
|
|||
</Alert> | |||
|
|||
|
|||
## Kotlin Coroutines |
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.
Should Coroutines also be mentioned on the Android side?
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.
Not sure, can ask Android folks
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.
Created getsentry/sentry-java#4073
- [Isolation scope](#isolation-scope) | ||
- [Current scope](#current-scope) | ||
|
||
The Android SDK does not fork scopes on its own so you may set data on any of the scopes. The default the SDK writes to from its top level API is [current scope](#current-scope). |
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.
"The default the SDK writes to from its top level API is current scope"
Could this sentence be rephrased? I'm having trouble understanding the 'writes to from' phrase, and I'm also wondering if there's a subject missing here, should it be 'The default scope the SDK writes to'?
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, I replaced it with "The Android SDK writes to current scope by default when using top level.".
Please let me know if you would like to see any further changes on it.
platform-includes/enriching-events/scopes/with-isolation-scope/java.mdx
Outdated
Show resolved
Hide resolved
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 updates! Added some suggestions, overall looks good!
Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: Lukas Bloder <[email protected]>
Co-authored-by: Lukas Bloder <[email protected]>
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 👍
* Update Java SDK v8 deprecation removals (#11820) * Update Java SDK v8 deprecation removals * Update docs/platforms/android/configuration/options.mdx Co-authored-by: Lukas Bloder <[email protected]> --------- Co-authored-by: Lukas Bloder <[email protected]> * Add documentation on how to check-in to an environment with CheckInUtils (#11826) * Remove `enableTracing` option from Java SDK as it has been removed in v8 (#11575) * Update OpenTelemetry docs for Java v8 (#12209) * Update OTel docs for Java v8 * Apply suggestions from code review Co-authored-by: Alex Krawiec <[email protected]> --------- Co-authored-by: Alex Krawiec <[email protected]> * Document `forceInit` for Java SDK (#12260) * document forceInit option * Apply suggestions from code review Co-authored-by: Lukas Bloder <[email protected]> --------- Co-authored-by: Lukas Bloder <[email protected]> * Improve `bindToScope` docs for Java (#12263) * Improve bindToScope docs * Apply suggestions from code review Co-authored-by: Alex Krawiec <[email protected]> --------- Co-authored-by: Alex Krawiec <[email protected]> * Docs for `sentry-graphql-22` (#12259) * Duplicate docs for graphql-java v22 * link between graphql docs versions * Apply suggestions from code review Co-authored-by: Alex Krawiec <[email protected]> --------- Co-authored-by: Alex Krawiec <[email protected]> * Update platform docs for v8 and use OpenTelemetry (#12232) * Update OTel docs for Java v8 * Change platform docs for v8 and use OTel * move includes to index file * CR changes * [getsentry/action-github-commit] Auto commit * close ConfigKey tag * replace link * fix link * Update Android SDK "Using Sentry within an SDK" section for Java SDK v8 (#12325) * Update Using Sentry within an SDK for v8 * Update docs/platforms/android/configuration/shared-environments.mdx Co-authored-by: Lukas Bloder <[email protected]> --------- Co-authored-by: Lukas Bloder <[email protected]> * Add documentation on setting SpanKind and capture HttpHeaders with OTEL (#12328) * wip add docs for capturing http headers as well as manual instrumentation using opentelemetry * Update docs/platforms/java/common/tracing/instrumentation/opentelemetry.mdx Co-authored-by: Alexander Dinauer <[email protected]> --------- Co-authored-by: Alexander Dinauer <[email protected]> * Replace `Hub` docs with `Scopes` (#12377) * Replace hub docs with scopes docs * Apply suggestions from code review Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: Lukas Bloder <[email protected]> * Apply suggestions from code review Co-authored-by: Lukas Bloder <[email protected]> * Update docs/platforms/android/enriching-events/scopes/index.mdx * duplicate java into android * Update docs/platforms/android/enriching-events/scopes/index.mdx --------- Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: Lukas Bloder <[email protected]> --------- Co-authored-by: Lukas Bloder <[email protected]> Co-authored-by: Max Hovens <[email protected]> Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
* Update Java SDK v8 deprecation removals (#11820) * Update Java SDK v8 deprecation removals * Update docs/platforms/android/configuration/options.mdx Co-authored-by: Lukas Bloder <[email protected]> --------- Co-authored-by: Lukas Bloder <[email protected]> * Add documentation on how to check-in to an environment with CheckInUtils (#11826) * Remove `enableTracing` option from Java SDK as it has been removed in v8 (#11575) * Update OpenTelemetry docs for Java v8 (#12209) * Update OTel docs for Java v8 * Apply suggestions from code review Co-authored-by: Alex Krawiec <[email protected]> --------- Co-authored-by: Alex Krawiec <[email protected]> * Document `forceInit` for Java SDK (#12260) * document forceInit option * Apply suggestions from code review Co-authored-by: Lukas Bloder <[email protected]> --------- Co-authored-by: Lukas Bloder <[email protected]> * Improve `bindToScope` docs for Java (#12263) * Improve bindToScope docs * Apply suggestions from code review Co-authored-by: Alex Krawiec <[email protected]> --------- Co-authored-by: Alex Krawiec <[email protected]> * Docs for `sentry-graphql-22` (#12259) * Duplicate docs for graphql-java v22 * link between graphql docs versions * Apply suggestions from code review Co-authored-by: Alex Krawiec <[email protected]> --------- Co-authored-by: Alex Krawiec <[email protected]> * Update platform docs for v8 and use OpenTelemetry (#12232) * Update OTel docs for Java v8 * Change platform docs for v8 and use OTel * move includes to index file * CR changes * [getsentry/action-github-commit] Auto commit * close ConfigKey tag * replace link * fix link * Update Android SDK "Using Sentry within an SDK" section for Java SDK v8 (#12325) * Update Using Sentry within an SDK for v8 * Update docs/platforms/android/configuration/shared-environments.mdx Co-authored-by: Lukas Bloder <[email protected]> --------- Co-authored-by: Lukas Bloder <[email protected]> * Add documentation on setting SpanKind and capture HttpHeaders with OTEL (#12328) * wip add docs for capturing http headers as well as manual instrumentation using opentelemetry * Update docs/platforms/java/common/tracing/instrumentation/opentelemetry.mdx Co-authored-by: Alexander Dinauer <[email protected]> --------- Co-authored-by: Alexander Dinauer <[email protected]> * Replace `Hub` docs with `Scopes` (#12377) * Replace hub docs with scopes docs * Apply suggestions from code review Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: Lukas Bloder <[email protected]> * Apply suggestions from code review Co-authored-by: Lukas Bloder <[email protected]> * Update docs/platforms/android/enriching-events/scopes/index.mdx * duplicate java into android * Update docs/platforms/android/enriching-events/scopes/index.mdx --------- Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: Lukas Bloder <[email protected]> * Restore Hub docs as versioned docs for v7 and prior --------- Co-authored-by: Lukas Bloder <[email protected]> Co-authored-by: Max Hovens <[email protected]> Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Since
Hub
has been deprecated in v8, we're replacing/removing docs.This also documents the new scope types (global, isolation, current).
DESCRIBE YOUR PR
Tell us what you're changing and why. If your PR resolves an issue, please link it so it closes automatically.
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
LEGAL BOILERPLATE
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
EXTRA RESOURCES