Authentication Parameters

The Grafana Incident provider requires the following authentication parameters:

  • host_url - The URL of the Grafana Incident instance. Example: https://your-stack.grafana.net
  • service_account_token - The service account token is used to authenticate the Grafana Incident API requests.

Getting started

  1. In your Grafana Cloud stack, click Alerts & IRM in the left-side menu.
  2. Click the Incident tile to enable the app for your Grafana Cloud instance.
  3. Once Grafana Incident is enabled it is accessible to users in your organization.

Connecting with the Provider

  1. After enabling the Grafana Incident app, navigate Adminstration > Users and access > Service Accounts.
  2. Create a new service account by clicking the Add Service Account button.
  3. Give the service account a name and assign role as Viewer.
  4. Click on Add service account token and click on Generate token.
  5. Copy the generated token.
  6. This will be used as the service_account_token parameter in the provider configuration.

Creating and updating Grafana Incidents

Grafana Incident provider supports creating and updating incidents in Grafana.

  • operationType - The operation type can be create or update.
  • updateType - The update type is used to update the various fields of the incident.

Create Incident

  • operationType - create
  • title (str) - The title of the incident.
  • severity (str) - The severity of the incident.
  • labels (list) - The labels of the incident.
  • roomPrefix (str) - The room prefix of the incident.
  • isDrill (bool) - The drill status of the incident.
  • status (str) - The status of the incident.
  • attachCaption (str) - The attachment caption of the incident.
  • attachURL (str) - The attachment URL of the incident.

Update Incident

  • operationType - update
  • updateType - The updatable fields are removeLabel, unassignLabel, unassignLabelByUUID, unassignRole, updateIncidentEventTime, updateIncidentIsDrill, updateIncidentSeverity, updateIncidentStatus, updateIncidentTitle.

Remove Label

  • incident_id (str) - The incident ID.
  • label (str) - The label to remove.

Unassign Label

  • incident_id (str) - The incident ID.
  • label (str) - The label to unassign.
  • key (str) - The key of the label to unassign.

Unassign Label By UUID

  • incident_id (str) - The incident ID.
  • key_uuid (str) - The key UUID of the label to unassign.
  • value_uuid (str) - The value UUID of the label to unassign.

Unassign Role

  • incident_id (str) - The incident ID.
  • role (str) - The role to unassign.
  • user_id (str) - The user ID to unassign.

Update Incident Event Time

  • incident_id (str) - The incident ID.
  • event_time (str) - The event time to update.
  • event_name (str) - The event name to update.

Update Incident Is Drill

  • incident_id (str) - The incident ID.
  • isDrill (bool) - The drill status to update.

Update Incident Severity

  • incident_id (str) - The incident ID.
  • severity (str) - The severity to update.

Update Incident Status

  • incident_id (str) - The incident ID.
  • status (str) - The status to update.

Update Incident Title

  • incident_id (str) - The incident ID.
  • title (str) - The title to update.

Below are the examples of workflows that create and update incidents in Grafana Incident.