-
- All Implemented Interfaces:
-
java.io.Serializable,java.lang.Comparable
public enum ApplicationInsights
-
-
Field Summary
Fields Modifier and Type Field Description private booleantelemetryDisabledprivate TelemetryContexttelemetryContextprivate Map<String, String>commonPropertiesprivate ChannelTypechannelType
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Method Summary
Modifier and Type Method Description static voidsetup(Context context, Application application)Configure Application InsightsNote: This should be called before start static voidsetup(Context context, Application application, String instrumentationKey)Configure Application InsightsNote: This should be called before start static voidstart()Start ApplicationInsightsNote: This should be called after isConfigured static voidsendPendingData()Triggers persisting and if applicable sending of queued datanote: this will be called maxBatchIntervalMs aftertracking any telemetry so it is not necessary to call this in most cases. static voidenableAutoCollection()Enables all auto-collection features. static voiddisableAutoCollection()disables all auto-collection features static voidenableAutoPageViewTracking()Enable auto page view tracking before calling start orat runtime. static voiddisableAutoPageViewTracking()Disable auto page view tracking before calling start orat runtime. static voidenableAutoSessionManagement()Enable auto session management tracking before calling start orat runtime. static voiddisableAutoSessionManagement()Disable auto session management tracking before calling start orat runtime. static voidenableAutoAppearanceTracking()Enable auto appearance management tracking before calling start orat runtime. static voiddisableAutoAppearanceTracking()Disable auto appearance management tracking before calling start orat runtime. static voidsetDeveloperMode(boolean developerMode)Activates the developer mode which. static booleanisDeveloperMode()Check if developerMode is activated static ConfigurationgetConfiguration()Gets the configuration for the ApplicationInsights instance static voidrenewSession(String sessionId)Force Application Insights to create a new session with a custom sessionID. static Array<ApplicationInsights>values()static ApplicationInsightsvalueOf(String name)static voidsetTelemetryDisabled(boolean disabled)Enable / disable tracking of telemetry data. static TelemetryContextgetTelemetryContext()Gets the configuration for the ApplicationInsights instance static Map<String, String>getCommonProperties()Gets the properties which are common to all telemetry sent from this client. static voidsetCommonProperties(Map<String, String> commonProperties)Sets properties which are common to all telemetry sent form this client. static ChannelTypegetChannelType()Gets the currently used channel type static voidsetChannelType(ChannelType channelType)Sets the channel type to be used for logging -
-
Method Detail
-
setup
static void setup(Context context, Application application)
Configure Application InsightsNote: This should be called before start
- Parameters:
application- the application context the application needed for auto collecting telemetry data
-
setup
static void setup(Context context, Application application, String instrumentationKey)
Configure Application InsightsNote: This should be called before start
- Parameters:
context- the application context associated with Application Insightsapplication- the application needed for auto collecting telemetry datainstrumentationKey- the instrumentation key associated with the app
-
start
static void start()
Start ApplicationInsightsNote: This should be called after isConfigured
-
sendPendingData
static void sendPendingData()
Triggers persisting and if applicable sending of queued datanote: this will be called maxBatchIntervalMs aftertracking any telemetry so it is not necessary to call this in most cases.
-
enableAutoCollection
static void enableAutoCollection()
Enables all auto-collection features. Call this before start or when ApplicationInsights is already running to changeAutoCollection settings at runtime.Requires ApplicationInsights to be setup with an Application object
-
disableAutoCollection
static void disableAutoCollection()
disables all auto-collection features
-
enableAutoPageViewTracking
static void enableAutoPageViewTracking()
Enable auto page view tracking before calling start orat runtime. This feature only works if ApplicationInsights has been setupwith an application.
-
disableAutoPageViewTracking
static void disableAutoPageViewTracking()
Disable auto page view tracking before calling start orat runtime. This feature only works if ApplicationInsights has been setupwith an application.
-
enableAutoSessionManagement
static void enableAutoSessionManagement()
Enable auto session management tracking before calling start orat runtime. This feature only works if ApplicationInsights has been setupwith an application.
-
disableAutoSessionManagement
static void disableAutoSessionManagement()
Disable auto session management tracking before calling start orat runtime. This feature only works if ApplicationInsights has been setupwith an application.
-
enableAutoAppearanceTracking
static void enableAutoAppearanceTracking()
Enable auto appearance management tracking before calling start orat runtime. This feature only works if ApplicationInsights has been setupwith an application.
-
disableAutoAppearanceTracking
static void disableAutoAppearanceTracking()
Disable auto appearance management tracking before calling start orat runtime. This feature only works if ApplicationInsights has been setupwith an application.
-
setDeveloperMode
static void setDeveloperMode(boolean developerMode)
Activates the developer mode which. It enables extensive logging as well as use differentsettings for batching. Batch Size in debug mode is 5 and sending interval is 3s.
- Parameters:
developerMode- if true, developer mode will be activated
-
isDeveloperMode
static boolean isDeveloperMode()
Check if developerMode is activated
-
getConfiguration
static Configuration getConfiguration()
Gets the configuration for the ApplicationInsights instance
-
renewSession
static void renewSession(String sessionId)
Force Application Insights to create a new session with a custom sessionID.
- Parameters:
sessionId- a custom session ID used of the session to create
-
values
static Array<ApplicationInsights> values()
-
valueOf
static ApplicationInsights valueOf(String name)
-
setTelemetryDisabled
static void setTelemetryDisabled(boolean disabled)
Enable / disable tracking of telemetry data.
- Parameters:
disabled- if set to true, the telemetry feature will be disabled
-
getTelemetryContext
static TelemetryContext getTelemetryContext()
Gets the configuration for the ApplicationInsights instance
-
getCommonProperties
static Map<String, String> getCommonProperties()
Gets the properties which are common to all telemetry sent from this client.
-
setCommonProperties
static void setCommonProperties(Map<String, String> commonProperties)
Sets properties which are common to all telemetry sent form this client.
- Parameters:
commonProperties- a dictionary of properties to log with all telemetry.
-
getChannelType
static ChannelType getChannelType()
Gets the currently used channel type
-
setChannelType
static void setChannelType(ChannelType channelType)
Sets the channel type to be used for logging
- Parameters:
channelType- The channel type to use
-
-
-
-