Grafana

Create an outgoing webhook to create incidents to Grafana triggered by Apono access request events

Grafana allows you to query, visualize, alert on, and understand your metrics no matter where they are stored. Create, explore, and share dashboards with your team and foster a data-driven culture.

Prerequisite

ItemDescription
PermissionsAdmin user for Grafana account
Enable Incoming WebhooksIn the Grafana Incident web app, an admin can go to Integrations to enable incoming webhooks. Installing the Incoming Webhooks integration will generate a token which you will use to authorize the requests.
1. Go to Alerts & Incidents and under Incident choose Integrations
2. Select the Incoming Webhooks integration
3. Click Install integration
4. Make note of the Token and URL fields as shown below

Creating the webhook

  1. In the Apono admin portal, click your avatar at the bottom left corner, click Settings and pick Webhooks
  1. Click Add Webhook
  2. Fill in the following fields:
  3. Method - POST
  4. URL
    https://<Incoming_Webhook_URL>?title=json(title)
    
  5. The webhook body:
{
	"title":"Apono - New {{event_type}} made by {{data.requester.name}}",
	"message": {
		"shortMessage": "{ \"event_type\": \"{{ event_type }}\", \"event_time\": \"{{ event_time }}\", \"id\": \"{{ data.id }}\", \"friendly_id\": \"{{ data.friendly_id }}\", \"requester_id\": \"{{ data.requester.id }}\", \"requester_name\": \"{{ data.requester.name }}\", \"requester_email\": \"{{ data.requester.email }}\", \"justification\": \"{{ data.justification }}\", \"creation_date\": \"{{ data.creation_date }}\", \"access_flow_id\": \"{{ data.access_flow.id }}\", \"access_flow_name\": \"{{ data.access_flow.name }}\", \"access_bundle_id\": \"{{ data.access_bundle.id }}\", \"access_bundle_name\": \"{{ data.access_bundle.id }}\", \"access_groups_integration_name\": \"{{ data.access_groups.[0].integration.name }}\", \"access_groups_integration_type\": \"{{ data.access_groups.[0].integration.type }}\"}"
		}
}

This is an example body. You may use other fields according to your needs. See the schema to the right of the screen to learn more about available data fields.

  1. Headers - Authorization : Bearer <Incoming_Webhook_Token>
  2. Triggers - you may pick one or more triggers. Triggers correspond to Apono access request statuses:
  • Created
  • Approved
  • Rejected
  • Granted
  • Expired
  • Failed
  1. Name - any name of your choosing. This will be displayed in the webhooks table.
  2. Status - if you save the webhook as active, it can be triggered immediately. If you prefer, you may also save it as inactive and activate it later.
  3. Optional: Test your webhook configuration. You should see Success as the response status.
    Please note: The Test will create new incident to your Grafana with mock data.

Results

Your webhook should now start creating new incidents to Grafana once triggered: