Mux v3.2.1 Mux.Data.Incidents View Source

This module includes functions for retrieving available incidents and their values in our system. These endpoints, for example, are used to construct the incidents tables in the alerts UI. API Documentation

Link to this section Summary

Functions

Lists details for a single incident.

Lists all incidents.

Lists all the incidents that seem related to a specific incident.

Link to this section Functions

Lists details for a single incident.

Returns {:ok, incident, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, incident, _env} = Mux.Data.Incidents.get(client, "ABCD1234")
iex> incident
%{"affected_views" => nil, "affected_views_per_hour" => nil, "affected_views_per_hour_on_open" => nil, "breakdowns" => [%{"id" => "pid1949", "name" => "error_type_id", "value" => "989"}], "description" => "Overall error-rate is significantly high (55.7%) due to an error of *This is a message for this crazy error*", "error_description" => "This is a message for this crazy error", "id" => "ABCD1234", "impact" => nil, "incident_key" => "country=US", "measured_value" => 55.7, "measured_value_on_close" => nil, "measurement" => "error_rate", "notification_rules" => [], "notifications" => [], "resolved_at" => nil, "sample_size" => 100, "sample_size_unit" => "views", "severity" => "alert", "started_at" => "2019-07-16T23:46:12.047Z", "status" => "open", "threshold" => 50}
Link to this function

list(client, params \\ [])

View Source

Lists all incidents.

Returns {:ok, incidents, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, incidents, _env} = Mux.Data.Incidents.list(client, status: 'open', severity: 'alert')
iex> incidents
[%{"affected_views" => 30, "affected_views_per_hour" => 60, "affected_views_per_hour_on_open" => 30, "breakdowns" => [%{"id" => "pid1077", "name" => "error_type_id", "value" => "957"}], "description" => "Overall error-rate is significantly high (55.7%) due to an error of *This is a message for this crazy error*", "error_description" => "This is a message for this crazy error", "id" => "pid1083", "impact" => "*30 views* have been affected so far at a rate of *60 per hour*", "incident_key" => "country=US", "measured_value" => 55.7, "measured_value_on_close" => nil, "measurement" => "error_rate", "notification_rules" => [], "notifications" => [], "resolved_at" => nil, "sample_size" => 100, "sample_size_unit" => "views", "severity" => "alert", "started_at" => "2019-07-17T00:46:08.344Z", "status" => "open", "threshold" => 50}]
Link to this function

related(client, id, params \\ [])

View Source

Lists all the incidents that seem related to a specific incident.

Returns {:ok, incidents, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, incidents, _env} = Mux.Data.Incidents.related(client, "ABCD1234", measurement: "median")
iex> incidents
[%{"affected_views" => 30, "affected_views_per_hour" => 25, "affected_views_per_hour_on_open" => 30, "breakdowns" => [%{"id" => "pid1753", "name" => "error_type_id", "value" => "983"}], "description" => "Overall error-rate is significantly high (55.7%) due to an error of *This is a message for this crazy error*", "error_description" => "This is a message for this crazy error", "id" => "pid1759", "impact" => "*30 views* have been affected so far at a rate of *25 per hour*", "incident_key" => "country=US", "measured_value" => 55.7, "measured_value_on_close" => nil, "measurement" => "error_rate", "notification_rules" => [], "notifications" => [], "resolved_at" => nil, "sample_size" => 100, "sample_size_unit" => "views", "severity" => "alert", "started_at" => "2019-07-16T23:46:11.183Z", "status" => "open", "threshold" => 50}]