ApplicationInsightsBotTelemetryClient Class

  • java.lang.Object
    • com.microsoft.bot.applicationinsights.ApplicationInsightsBotTelemetryClient

Implements

public class ApplicationInsightsBotTelemetryClient
implements BotTelemetryClient

A logging client for bot telemetry.

Constructor Summary

Constructor Description
ApplicationInsightsBotTelemetryClient(String instrumentationKey)

Initializes a new instance of the BotTelemetryClient.

Method Summary

Modifier and Type Method and Description
void flush()

Flushes the in-memory buffer and any metrics being pre-aggregated.

com.microsoft.applicationinsights.TelemetryConfiguration getTelemetryConfiguration()

Provides access to the Application Insights configuration that is running here.

void trackAvailability(String name, OffsetDateTime timeStamp, Duration duration, String runLocation, boolean success, String message, Map<String,String> properties, Map<String,Double> metrics)

Send information about availability of an application.

void trackDependency(String dependencyTypeName, String target, String dependencyName, String data, OffsetDateTime startTime, Duration duration, String resultCode, boolean success)

Send information about an external dependency (outgoing call) in the application.

void trackDialogView(String dialogName, Map<String,String> properties, Map<String,Double> metrics)

We implemented this method calling the tracePageView method from ApplicationInsightsBotTelemetryClient as the IBotPageViewTelemetryClient has not been implemented.

void trackEvent(String eventName, Map<String,String> properties, Map<String,Double> metrics)

Logs custom events with extensible named fields.

void trackException(Exception exception, Map<String,String> properties, Map<String,Double> metrics)

Logs a system exception.

void trackPageView(String dialogName, Map<String,String> properties, Map<String,Double> metrics)

Logs a dialog entry / as an Application Insights page view.

void trackTrace(String message, Severity severityLevel, Map<String,String> properties)

Send a trace message.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

ApplicationInsightsBotTelemetryClient

public ApplicationInsightsBotTelemetryClient(String instrumentationKey)

Initializes a new instance of the BotTelemetryClient.

Parameters:

instrumentationKey - The instrumentation key provided to create the ApplicationInsightsBotTelemetryClient.

Method Details

flush

public void flush()

Flushes the in-memory buffer and any metrics being pre-aggregated.

getTelemetryConfiguration

public TelemetryConfiguration getTelemetryConfiguration()

Provides access to the Application Insights configuration that is running here. Allows developers to adjust the options.

Returns:

Application insights configuration.

trackAvailability

public void trackAvailability(String name, OffsetDateTime timeStamp, Duration duration, String runLocation, boolean success, String message, Map properties, Map metrics)

Send information about availability of an application.

Parameters:

name - Availability test name.
timeStamp - The time when the availability was captured.
duration - The time taken for the availability test to run.
runLocation - Name of the location the availability test was run from.
success - True if the availability test ran successfully.
message - Error message on availability test run failure.
properties - Named string values you can use to classify and search for this availability telemetry.
metrics - Additional values associated with this availability telemetry.

trackDependency

public void trackDependency(String dependencyTypeName, String target, String dependencyName, String data, OffsetDateTime startTime, Duration duration, String resultCode, boolean success)

Send information about an external dependency (outgoing call) in the application.

Parameters:

dependencyTypeName - Name of the command initiated with this dependency call. Low cardinality value. Examples are SQL, Azure table, and HTTP.
target - External dependency target.
dependencyName - Name of the command initiated with this dependency call. Low cardinality value. Examples are stored procedure name and URL path template.
data - Command initiated by this dependency call. Examples are SQL statement and HTTP URL's with all query parameters.
startTime - The time when the dependency was called.
duration - The time taken by the external dependency to handle the call.
resultCode - Result code of dependency call execution.
success - True if the dependency call was handled successfully.

trackDialogView

public void trackDialogView(String dialogName, Map properties, Map metrics)

We implemented this method calling the tracePageView method from ApplicationInsightsBotTelemetryClient as the IBotPageViewTelemetryClient has not been implemented.

Parameters:

dialogName
properties
metrics

trackEvent

public void trackEvent(String eventName, Map properties, Map metrics)

Logs custom events with extensible named fields.

Parameters:

eventName - A name for the event.
properties - Named string values you can use to search and classify events.
metrics - Measurements associated with this event.

trackException

public void trackException(Exception exception, Map properties, Map metrics)

Logs a system exception.

Parameters:

exception - The exception to log.
properties - Named string values you can use to classify and search for this exception.
metrics - Additional values associated with this exception

trackPageView

public void trackPageView(String dialogName, Map properties, Map metrics)

Logs a dialog entry / as an Application Insights page view.

Parameters:

dialogName - The name of the dialog to log the entry / start for.
properties - Named string values you can use to search and classify events.
metrics - Measurements associated with this event.

trackTrace

public void trackTrace(String message, Severity severityLevel, Map properties)

Send a trace message.

Parameters:

message - Message to display.
severityLevel - Trace severity level Severity.
properties - Named string values you can use to search and classify events.

Applies to