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
endpointBaseUrlOTLP base URL for your Pulse backend
apiKeyProject API key
dataCollectionStateInitial consent state — ALLOWED, PENDING, or DENIED

Endpoints & Headers

ParameterDefaultDescription
endpointHeadersemptyMap()Extra HTTP headers on all outbound requests
configEndpointUrlAuto-derivedURL to fetch remote SDK config. Omit unless your backend serves config from a different host
customEventConnectivitySame as logsOverride delivery endpoint for custom events only

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.

sessionConfig

Customize session lifetime:

import io.opentelemetry.android.agent.session.SessionConfig
import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.hours

sessionConfig = SessionConfig(
backgroundInactivityTimeout = 15.minutes, // default
maxLifetime = 4.hours, // default
)
warning

Changing session defaults will affect what counts as a "session" across all dashboards, alerts, and analysis.

diskBuffering

Telemetry is buffered to disk when offline and flushed on reconnect. Enabled by default:

diskBuffering = {
enabled(true)
}

Instrumentations

On by default:

InstrumentationGuide
Crash detectionCrashes
ANR detectionANR
Screen lifecycle (Activity + Fragment)Screen Lifecycle
Slow / frozen framesSlow Rendering
Interaction flowsInteractions
App Startup-
Session 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.

The config URL is auto-derived from endpointBaseUrl. Only set configEndpointUrl explicitly if your backend serves config from a different host.

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

Shutdown

Permanently shuts down the SDK. Flushes and releases all OTel resources, uninstalls instrumentation. Cannot be re-initialized in the current process.

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