IncidentIo.AlertEventsV2 (IncidentIo v0.3.1)

View Source

Send alert events to incident.io via HTTP alert sources.

Alert events allow external systems to push alerts into incident.io, which can then trigger incidents automatically based on your alert routing rules.

Summary

Types

body()

@type body() :: %{
  deduplication_key: binary(),
  description: binary(),
  metadata: %{service: binary(), team: list()},
  source_url: binary(),
  status: binary(),
  title: binary()
}

Functions

create(client \\ %Client{}, alert_source_config_id, token, body)

@spec create(IncidentIo.Client.t(), binary(), binary(), body()) ::
  IncidentIo.response()

Create an alert event using an HTTP source.

Alert event body example:

%{
  deduplication_key: "4293868629",
  description: "We've detected a number of timeouts on hello.world.com, the service may be down. To fix...",
  metadata: %{
    service: "hello.world.com",
    team: [
      "my-team"
    ]
  },
  source_url: "https://www.my-alerting-platform.com/alerts/my-alert-123",
  status: "firing",
  title: "*errors.withMessage: PG::Error failed to connect"
}

Example

IncidentIo.AlertEventsV2.create(client, "some-alert-source-config-id", "some-token", body)

More information at: https://api-docs.incident.io/tag/Alert-Events-V2#operation/Alert-Eventss%20V2_Create