-
public final class Configuration.BuilderA Builder class for a Configuration.
-
-
Constructor Summary
Constructors Constructor Description Configuration.Builder(String clientToken, String env, String variant, String service)Configuration.Builder(String clientToken, String env, String variant)Configuration.Builder(String clientToken, String env)
-
Method Summary
Modifier and Type Method Description final Configurationbuild()Builds a Configuration based on the current state of this Builder. final Configuration.BuildersetUseDeveloperModeWhenDebuggable(Boolean developerModeEnabled)Sets the Kubesense SDK to be more verbose when an application is set to debuggable.final Configuration.BuildersetFirstPartyHosts(List<String> hosts)Sets the list of first party hosts. final Configuration.BuildersetFirstPartyHostsWithHeaderType(Map<String, Set<TracingHeaderType>> hostsWithHeaderType)Sets the list of first party hosts and specifies the type of HTTP headers used for distributed tracing. final Configuration.BuilderuseSite(KubesenseSite site)Let the SDK target your preferred Kubesense's site. final Configuration.BuildersetBatchSize(BatchSize batchSize)Defines the batch size (impacts the size and number of requests performed by Kubesense). final Configuration.BuildersetUploadFrequency(UploadFrequency uploadFrequency)Defines the preferred upload frequency. final Configuration.BuildersetBatchProcessingLevel(BatchProcessingLevel batchProcessingLevel)Defines the Batch processing level, defining the maximum number of batches processed sequentially without a delay within one reading/uploading cycle. final Configuration.BuildersetAdditionalConfiguration(Map<String, Object> additionalConfig)Allows to provide additional configuration values which can be used by the SDK. final Configuration.BuildersetProxy(Proxy proxy, Authenticator authenticator)Enables a custom proxy for uploading tracked data to Kubesense's intake. final Configuration.BuildersetEncryption(Encryption dataEncryption)Allows to set the encryption for the local data. final Configuration.BuildersetPersistenceStrategyFactory(PersistenceStrategy.Factory persistenceStrategyFactory)Allows to use a custom persistence strategy. final Configuration.BuildersetCrashReportsEnabled(Boolean crashReportsEnabled)Allows to control if JVM crashes are tracked or not. final Configuration.BuildersetBackpressureStrategy(BackPressureStrategy backpressureStrategy)Sets the strategy to handle scalability issues. final Configuration.BuildersetUploadSchedulerStrategy(UploadSchedulerStrategy uploadSchedulerStrategy)Sets the strategy to schedule data uploads. final Configuration.BuildersetVersion(String version)Sets the version name that will be used for all events sent to Kubesense. -
-
Constructor Detail
-
Configuration.Builder
Configuration.Builder(String clientToken, String env, String variant, String service)
- Parameters:
clientToken- your API key of type Client Tokenenv- the environment name that will be sent with each event.variant- the variant of your application, which should be the value from yourBuildConfig.FLAVORconstant 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 Tokenenv- the environment name that will be sent with each event.variant- the variant of your application, which should be the value from yourBuildConfig.FLAVORconstant if you have different flavors, empty string otherwise.
-
-
Method Detail
-
build
final Configuration build()
Builds a Configuration based on the current state of this Builder.
-
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 isdebuggable- 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.
-
useSite
final Configuration.Builder useSite(KubesenseSite site)
Let the SDK target your preferred Kubesense's site.
-
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
-
setUploadFrequency
final Configuration.Builder setUploadFrequency(UploadFrequency uploadFrequency)
Defines the preferred upload frequency.
- Parameters:
uploadFrequency- the desired upload frequency policy
-
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.
-
setAdditionalConfiguration
final Configuration.Builder setAdditionalConfiguration(Map<String, Object> additionalConfig)
Allows to provide additional configuration values which can be used by the SDK.
- Parameters:
additionalConfig- Additional configuration values.
-
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 configurationauthenticator- the optional Authenticator for the proxy
-
setEncryption
final Configuration.Builder setEncryption(Encryption dataEncryption)
Allows to set the encryption for the local data. By default no encryption is used for the local data.
- Parameters:
dataEncryption- An encryption object complying Encryption interface.
-
setPersistenceStrategyFactory
final Configuration.Builder setPersistenceStrategyFactory(PersistenceStrategy.Factory persistenceStrategyFactory)
Allows to use a custom persistence strategy.
- Parameters:
persistenceStrategyFactory- the persistence strategy to use (or null to use the default one)
-
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)
-
setUploadSchedulerStrategy
final Configuration.Builder setUploadSchedulerStrategy(UploadSchedulerStrategy uploadSchedulerStrategy)
Sets the strategy to schedule data uploads.
- Parameters:
uploadSchedulerStrategy- the upload scheduler strategy, or null to use the default strategy (default: null)
-
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
-
-
-
-