Skip to content

Performance docs for Android#2851

Merged
bruno-garcia merged 10 commits intomasterfrom
feat/android-performance
Jan 14, 2021
Merged

Performance docs for Android#2851
bruno-garcia merged 10 commits intomasterfrom
feat/android-performance

Conversation

@marandaneto
Copy link
Contributor

@marandaneto marandaneto commented Jan 8, 2021

Add Performance docs for Android
Also fixes #2849

@vercel
Copy link

vercel bot commented Jan 8, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sentry/sentry-docs/c9jhzib2k/sentry.dev
✅ Preview: https://sentry-docs-git-feat-android-performance.sentry.dev

</application>
```

Or, if you are manually instrumenting Sentry:
Copy link
Member

Choose a reason for hiding this comment

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

Opting in to tracing with the sampling decision isn't really related to manual vs auto instrumentation (we can start capturing transactions automatically if we are able to if the users set a sampling decision in):

Suggested change
Or, if you are manually instrumenting Sentry:
Or, if you are initializing the SDK programatically:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was the wording defined by the docs team about "auto init mode" vs "initializing the SDK by yourself".
I'd stick to it or we'd need to change everywhere, otherwise, only this page would differ.

it's not really related to tracing, but if you have the auto init mode or not

Copy link
Member

Choose a reason for hiding this comment

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

@PeloWriter maybe has an opinion here


Or, if you are manually instrumenting Sentry:

```java {tabTitle:Java}
Copy link
Member

Choose a reason for hiding this comment

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

What about having Kotlin first?

Maybe better as a single PR across all of docs, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd say so, also would need checking if docs somehow would order alphabetically or not

</application>
```

Or, if you are manually instrumenting Sentry:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Or, if you are manually instrumenting Sentry:
Or, if you are initializing the SDK programatically:


SentryAndroid.init(this,
options -> {
...
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is in all the performance Java/Kotlin examples, if we decide to remove it, I'd do a single PR.

@marandaneto marandaneto marked this pull request as ready for review January 13, 2021 10:14
@marandaneto marandaneto requested review from a team as code owners January 13, 2021 10:14
@marandaneto
Copy link
Contributor Author

@maciejwalkowiak I've changed a few scripts to be compatible with the new code like using interfaces instead of the implementation class, also nullability checks, added imports, and returning Doubles instead of Ints otherwise it'd never compile.
Please check, thanks

Copy link
Contributor

@maciejwalkowiak maciejwalkowiak left a comment

Choose a reason for hiding this comment

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

Looks good to me.


The next example contains the implementation of the hypothetical `processItem` function called from the code snippet in the previous section. Our SDK can determine if there is currently an open transaction and add all newly created spans as child operations to that transaction. Keep in mind that each individual span also needs to be manually finished; otherwise, spans will not show up in the transaction.

In cases where you want to attach Spans to an already ongoing Transaction you can use `Sentry#getSpan`. This method will return a `SentryTransaction` in case there is a running Transaction or a `Span` in case there is already a running Span, otherwise it returns `null`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@maciejwalkowiak should we still keep SentryTransaction and Span or just ISpan?


### Retrieving a Transaction

In cases where you want to attach Spans to an already ongoing Transaction you can use `Sentry#getSpan`. This method will return a `SentryTransaction` in case there is a running Transaction or a `Span` in case there is already a running Span, otherwise it returns `null`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

🚀

@bruno-garcia bruno-garcia merged commit d69f28e into master Jan 14, 2021
@bruno-garcia bruno-garcia deleted the feat/android-performance branch January 14, 2021 19:14
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Java/Kotlin imports

4 participants