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

Document Java Source Context #7086

Merged
merged 32 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
20f1613
Document Java Source Context
adinauer Jun 5, 2023
3f93bdc
style(lint): Auto commit lint changes
getsantry[bot] Jun 5, 2023
0ac2058
style(lint): Auto commit lint changes
getsantry[bot] Jun 5, 2023
d1ab715
style(lint): Auto commit lint changes
getsantry[bot] Jun 5, 2023
29f4a42
style(lint): Auto commit lint changes
getsantry[bot] Jun 5, 2023
8f9c20c
style(lint): Auto commit lint changes
getsantry[bot] Jun 5, 2023
e63ed82
style(lint): Auto commit lint changes
getsantry[bot] Jun 5, 2023
5b87a3f
style(lint): Auto commit lint changes
getsantry[bot] Jun 5, 2023
7fb27f5
style(lint): Auto commit lint changes
getsantry[bot] Jun 5, 2023
1578a29
style(lint): Auto commit lint changes
getsantry[bot] Jun 5, 2023
01299b9
style(lint): Auto commit lint changes
getsantry[bot] Jun 5, 2023
28d7bc8
style(lint): Auto commit lint changes
getsantry[bot] Jun 5, 2023
f6d5622
Merge branch 'master' into feat/java-source-context
adinauer Jun 5, 2023
fb76e88
Replace link with absolute one
adinauer Jun 5, 2023
fe25d9e
Fix more links
adinauer Jun 5, 2023
b831b93
Replace project with projectName in gradle sentry config block
adinauer Jun 6, 2023
f02689f
Changes according to PR review
adinauer Jun 6, 2023
ef276b1
feat(Android): Integrate source context into Android Gradle overview …
markushi Jun 6, 2023
4bad977
Update src/wizard/android/index.md
adinauer Jun 6, 2023
a3ac5a2
Replace 3.8.1 of SAGP with 3.9.0
adinauer Jun 6, 2023
b4e9885
Update src/docs/product/cli/dif.mdx
adinauer Jun 7, 2023
2d954a3
Update src/docs/product/cli/dif.mdx
adinauer Jun 7, 2023
1a6b888
style(lint): Auto commit lint changes
getsantry[bot] Jun 7, 2023
f202c5c
style(lint): Auto commit lint changes
getsantry[bot] Jun 7, 2023
845c57d
Apply suggestions from code review
adinauer Jun 7, 2023
4abfc83
style(lint): Auto commit lint changes
getsantry[bot] Jun 7, 2023
bcea7ae
Apply suggestions from code review
adinauer Jun 7, 2023
893a78c
Code Review change
adinauer Jun 7, 2023
38eada1
Clarify includeSourceContext plugin option
markushi Jun 7, 2023
6645a44
Only show assemble task note for non android
adinauer Jun 7, 2023
e1d2bd9
Update src/platforms/java/common/gradle.mdx
adinauer Jun 7, 2023
2be1b8e
style(lint): Auto commit lint changes
getsantry[bot] Jun 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 60 additions & 11 deletions src/docs/product/cli/dif.mdx
Copy link
Member

Choose a reason for hiding this comment

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

I am wondering if this should live in one place in java docs and from product docs we could link there, or it could be an include that we add instead

again I think this could be in a restructuring PR to not delay this

Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ to look for them:
sentry-cli difutil find <identifier>
```

Additionally, `sentry-cli upload-dif` can automatically search for files in a
Additionally, `sentry-cli debug-files upload` can automatically search for files in a
folder or ZIP archive.

## Creating Source Bundles
Expand All @@ -62,7 +62,7 @@ containing all source files referenced by a specific debug information file.

This is particularly useful when building and uploading debug information files
are detached. In this case, a source bundle can be created when building and can
be uploaded at any later point in time with `sentry-cli upload-dif`.
be uploaded at any later point in time with `sentry-cli debug-files upload`.

To create a source bundle, use the `difutil bundle-sources` command on a list of
debug information files:
Expand All @@ -72,23 +72,23 @@ debug information files:
sentry-cli difutil bundle-sources /path/to/files...

# at any later time:
sentry-cli upload-dif --type sourcebundle /path/to/bundles...
sentry-cli debug-files upload --type sourcebundle /path/to/bundles...
```

To create multiple source bundles for all debug information files, use the
command on each file individually.

Alternatively, add the `--include-sources` option to the `upload-dif` command,
Alternatively, add the `--include-sources` option to the `debug-files upload` command,
which generates source bundles on the fly during the upload. This requires that
the upload is performed on the same machine as the application build:

```bash
sentry-cli upload-dif --include-sources /path/to/files...
sentry-cli debug-files upload --include-sources /path/to/files...
```

## Uploading Files

Use the `sentry-cli upload-dif` command to upload debug information files to
Use the `sentry-cli debug-files upload` command to upload debug information files to
Sentry. The command will recursively scan the provided folders or ZIP archives.
Files that have already been upload are skipped automatically.

Expand All @@ -108,7 +108,7 @@ to [Working with Projects](/product/cli/configuration/#sentry-cli-working-with-p
A basic debug file upload can be started with:

```bash
sentry-cli upload-dif -o <org> -p <project> /path/to/files...
sentry-cli debug-files upload -o <org> -p <project> /path/to/files...

> Found 2 debug information files
> Prepared debug information files for upload
Expand All @@ -126,7 +126,7 @@ specify `--wait` in the CLI, which will block until server-side analysis is
complete:

```bash
sentry-cli upload-dif -o <org> -p <project> --wait /path/to/files...
sentry-cli debug-files upload -o <org> -p <project> --wait /path/to/files...

> Found 2 debug information files
> Prepared debug information files for upload
Expand All @@ -143,7 +143,7 @@ There are a few options you can supply to the upload command:

`--wait`

: Wait for server-side processing of uploaded files. By default, `upload-dif`
: Wait for server-side processing of uploaded files. By default, `debug-files upload`
completes once the debug files have been uploaded to Sentry. After this,
Sentry analyzes the files and makes them available for symbolication. It makes
sense to specify `--wait` to ensure that debug files are ready before sending
Expand Down Expand Up @@ -223,7 +223,7 @@ many useful symbols. In that case, the sentry-cli upload will warn you that it
needs BCSymbolMaps:

```bash
sentry-cli upload-dif ...
sentry-cli debug-files upload ...
> Found 34 debug information files
> Warning: Found 10 symbol files with hidden symbols (need BCSymbolMaps)
```
Expand All @@ -233,7 +233,7 @@ are generated by the Xcode build process. Supply the `--symbol-maps` parameter
and point it to the folder containing the symbol maps:

```bash
sentry-cli upload-dif --symbol-maps path/to/symbolmaps path/to/debug/symbols
sentry-cli debug-files upload --symbol-maps path/to/symbolmaps path/to/debug/symbols
```

### Breakpad Files
Expand Down Expand Up @@ -311,3 +311,52 @@ UUIDs into a properties file.
`--require-one`

: Requires at least one file to upload or the command will error.

## JVM Source Bundles

If you're using a build tool we don't support, or you prefer not to use Sentry's build tool plugins, you'll need to upload source bundle files manually.

See the build tool plugins we currently support here:

- [Android](/platforms/android/source-context/)
- [Java](/platforms/java/source-context/)

You can also upload ProGuard files manually with `sentry-cli` for any JVM-based language like
Java or Kotlin.

<Note>

Before you can upload source files, you must configure the Sentry CLI with the organization and project you are uploading bundle files for. See the CLI docs on
[Working with Projects](/product/cli/configuration/#sentry-cli-working-with-projects) to learn how to do this.

</Note>

### Creating a Source Bundle

Run the `debug-files bundle-jvm` command to create a source bundle for a
source directory.

```bash
sentry-cli debug-files bundle-jvm \
--output some/dir \
--debug-id A_VALID_UUID \
path/to/source/dir
```

You must provide the UUID of the source bundle for the Java/Android SDK to send.
More details can be found in the [Source Context](/platforms/java/source-context/#manually-uploading-source-context) docs for Java and the [Source Context](/platforms/android/source-context/#manually-uploading-source-context) docs for Android.

### Uploading a Source Bundle

The `debug-files upload` command allows you to upload the source
bundle you created to Sentry.

```bash
sentry-cli debug-files upload \
--type jvm \
output/path/of/bundle-jvm/command
```

After the upload, Sentry will attach Source Context to future events.

To make sure these steps worked, check **Project Settings > Debug Files** in Sentry.io to see if the uploaded source bundle files are listed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading