[android-components](../../index.md) / [org.mozilla.telemetry.config](../index.md) / [TelemetryConfiguration](./index.md)

# TelemetryConfiguration

`open class TelemetryConfiguration` [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/service/telemetry/src/main/java/org/mozilla/telemetry/config/TelemetryConfiguration.java#L25)

The TelemetryConfiguration class collects the information describing the telemetry setup of an app. There are some parts that every app needs to configure: Where should measurements store data? What servers are we actually uploading pings to? This class should provide good defaults so that in the best case it is not needed to modify the configuration.

### Constructors

| Name | Summary |
|---|---|
| [&lt;init&gt;](-init-.md) | `TelemetryConfiguration(context: Context)` |

### Functions

| Name | Summary |
|---|---|
| [getAppName](get-app-name.md) | `open fun getAppName(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Get the name of the app. This value is used as one dimension when uploading telemetry to the HTTP Edge server. |
| [getAppVersion](get-app-version.md) | `open fun getAppVersion(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Get the version of the app (e.g. 45.0.1). This value is used as one dimension when uploading telemetry to the HTTP Edge server. |
| [getBuildId](get-build-id.md) | `open fun getBuildId(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Get the build id of the app (e.g. 20150125030202). This value is used as one dimension when uploading telemetry to the HTTP Edge server. |
| [getClassLoadTimestampMillis](get-class-load-timestamp-millis.md) | `open fun getClassLoadTimestampMillis(): `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) |
| [getConnectTimeout](get-connect-timeout.md) | `open fun getConnectTimeout(): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>Returns setting for connect timeout (milliseconds). A value of 0 implies that the option is disabled (i.e., timeout of infinity). |
| [getContext](get-context.md) | `open fun getContext(): Context`<br>Application context this library is running in. |
| [getDataDirectory](get-data-directory.md) | `open fun getDataDirectory(): `[`File`](https://developer.android.com/reference/java/io/File.html)<br>Get the root directory where telemetry components should store data. |
| [getInitialBackoffForUpload](get-initial-backoff-for-upload.md) | `open fun getInitialBackoffForUpload(): `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)<br>Get the interval (in milliseconds) to wait initially after a ping upload has failed. |
| [getMaximumNumberOfEventsPerPing](get-maximum-number-of-events-per-ping.md) | `open fun getMaximumNumberOfEventsPerPing(): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>Get the maximum number of events per ping. |
| [getMaximumNumberOfPingUploadsPerDay](get-maximum-number-of-ping-uploads-per-day.md) | `open fun getMaximumNumberOfPingUploadsPerDay(): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>Get the maximum number of pings that should be uploaded per day. |
| [getMaximumNumberOfPingsPerType](get-maximum-number-of-pings-per-type.md) | `open fun getMaximumNumberOfPingsPerType(): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>Get the maximum number of pings that will be stored (for upload). |
| [getMinimumEventsForUpload](get-minimum-events-for-upload.md) | `open fun getMinimumEventsForUpload(): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>Get the minimum number of telemetry events that need to be fired before even trying to upload an event ping. |
| [getPreferencesImportantForTelemetry](get-preferences-important-for-telemetry.md) | `open fun getPreferencesImportantForTelemetry(): `[`MutableSet`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>`<br>Get a list of preference keys that are important for telemetry. |
| [getReadTimeout](get-read-timeout.md) | `open fun getReadTimeout(): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>Returns setting for read timeout. 0 return implies that the option is disabled (i.e., timeout of infinity). |
| [getServerEndpoint](get-server-endpoint.md) | `open fun getServerEndpoint(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Set the server endpoint to upload telemetry pings to. |
| [getSettingsProvider](get-settings-provider.md) | `open fun getSettingsProvider(): `[`SettingsProvider`](../../org.mozilla.telemetry.measurement/-settings-measurement/-settings-provider/index.md)<br>Get the provider for reading app settings. |
| [getSharedPreferences](get-shared-preferences.md) | `open fun getSharedPreferences(): SharedPreferences`<br>Get shared preference for storing telemetry related data. |
| [getUpdateChannel](get-update-channel.md) | `open fun getUpdateChannel(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Get the update channel of the app (e.g. beta, release). This value is used as one dimension when uploading telemetry to the HTTP Edge server. |
| [getUserAgent](get-user-agent.md) | `open fun getUserAgent(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Get the user agent used when communicating with the telemetry endpoint. |
| [isCollectionEnabled](is-collection-enabled.md) | `open fun isCollectionEnabled(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Is collecting telemetry data enabled? |
| [isUploadEnabled](is-upload-enabled.md) | `open fun isUploadEnabled(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Is uploading collected telemetry data enable? |
| [setAppName](set-app-name.md) | `open fun setAppName(appName: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Set the name of the app. This value is used as one dimension when uploading telemetry to the HTTP Edge server. |
| [setAppVersion](set-app-version.md) | `open fun setAppVersion(appVersion: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Set the version of the app (e.g. 45.0.1). This value is used as one dimension when uploading telemetry to the HTTP Edge server. |
| [setBuildId](set-build-id.md) | `open fun setBuildId(buildId: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Get the build id of the app (e.g. 20150125030202). This value is used as one dimension when uploading telemetry to the HTTP Edge server. |
| [setCollectionEnabled](set-collection-enabled.md) | `open fun setCollectionEnabled(collectionEnabled: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Enable or disable collection of telemetry data. Local dev builds should disable this to avoid collecting and sending any data. |
| [setConnectTimeout](set-connect-timeout.md) | `open fun setConnectTimeout(connectTimeout: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Sets a specified timeout value, in milliseconds, to be used when opening a communications link to the telemetry endpoint. If the timeout expires before the connection can be established, the ping upload will be retried at a later time. A timeout of zero is interpreted as an infinite timeout. |
| [setDataDirectory](set-data-directory.md) | `open fun setDataDirectory(dataDirectory: `[`File`](https://developer.android.com/reference/java/io/File.html)`): `[`TelemetryConfiguration`](./index.md)<br>Set the root directory where telemetry components should store data. |
| [setInitialBackoffForUpload](set-initial-backoff-for-upload.md) | `open fun setInitialBackoffForUpload(initialBackoffForUpload: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Set the interval (in milliseconds) to wait initially after a ping upload has failed. |
| [setMaximumNumberOfEventsPerPing](set-maximum-number-of-events-per-ping.md) | `open fun setMaximumNumberOfEventsPerPing(maximumNumberOfEventsPerPing: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Set the maximum number of events per ping. If this limit is reached a ping will built and stored automatically. The number of stored and uploaded pings might be limited too. |
| [setMaximumNumberOfPingUploadsPerDay](set-maximum-number-of-ping-uploads-per-day.md) | `open fun setMaximumNumberOfPingUploadsPerDay(maximumNumberOfPingUploadsPerDay: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Set the maximum number of pings uploaded per day. This limit is enforced for every type. If you have 2 ping types and set a limit of 100 pings per day then in total 200 pings per day could be uploaded. |
| [setMaximumNumberOfPingsPerType](set-maximum-number-of-pings-per-type.md) | `open fun setMaximumNumberOfPingsPerType(maximumNumberOfPingsPerType: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Set the maximum number of pings that will be stored for a given ping type. If more types are in the local store then pings will be removed (oldest first). For this to happen the maximum needs to be reached without any successful upload. |
| [setMinimumEventsForUpload](set-minimum-events-for-upload.md) | `open fun setMinimumEventsForUpload(minimumEventsForUpload: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Set the minimum number of telemetry events that need to be fired before even trying to upload an event ping. The default value is 3. The minimum needs to be &gt;= 1. |
| [setPreferencesImportantForTelemetry](set-preferences-important-for-telemetry.md) | `open fun setPreferencesImportantForTelemetry(vararg preferences: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Set a list of preference keys that are important for telemetry. Some measurements and pings might use this to determine what preferences should be reported. |
| [setReadTimeout](set-read-timeout.md) | `open fun setReadTimeout(readTimeout: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Sets the read timeout to a specified timeout, in milliseconds. A non-zero value specifies the timeout when reading from the telemetry endpoint. If the timeout expires before there is data available for read, the ping upload will be retried later. A timeout of zero is interpreted as an infinite timeout. |
| [setServerEndpoint](set-server-endpoint.md) | `open fun setServerEndpoint(endpoint: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Set the server endpoint to upload telemetry pings to. And endpoint value should include the schema and no trailing slash, e.g.: https://telemetry.example.org |
| [setSettingsProvider](set-settings-provider.md) | `open fun setSettingsProvider(settingsProvider: `[`SettingsProvider`](../../org.mozilla.telemetry.measurement/-settings-measurement/-settings-provider/index.md)`): `[`TelemetryConfiguration`](./index.md)<br>Set a provider for reading app settings. |
| [setUpdateChannel](set-update-channel.md) | `open fun setUpdateChannel(updateChannel: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Set the update channel of the app (e.g. beta, release). This value is used as one dimension when uploading telemetry to the HTTP Edge server. |
| [setUploadEnabled](set-upload-enabled.md) | `open fun setUploadEnabled(uploadEnabled: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Enable or disable the upload of collected telemetry data. This is usually set based on a user visible preference. |
| [setUserAgent](set-user-agent.md) | `open fun setUserAgent(userAgent: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`TelemetryConfiguration`](./index.md)<br>Set the user agent used when communicating with the telemetry endpoint. |
