Skip to content

Commit 4b44f91

Browse files
romtsnclaude
andcommitted
docs(java, android): Add Spotlight integration docs
Add documentation for the new `sentry-spotlight` module extracted in sentry-java#5064 (available from 8.32.0). Covers install, configure, and verify sections for both Android and Java platforms. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4414cd7 commit 4b44f91

2 files changed

Lines changed: 163 additions & 0 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: Spotlight
3+
description: "Learn how to use Sentry Spotlight for local development observability on Android."
4+
---
5+
6+
[Sentry Spotlight](https://spotlightjs.com/) is a local development tool that provides real-time observability for errors, traces, logs, and performance data during development. It allows you to see Sentry events in real-time without sending them to Sentry's servers, making it ideal for local debugging.
7+
8+
The `sentry-spotlight` module provides a `SpotlightIntegration` that sends a copy of all Sentry events to your local Spotlight instance. By using `debugImplementation`, you can ensure Spotlight is excluded from release builds, preventing insecure HTTP URLs from leaking into production APKs.
9+
10+
## Install
11+
12+
We recommend using `debugImplementation` so the Spotlight dependency is excluded from release builds:
13+
14+
```groovy {filename:app/build.gradle}
15+
debugImplementation 'io.sentry:sentry-spotlight:{{@inject packages.version('sentry.java.spotlight', '8.32.0') }}'
16+
```
17+
18+
```kotlin {filename:app/build.gradle.kts}
19+
debugImplementation("io.sentry:sentry-spotlight:{{@inject packages.version('sentry.java.spotlight', '8.32.0') }}")
20+
```
21+
22+
If you need Spotlight in all build types, use `implementation` instead of `debugImplementation`.
23+
24+
## Configure
25+
26+
```xml {tabTitle:XML}
27+
<application>
28+
<!-- Enable Spotlight -->
29+
<meta-data android:name="io.sentry.spotlight.enable" android:value="true" />
30+
<!-- Optional: override the default Spotlight URL -->
31+
<meta-data android:name="io.sentry.spotlight.url" android:value="http://10.0.2.2:8969/stream" />
32+
</application>
33+
```
34+
35+
```java {tabTitle:Java}
36+
import io.sentry.android.core.SentryAndroid;
37+
38+
SentryAndroid.init(this, options -> {
39+
options.setDsn("___PUBLIC_DSN___");
40+
options.setEnableSpotlight(true);
41+
// Optional: override the default Spotlight URL
42+
options.setSpotlightConnectionUrl("http://10.0.2.2:8969/stream");
43+
});
44+
```
45+
46+
```kotlin {tabTitle:Kotlin}
47+
import io.sentry.android.core.SentryAndroid
48+
49+
SentryAndroid.init(this) { options ->
50+
options.dsn = "___PUBLIC_DSN___"
51+
options.isEnableSpotlight = true
52+
// Optional: override the default Spotlight URL
53+
options.spotlightConnectionUrl = "http://10.0.2.2:8969/stream"
54+
}
55+
```
56+
57+
<Alert level="info">
58+
59+
The default Spotlight URL is `http://10.0.2.2:8969/stream`. The `10.0.2.2` address is the Android emulator's bridge to the host machine's `localhost`. If you're running on a physical device, replace this with your machine's local IP address.
60+
61+
</Alert>
62+
63+
## Verify
64+
65+
To verify the integration is working, capture a test exception and check the Spotlight UI:
66+
67+
```java
68+
import io.sentry.Sentry;
69+
70+
Sentry.captureException(new Exception("Spotlight test from Android!"));
71+
```
72+
73+
```kotlin
74+
import io.sentry.Sentry
75+
76+
Sentry.captureException(Exception("Spotlight test from Android!"))
77+
```
78+
79+
Open the Spotlight UI and confirm that the error event appears.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: Spotlight
3+
description: "Learn how to use Sentry Spotlight for local development observability in your Java app."
4+
---
5+
6+
[Sentry Spotlight](https://spotlightjs.com/) is a local development tool that provides real-time observability for errors, traces, logs, and performance data during development. It allows you to see Sentry events in real-time without sending them to Sentry's servers, making it ideal for local debugging.
7+
8+
The `sentry-spotlight` module provides a `SpotlightIntegration` that sends a copy of all Sentry events to your local Spotlight instance.
9+
10+
## Install
11+
12+
To install use:
13+
14+
```groovy {tabTitle:Gradle}
15+
implementation 'io.sentry:sentry-spotlight:{{@inject packages.version('sentry.java.spotlight', '8.32.0') }}'
16+
```
17+
18+
```xml {tabTitle:Maven}
19+
<dependency>
20+
<groupId>io.sentry</groupId>
21+
<artifactId>sentry-spotlight</artifactId>
22+
<version>{{@inject packages.version('sentry.java.spotlight', '8.32.0') }}</version>
23+
</dependency>
24+
```
25+
26+
```scala {tabTitle: SBT}
27+
libraryDependencies += "io.sentry" % "sentry-spotlight" % "{{@inject packages.version('sentry.java.spotlight', '8.32.0') }}"
28+
```
29+
30+
For other dependency managers, check out the [central Maven repository](https://search.maven.org/artifact/io.sentry/sentry-spotlight).
31+
32+
## Configure
33+
34+
```text {tabTitle:application.properties} {filename:application.properties}
35+
sentry.enable-spotlight=true
36+
# Optional: override the default Spotlight URL (defaults to http://localhost:8969/stream)
37+
sentry.spotlight-connection-url=http://localhost:8969/stream
38+
```
39+
40+
```java {tabTitle:Java}
41+
import io.sentry.Sentry;
42+
43+
Sentry.init(options -> {
44+
options.setDsn("___PUBLIC_DSN___");
45+
options.setEnableSpotlight(true);
46+
// Optional: override the default Spotlight URL (defaults to http://localhost:8969/stream)
47+
options.setSpotlightConnectionUrl("http://localhost:8969/stream");
48+
});
49+
```
50+
51+
```kotlin {tabTitle:Kotlin}
52+
import io.sentry.Sentry
53+
54+
Sentry.init { options ->
55+
options.dsn = "___PUBLIC_DSN___"
56+
options.isEnableSpotlight = true
57+
// Optional: override the default Spotlight URL (defaults to http://localhost:8969/stream)
58+
options.spotlightConnectionUrl = "http://localhost:8969/stream"
59+
}
60+
```
61+
62+
<Alert level="info">
63+
64+
The default Spotlight URL is `http://localhost:8969/stream`. You only need to set `spotlightConnectionUrl` if your Spotlight instance is running on a different host or port.
65+
66+
</Alert>
67+
68+
## Verify
69+
70+
To verify the integration is working, capture a test exception and check the Spotlight UI:
71+
72+
```java
73+
import io.sentry.Sentry;
74+
75+
Sentry.captureException(new Exception("Spotlight test from Java!"));
76+
```
77+
78+
```kotlin
79+
import io.sentry.Sentry
80+
81+
Sentry.captureException(Exception("Spotlight test from Java!"))
82+
```
83+
84+
Open the Spotlight UI and confirm that the error event appears.

0 commit comments

Comments
 (0)