Skip to main content

Advanced Configuration

Customize SDK behavior with advanced configuration options.

Global Attributes

Set attributes that will be included in all telemetry. See Global Attributes for detailed documentation.

Disk Buffering

Configure offline storage for telemetry:

PulseSDK.INSTANCE.initialize(
application = this,
projectId = "your-project-id",
diskBuffering = {
enabled(true)
}
)

Instrumentation Configuration

Enable or disable specific instrumentations:

PulseSDK.INSTANCE.initialize(
application = this,
projectId = "your-project-id",
) {
// User interactions
interaction {
enabled(true)
}

// Activity lifecycle
activity {
enabled(true)
}

// Fragment lifecycle
fragment {
enabled(false) // Disable if not using fragments
}

// Network monitoring
networkMonitoring {
enabled(true)
}

// ANR detection
anrReporter {
enabled(true)
}

// Slow/frozen render detection
slowRenderingReporter {
enabled(true)
}
}

Session Configuration

Customize session behavior:

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

PulseSDK.INSTANCE.initialize(
application = this,
projectId = "your-project-id",
sessionConfig = SessionConfig(
backgroundInactivityTimeout = 15.minutes,
maxLifetime = 4.hours,
shouldPersist = false
)
)

Important Notes

StrictMode

SDK initialization may trigger Android StrictMode violations for disk or network I/O on the main thread. These are expected during startup and resolve after initialization completes. If you run with StrictMode policies enabled in debug builds, you can safely allowlist the Pulse initialization call.

Exporter Chain

The SDK performs asynchronous exporter initialization with in-memory buffering and optional disk buffering. Telemetry is queued in memory until the exporter is ready, so no data is lost during startup.

Next Steps

  • Review the instrumentation guides for recommended patterns
  • Check Troubleshooting if you encounter issues