ExInsights v0.2.0 ExInsights View Source

Exposes methods for POSTing events & metrics to Azure Application Insights. For more information on initialization and usage consult the README.md

Link to this section Summary

Types

A map of [name -> string] to add measurement data to a tracking request

Measurement name. Will be used extensively in the app insights UI

A map of [name -> string] to add metadata to a tracking request

Defines the level of severity for the event

Functions

Log a user action or other occurrence

Log a numeric value that is not associated with a specific event

Link to this section Types

Link to this type measurements() View Source
measurements() :: %{optional(name) => number}

A map of [name -> string] to add measurement data to a tracking request

Measurement name. Will be used extensively in the app insights UI

Link to this type properties() View Source
properties() :: %{optional(name) => String.t}

A map of [name -> string] to add metadata to a tracking request

Link to this type severity_level() View Source
severity_level() :: :verbose | :info | :warning | :error | :critical

Defines the level of severity for the event.

Link to this section Functions

Link to this function track_dependency(name, command_name, elapsed_time_ms, success, dependency_type_name \\ "", target \\ nil, properties \\ %{}) View Source
track_dependency(String.t, String.t, number, boolean, String.t, String.t, properties) :: :ok

Log a dependency, for example requests to an external service or SQL calls.

Parameters:

name: String that identifies the dependency.
command_name: String of the name of the command made against the dependency (eg. full URL with querystring or SQL command text).
elapsed_time_ms: Number for elapsed time in milliseconds of the command made against the dependency.
success: Boolean which indicates success.
dependency_type_name: String which denotes dependency type. Defaults to nil.
target: String of the target host of the dependency.
properties (optional): map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
Link to this function track_event(name, properties \\ %{}, measurements \\ %{}) View Source
track_event(String.t, properties, measurements) :: :ok

Log a user action or other occurrence.

Parameters:

name: name of the event (string)
properties (optional): a map of [string -> string] pairs for adding extra properties to this event
measurements (optional): a map of [string -> number] values associated with this event that can be aggregated/sumed/etc. on the UI
Link to this function track_metric(name, value, properties \\ %{}) View Source
track_metric(String.t, number, properties) :: :ok

Log a numeric value that is not associated with a specific event.

Typically used to send regular reports of performance indicators.

Parameters:

name: name of the metric
value: the value of the metric (number)
properties (optional): a map of [string -> string] pairs for adding extra properties to this event
Link to this function track_trace(message, severity_level \\ :info, properties \\ %{}) View Source
track_trace(String.t, severity_level, properties) :: :ok

Log a trace message.

Parameters:

message: A string to identify this event in the portal.
severity_level: The level of severity for the event.
properties: map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.