Spotlight

Learn how to use Sentry Spotlight for local development observability in your Java app.

Sentry Spotlight 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.

The sentry-spotlight module provides a SpotlightIntegration that sends a copy of all Sentry events to your local Spotlight instance.

To install use:

Copied
implementation 'io.sentry:sentry-spotlight:8.34.1'

For other dependency managers, check out the central Maven repository.

sentry.properties
Copied
enable-spotlight=true
# Optional: override the default Spotlight URL (defaults to http://localhost:8969/stream)
spotlight-connection-url=http://localhost:8969/stream
Copied
import io.sentry.Sentry;

Sentry.init(options -> {
    options.setDsn("___PUBLIC_DSN___");
    options.setEnableSpotlight(true);
    // Optional: override the default Spotlight URL (defaults to http://localhost:8969/stream)
    options.setSpotlightConnectionUrl("http://localhost:8969/stream");
});

To verify the integration is working, capture a test exception and check the Spotlight UI:

Copied
import io.sentry.Sentry;

Sentry.captureException(new Exception("Spotlight test from Java!"));

Open the Spotlight UI and confirm that the error event appears.

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").