-
public class KubesenseRemoteConfigDashboard-managed remote SDK configuration: fetch, cache, and load.
The lifecycle is fetch → cache → apply at next launch:
load reads the small document cached by a previous launch (a ~1ms disk read, never any network) so an app can consult it while building its SDK configuration, before or after Kubesense.initialize. First launch, offline launches, and unreadable caches all yield RemoteConfigDocument.EMPTY, i.e. pure SDK defaults.
refresh fetches
GET <intake endpoint>/rum/api/v1/sdk-configin the background, authenticated with the SDK's client token, and only overwrites the cache with a payload that parsed successfully. Any failure — network, non-200, malformed body — leaves the current cache (or defaults) in place. Call it once after Kubesense.initialize.schedulePeriodicRefresh keeps the cache fresh in long-running apps (kiosk-style processes that rarely restart) by re-fetching on an interval. New values still apply at the next launch.
The fetch uses a private, un-instrumented HTTP client, so the config call itself never appears as a RUM resource or trace.
-
-
Field Summary
Fields Modifier and Type Field Description public final static KubesenseRemoteConfigINSTANCE
-
Method Summary
Modifier and Type Method Description final RemoteConfigDocumentload(Context context)Loads the config document cached by a previous launch, or RemoteConfigDocument.EMPTY (pure SDK defaults) when there is none or it cannot be read. final Unitrefresh(Context context, SdkCore sdkCore)Fetches a fresh config document from the SDK's intake endpoint and caches it for the next launch. final Unitrefresh(Context context)Fetches a fresh config document from the SDK's intake endpoint and caches it for the next launch. final UnitschedulePeriodicRefresh(Context context, Long periodMs, SdkCore sdkCore)Re-fetches the config on a fixed interval, for long-running apps that rarely restart. final UnitschedulePeriodicRefresh(Context context, Long periodMs)Re-fetches the config on a fixed interval, for long-running apps that rarely restart. final UnitcancelPeriodicRefresh()Cancels a refresh scheduled with schedulePeriodicRefresh. -
-
Method Detail
-
load
final RemoteConfigDocument load(Context context)
Loads the config document cached by a previous launch, or RemoteConfigDocument.EMPTY (pure SDK defaults) when there is none or it cannot be read. Never touches the network; safe to call before Kubesense.initialize.
- Parameters:
context- the application context.
-
refresh
@JvmOverloads() final Unit refresh(Context context, SdkCore sdkCore)
Fetches a fresh config document from the SDK's intake endpoint and caches it for the next launch. Fire-and-forget: returns immediately, never throws, and never affects the current session — a failed fetch keeps the current cache (or SDK defaults). Call after Kubesense.initialize, which provides the endpoint and client token.
- Parameters:
context- the application context.sdkCore- the SDK instance whose endpoint and client token are used.
-
refresh
@JvmOverloads() final Unit refresh(Context context)
Fetches a fresh config document from the SDK's intake endpoint and caches it for the next launch. Fire-and-forget: returns immediately, never throws, and never affects the current session — a failed fetch keeps the current cache (or SDK defaults). Call after Kubesense.initialize, which provides the endpoint and client token.
- Parameters:
context- the application context.
-
schedulePeriodicRefresh
@JvmOverloads() final Unit schedulePeriodicRefresh(Context context, Long periodMs, SdkCore sdkCore)
Re-fetches the config on a fixed interval, for long-running apps that rarely restart. Values still apply at the next launch. Replaces any previously scheduled refresh; the interval is clamped to at least one minute.
- Parameters:
context- the application context.periodMs- interval between fetches, in milliseconds.sdkCore- the SDK instance whose endpoint and client token are used.
-
schedulePeriodicRefresh
@JvmOverloads() final Unit schedulePeriodicRefresh(Context context, Long periodMs)
Re-fetches the config on a fixed interval, for long-running apps that rarely restart. Values still apply at the next launch. Replaces any previously scheduled refresh; the interval is clamped to at least one minute.
- Parameters:
context- the application context.periodMs- interval between fetches, in milliseconds.
-
cancelPeriodicRefresh
final Unit cancelPeriodicRefresh()
Cancels a refresh scheduled with schedulePeriodicRefresh.
-
-
-
-