Package 

Class Configuration.Builder

    • Constructor Detail

      • Configuration.Builder

        Configuration.Builder(String clientToken, String env, String variant, String service)
        Parameters:
        clientToken - your API key of type Client Token
        env - the environment name that will be sent with each event.
        variant - the variant of your application, which should be the value from your BuildConfig.FLAVOR constant if you have different flavors, empty string otherwise.
        service - the service name (if set to null, it'll be set to your application's package name, e.g.: com.example.
      • Configuration.Builder

        Configuration.Builder(String clientToken, String env, String variant)
        Parameters:
        clientToken - your API key of type Client Token
        env - the environment name that will be sent with each event.
        variant - the variant of your application, which should be the value from your BuildConfig.FLAVOR constant if you have different flavors, empty string otherwise.
      • Configuration.Builder

        Configuration.Builder(String clientToken, String env)
        Parameters:
        clientToken - your API key of type Client Token
        env - the environment name that will be sent with each event.
    • Method Detail

      • setUseDeveloperModeWhenDebuggable

         final Configuration.Builder setUseDeveloperModeWhenDebuggable(Boolean developerModeEnabled)

        Sets the Kubesense SDK to be more verbose when an application is set to debuggable. This is equivalent to setting: setSessionSampleRate(100) setBatchSize(BatchSize.SMALL) setUploadFrequency(UploadFrequency.FREQUENT) Kubesense.setVerbosity(Log.VERBOSE) These settings will override your configuration, but only when the application is debuggable

        Parameters:
        developerModeEnabled - Enable or disable extra debug info when an app is debuggable
      • setFirstPartyHosts

         final Configuration.Builder setFirstPartyHosts(List<String> hosts)

        Sets the list of first party hosts. Requests made to a URL with any one of these hosts (or any subdomain) will:

        • be considered a first party resource and categorised as such in your RUM dashboard;

        • be wrapped in a Span and have Kubesense trace id injected to get a full flame-graph in APM in case of OkHttp instrumentation usage.

        Parameters:
        hosts - a list of all the hosts that you own.
      • setFirstPartyHostsWithHeaderType

         final Configuration.Builder setFirstPartyHostsWithHeaderType(Map<String, Set<TracingHeaderType>> hostsWithHeaderType)

        Sets the list of first party hosts and specifies the type of HTTP headers used for distributed tracing. Requests made to a URL with any one of these hosts (or any subdomain) will:

        • be considered a first party resource and categorised as such in your RUM dashboard;

        • be wrapped in a Span and have trace id of the specified types injected to get a full flame-graph in APM. Multiple header types are supported for each host.

        Parameters:
        hostsWithHeaderType - a list of all the hosts that you own and the tracing headers to be used for each host.
      • useKubesenseRumEndpoint

         final Configuration.Builder useKubesenseRumEndpoint(String endpoint)

        Let the SDK target a Kubesense RUM intake host, instead of the one of the configured KubesenseSite. All features (RUM, Logs, Traces, Session Replay, Profiling, Flags) upload to this single endpoint. The provided value must be a host, with an optional port, e.g.: intake.example.com or intake.example.com:8443. A scheme or path in the value is ignored: data is always uploaded over https, to https://<host>/rum/api/v1/....

        Parameters:
        endpoint - the Kubesense RUM intake host.
      • setRemoteConfigurationEnabled

         final Configuration.Builder setRemoteConfigurationEnabled(Boolean enabled)

        Controls dashboard-managed remote configuration, which is enabled by default.

        When enabled, Kubesense.initialize loads the configuration cached by the previous launch (a small local file read, never a network call), features apply the settings it carries as they are enabled, and the SDK fetches a fresh document in the background for the next launch, refreshing it periodically thereafter. Applications do not have to call anything.

        Disable it to keep the SDK strictly on the settings the application passes in code.

        Parameters:
        enabled - whether remote configuration is applied and fetched.
      • setRemoteConfigurationRefreshPeriodMs

         final Configuration.Builder setRemoteConfigurationRefreshPeriodMs(Long periodMs)

        Sets how often the SDK re-fetches the remote configuration, for long running applications that rarely restart. Fetched values still apply at the next launch. Values below one minute are raised to one minute; a value of zero or less fetches once after initialization and never again.

        Parameters:
        periodMs - the interval between fetches, in milliseconds.
      • setBatchSize

         final Configuration.Builder setBatchSize(BatchSize batchSize)

        Defines the batch size (impacts the size and number of requests performed by Kubesense).

        Parameters:
        batchSize - the desired batch size
      • setBatchProcessingLevel

         final Configuration.Builder setBatchProcessingLevel(BatchProcessingLevel batchProcessingLevel)

        Defines the Batch processing level, defining the maximum number of batches processed sequentially without a delay within one reading/uploading cycle.

        Parameters:
        batchProcessingLevel - the desired batch processing level.
      • setProxy

         final Configuration.Builder setProxy(Proxy proxy, Authenticator authenticator)

        Enables a custom proxy for uploading tracked data to Kubesense's intake.

        Parameters:
        proxy - the Proxy configuration
        authenticator - the optional Authenticator for the proxy
      • setCrashReportsEnabled

         final Configuration.Builder setCrashReportsEnabled(Boolean crashReportsEnabled)

        Allows to control if JVM crashes are tracked or not. Default value is true.

        Parameters:
        crashReportsEnabled - whether crashes are tracked and sent to Kubesense
      • setBackpressureStrategy

         final Configuration.Builder setBackpressureStrategy(BackPressureStrategy backpressureStrategy)

        Sets the strategy to handle scalability issues. Many operations (data processing, event I/O, …) are queued in background threads. This configuration lets one decide how to handle the edge case when the queue starts growing, which can lead to a lot of memory usage, delayed processing, and possibly OOM or ANR.

        Parameters:
        backpressureStrategy - the backpressure strategy (default strategy ignores new tasks if a queue reaches 1024 items)
      • setVersion

         final Configuration.Builder setVersion(String version)

        Sets the version name that will be used for all events sent to Kubesense. If not provided, the SDK will use the version from the application's package info.

        Parameters:
        version - the version name to use