ExInsights v0.3.1 ExInsights View Source

Exposes methods for POST 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

Represents the exception’s stack trace

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 type stack_trace() View Source
stack_trace() :: [stack_trace_entry]

Represents the exception’s stack trace.

Link to this type stack_trace_entry() View Source
stack_trace_entry ::
  {module, atom, arity_or_args, location} |
  {(... -> any), arity_or_args, location}

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(name :: name, String.t, number, boolean, String.t, String.t | nil, properties :: 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(name :: name, properties :: properties, measurements :: 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_exception(exception, stack_trace, handle_at \\ nil, properties \\ %{}, measurements \\ %{}) View Source
track_exception(String.t, stack_trace :: stack_trace, String.t | nil, properties :: properties, measurements :: measurements) :: :ok

Log an exception you have caught.

Parameters:

exception: An Error from a catch clause, or the string error message.
stack_trace: An erlang stacktrace.
properties: map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
measurements: map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
Link to this function track_metric(name, value, properties \\ %{}) View Source
track_metric(name :: name, number, properties :: 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 :: severity_level, properties :: 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.