Package 

Object KubesenseRemoteConfig


  • 
    public class KubesenseRemoteConfig
    
                        

    Dashboard-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-config in 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.

    • Method Detail

      • 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.