-
public class TelemetryClientThe public API for recording application insights telemetry.
-
-
Field Summary
Fields Modifier and Type Field Description private static TelemetryClientinstance
-
Method Summary
Modifier and Type Method Description static TelemetryClientgetInstance()voidtrackEvent(String eventName){@code properties}defaults to{@code null}.voidtrackEvent(String eventName, Map<String, String> properties){@code measurements}defaults to{@code null}.voidtrack(TelemetryData telemetry)Sends information about any object that extend TelemetryData interface to Application Insights.For most use-cases, the other tracking methods will be sufficient. voidtrackEvent(String eventName, Map<String, String> properties, Map<String, Double> measurements)Sends information about an event to Application Insights. voidtrackTrace(String message){@code measurements}defaults to{@code null}.voidtrackTrace(String message, Map<String, String> properties)Sends tracing information to Application Insights. voidtrackMetric(String name, double value)Sends information about an aggregated metric to Application Insights. voidtrackMetric(String name, double value, Map<String, String> properties)Sends information about an aggregated metric to Application Insights. voidtrackPageView(String pageName){@code properties}defaults to{@code null}.voidtrackPageView(String pageName, Map<String, String> properties){@code measurements}defaults to{@code null}.voidtrackPageView(String pageName, Map<String, String> properties, Map<String, Double> measurements)voidtrackDependencyView(String pageName, Map<String, String> properties)voidtrackAvailabilityView(String eventName, Map<String, String> properties)voidtrackRequestView(String requestName, Map<String, String> properties)voidtrackHandledException(Exception ex, Map<String, String> properties)voidtrackNewSession()Sends information about a new Session to Application Insights. -
-
Method Detail
-
getInstance
static TelemetryClient getInstance()
-
trackEvent
void trackEvent(String eventName)
{@code properties}defaults to{@code null}.{@code measurements}defaults to{@code null}.
-
trackEvent
void trackEvent(String eventName, Map<String, String> properties)
{@code measurements}defaults to{@code null}.
-
track
void track(TelemetryData telemetry)
Sends information about any object that extend TelemetryData interface to Application Insights.For most use-cases, the other tracking methods will be sufficient. Providing this generic methodfor very specific uses.
- Parameters:
telemetry- an object that extends TelemetryData
-
trackEvent
void trackEvent(String eventName, Map<String, String> properties, Map<String, Double> measurements)
Sends information about an event to Application Insights.
- Parameters:
eventName- The name of the eventproperties- Custom properties associated with the event.measurements- Custom measurements associated with the event.
-
trackTrace
void trackTrace(String message)
{@code measurements}defaults to{@code null}.
-
trackTrace
void trackTrace(String message, Map<String, String> properties)
Sends tracing information to Application Insights.
- Parameters:
message- The message associated with this trace.properties- Custom properties associated with the event.
-
trackMetric
void trackMetric(String name, double value)
Sends information about an aggregated metric to Application Insights. Note: all data sent viathis method will be aggregated. To log non-aggregated data use trackEvent with measurements.
- Parameters:
name- The name of the metricvalue- The value of the metric
-
trackMetric
void trackMetric(String name, double value, Map<String, String> properties)
Sends information about an aggregated metric to Application Insights. Note: all data sent viathis method will be aggregated. To log non-aggregated data use trackEvent with measurements.
- Parameters:
name- The name of the metricvalue- The value of the metric
-
trackPageView
void trackPageView(String pageName)
{@code properties}defaults to{@code null}.{@code measurements}defaults to{@code null}.
-
trackPageView
void trackPageView(String pageName, Map<String, String> properties)
{@code measurements}defaults to{@code null}.
-
trackPageView
void trackPageView(String pageName, Map<String, String> properties, Map<String, Double> measurements)
-
trackDependencyView
void trackDependencyView(String pageName, Map<String, String> properties)
-
trackAvailabilityView
void trackAvailabilityView(String eventName, Map<String, String> properties)
-
trackRequestView
void trackRequestView(String requestName, Map<String, String> properties)
-
trackHandledException
void trackHandledException(Exception ex, Map<String, String> properties)
-
trackNewSession
void trackNewSession()
Sends information about a new Session to Application Insights.
-
-
-
-