Package-level declarations

Types

Link copied to clipboard
class DictionaryUpdate(val name: String, val timestamp: Long)

Represents an update of a dictionary.

Link copied to clipboard
Link copied to clipboard

Random-access file handle abstraction. All operations are expected to be blocking

Link copied to clipboard

Abstraction over file system access used by the FUS client.

Link copied to clipboard
Link copied to clipboard
fun interface FileStorageProvider
Link copied to clipboard
Link copied to clipboard
class FusClientComponents<E, R>(loggerFactory: FusLoggerFactory, fusHttpClient: FusHttpClient, fileStorage: FileStorage, bundledFileStorage: FileStorage?, eventLogFileStorage: FileStorage?, jsonSerializer: FusJsonSerializer, val remoteConfig: RemoteConfig, val metadataStorage: MetadataStorage<*>, reportAnonymizer: ReportAnonymizer<E>, reportValidator: ReportValidator<E>, val fusReportDispatcher: FusReportDispatcher<E, R>)
Link copied to clipboard
data class FusClientConfig(val productName: String, val productCode: String, val recorderCode: String, val recorderVersion: String, val regionCode: RegionCode = RegionCode.ALL, val productVersion: String, val baselineVersion: Int, val anonymizationSalt: String? = null, val isTest: Boolean, val reduceInitialMetadataUpdateDelay: Boolean, val enableAsyncEventLogging: Boolean = true, val isRecordEnabled: () -> Boolean = { true }, val isSendEnabled: () -> Boolean = { true }, val isLoggingEnabled: () -> Boolean = { true })
Link copied to clipboard
interface FusComponent

Interface providing lifecycle hooks to FUS components.

Link copied to clipboard
data class FusEvent(val event: Any, val rawEventId: String?, val rawEventData: Map<String, Any>?)
Link copied to clipboard

Minimal HTTP client abstraction used by the FUS client to talk to backend services. Implementations should be synchronous.

Link copied to clipboard
fun interface FusHttpClientProvider
Link copied to clipboard

JSON serialization abstraction used by the FUS client. Implementations can delegate to different JSON libraries.

Link copied to clipboard
Link copied to clipboard

Factory for creating simple logger instances used by the FUS client. Implementations can bridge to platform-specific logging (e.g., java.util.logging).

Link copied to clipboard
Link copied to clipboard

Dispatches validated reports to the backend. Implementations typically serialize the report to JSON and send it over HTTP.

Link copied to clipboard
Link copied to clipboard
data class HttpResponse(val statusCode: Int, val body: String?)

Simple HTTP response wrapper.

Link copied to clipboard
data class LoadError(val errorType: LoadErrorType, val statusCode: Int)
Link copied to clipboard

Possible stages at which a metadata load/update error can occur

Link copied to clipboard
interface Logger

Minimal logging abstraction used within the FUS client. Log levels are intentionally limited to keep the API portable across platforms.

Link copied to clipboard
class MessageBus(scope: CoroutineScope)

Lightweight pub/sub message bus for intra-component communication.

Link copied to clipboard
class MessageHandler<T : Any>(messageBus: MessageBus, scope: CoroutineScope, topic: Topic<T>, handleError: suspend (Throwable) -> Unit = {}, handleMessage: suspend (message: T) -> Unit) : FusComponent

A handler for subscribing to a specific message topic on a MessageBus. It listens for messages published to the specified Topic and processes them using the provided handler function on a new coroutine in the provided CoroutineScope.

Link copied to clipboard
fun interface MessageHandlerProvider<T : Any>
Link copied to clipboard

Provides access to validation rules and anonymization metadata required for processing FUS reports. Implementations may fetch and cache metadata from remote sources and/or bundled resources.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Resolves remote endpoints and client options used by the FUS client. Implementations can consult product configuration, environment, and server responses.

Link copied to clipboard
fun interface RemoteConfigProvider
Link copied to clipboard

Performs anonymization of sensitive fields in a report according to metadata rules.

Link copied to clipboard
fun interface ReportAnonymizerProvider<E, R>
Link copied to clipboard

Validates a report against metadata rules (group rules, event id rules, fields, etc.).

Link copied to clipboard
fun interface ReportValidatorProvider<E, R>
Link copied to clipboard
data class Topic<T : Any>(val name: String, val clazz: KClass<T>)

Holds the topic key and data type information of messages.

Properties

Link copied to clipboard

Failed to load the JSON file listing validation dictionaries.

Link copied to clipboard

Failed to update the JSON file listing validation dictionaries.

Link copied to clipboard

A validation dictionary failed to load.

Link copied to clipboard

A validation dictionary was loaded.

Link copied to clipboard

A validation dictionary was update failed.

Link copied to clipboard

A validation dictionary was updated.

Link copied to clipboard

Topic type String represents the version of the metadata that was loaded.

Link copied to clipboard

Topic type String represents the version of the updated metadata.

Link copied to clipboard

An event was validated and queued for sending. Contains both the processed event and the original (raw) event data.

Link copied to clipboard

Topic for notifying subscribers about configuration option update failures.

Link copied to clipboard

Remote config options have been updated. The updates may contain no changes.

Functions

Link copied to clipboard

Use bundledFileStorage in case your product comes with pre-bundled metadata if clients are not connected to the internet on the first startup of the product.

Link copied to clipboard
Link copied to clipboard

Configures the FusClient components. Include defaultBusinessLogic from com.jetbrains.fus.reporting.defaults and the DFL functions displayed below.

Link copied to clipboard

Jump to the source of FusClientConfig.Builder for the configuration options.

Link copied to clipboard

Use eventLogFileStorage to specify a separate file storage for event log data used by the report dispatcher. If not set, the regular fileStorage will be used instead.

Link copied to clipboard

Provide file storage for caching metadata, dictionaries, and event logs.

Link copied to clipboard
fun <E, R> fusClient(init: FusClient.Builder<E, R>.() -> Unit): FusClient<E, R>

Build and configure a client that collects, enriches, and sends events. Required:

Link copied to clipboard

Provide an HTTP client for communicating with FUS backend services.

Link copied to clipboard

Provide JSON (de)serialization for events, metadata, and configuration.

Link copied to clipboard

Provide logging for all internal FUS operations by bridging to your application's logging framework.

Link copied to clipboard
Link copied to clipboard
fun <T : Any> FusClient.Builder<*, *>.messageHandler(topic: Topic<T>, errorHandler: (Throwable) -> Unit = {}, handle: suspend (message: T) -> Unit)

Registers a callback that runs asynchronously when the step identified by topic occurs inside the FusClient. Message handlers can run concurrently, so shared resources must be thread-safe.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect fun <T> runBlockingPlatform(block: suspend CoroutineScope.() -> T): T
actual fun <T> runBlockingPlatform(block: suspend CoroutineScope.() -> T): T
actual fun <T> runBlockingPlatform(block: suspend CoroutineScope.() -> T): T
actual fun <T> runBlockingPlatform(block: suspend CoroutineScope.() -> T): T
Link copied to clipboard
Link copied to clipboard
inline fun <T : Any> topic(name: String): Topic<T>