Configuration
Complete reference for all PulseSDK.INSTANCE.initialize(...) parameters. If you just need a quick working setup, see Installation.
The SDK ignores subsequent initialize() calls. Call it once, as early as possible in Application.onCreate().
Required
| Parameter | Description |
|---|---|
application | Your Application instance |
apiKey | Project API key |
dataCollectionState | Initial consent state — ALLOWED, PENDING, or DENIED |
Telemetry Enrichment
globalAttributes
Key/value pairs attached to every span and log. Uses the OpenTelemetry Attributes API:
globalAttributes = {
Attributes.builder()
.put("deployment.environment", if (BuildConfig.DEBUG) "development" else "production")
.put("app.version.name", BuildConfig.VERSION_NAME)
.build()
}
See Global Attributes for the full list of what the SDK auto-attaches alongside your values.
SDK Behavior
dataCollectionState
| Value | Behavior |
|---|---|
ALLOWED | Telemetry collected and exported immediately |
PENDING | Telemetry buffered in memory; no data exported until state changes |
DENIED | SDK stops collecting; terminal for the current process |
PulseSDK.INSTANCE.initialize(
...,
dataCollectionState = PulseDataCollectionConsent.PENDING, // wait for user consent
)
Use PENDING to gate collection behind a consent prompt. See Data Collection Consent.
Instrumentations
instrumentations — the trailing initialize { } block that toggles and configures each built-in telemetry collector (crashes, screens, interactions, and so on).
On by default:
| Instrumentation | Guide |
|---|---|
| Crash detection | Crashes |
| ANR detection | ANR |
| Screen lifecycle (Activity + Fragment) | Screen Lifecycle |
| Slow / frozen frames | Slow Rendering |
| Interaction flows | Interactions |
| App Startup | Time to draw first frame |
| Session Management | Session ID Management |
| Network connectivity changes | Network Change |
Needs extra setup:
| Instrumentation | What's needed | Guide |
|---|---|---|
| HTTP request tracking | OkHttp dep + ByteBuddy Gradle plugin | Network Monitoring |
| Session replay | Enable from Pulse Dashboard | Session Replay |
| Click tracking | Enable from Pulse Dashboard | Click Tracking |
| Location | ACCESS_COARSE_LOCATION permission | Location |
Use the instrumentations block to disable or configure any default instrumentation:
PulseSDK.INSTANCE.initialize(
...,
) {
crashReporter { enabled(false) }
fragment { enabled(false) } // useful for React Native apps
}
Remote Config
The SDK fetches a server-side config from your Pulse backend on every launch — in the background, non-blocking. The fetched config is persisted on device and applied on the next launch, so mid-session behavior stays consistent.
Everything below can be changed from the Pulse dashboard without shipping an app update:
- Enable or disable instrumentations — crash reporting, network, session replay, click tracking, or interactions.
- Sampling rate — collect telemetry from a percentage of all sessions globally
- Rule-based sampling — override rates for specific OS versions, app versions, or countries
- Drop or add attributes — remove noisy attributes or inject static values without touching app code
First launch: initialize() defaults apply (including instrumentations). After that: config saved from a previous launch is used on the next launch. Settings → SDK Configuration shows which instrumentations and features are on.
Shutdown
Permanently shuts down the SDK. Flushes and releases all OTel resources, uninstalls instrumentation. Cannot be re-initialized in the current process.
Call shutdown() to stop Pulse entirely for this process (tests, debugging, hard off).
PulseSDK.INSTANCE.shutdown()
Next Steps
| I want to… | Go to |
|---|---|
| Configure a specific instrumentation | Instrumentation guides |
| Track business events | Custom Events |
| Report handled errors | Error Tracking |
| Measure operation durations | Custom Spans |
| Attach user identity to telemetry | User Identification |
| Add global metadata to all signals | Global Attributes |
| Gate collection behind consent | Data Collection Consent |
| Browse all public methods | API Reference |
| Upload Mapping Files | Pulse Plugin |
| Enable SDK diagnostic logging | Advanced Configuration |