Skip to main content

Configuration

Complete reference for all PulseSDK.INSTANCE.initialize(...) parameters. If you just need a quick working setup, see Installation.

note

The SDK ignores subsequent initialize() calls. Call it once, as early as possible in Application.onCreate().


Required

ParameterDescription
applicationYour Application instance
apiKeyProject API key
dataCollectionStateInitial 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

ValueBehavior
ALLOWEDTelemetry collected and exported immediately
PENDINGTelemetry buffered in memory; no data exported until state changes
DENIEDSDK 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:

InstrumentationGuide
Crash detectionCrashes
ANR detectionANR
Screen lifecycle (Activity + Fragment)Screen Lifecycle
Slow / frozen framesSlow Rendering
Interaction flowsInteractions
App StartupTime to draw first frame
Session ManagementSession ID Management
Network connectivity changesNetwork Change

Needs extra setup:

InstrumentationWhat's neededGuide
HTTP request trackingOkHttp dep + ByteBuddy Gradle pluginNetwork Monitoring
Session replayEnable from Pulse DashboardSession Replay
Click trackingEnable from Pulse DashboardClick Tracking
LocationACCESS_COARSE_LOCATION permissionLocation

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
note

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 instrumentationInstrumentation guides
Track business eventsCustom Events
Report handled errorsError Tracking
Measure operation durationsCustom Spans
Attach user identity to telemetryUser Identification
Add global metadata to all signalsGlobal Attributes
Gate collection behind consentData Collection Consent
Browse all public methodsAPI Reference
Upload Mapping FilesPulse Plugin
Enable SDK diagnostic loggingAdvanced Configuration