Configuration

1. Copy REST API URL From VictorOps
  1. Login to your VictorOps account.
  2. Navigate to Alert Behavior > Integrations.
  3. Search for Metricly and select the card.
  4. Click Enable Integration.
  5. Copy the Service API Endpoint. This is required for the next step.
2. Create a Webhook notification in Metricly
  1. In Metricly, navigate to the Policy Editor.
  2. Click tab 3, Notifications.
  3. Click Add Notification and select Webhook as the Notification Type.
  4. Provide a name for the webhook notification.
  5. Choose your re-notification frequency.
  6. Click New Webhook.
  7. Name the Webhook.
  8. For URL, paste the Service API Endpoint from VictorOps.
  9. Provided a username and password if required.
  10. Click Test and Save.
    The endpoint URL must return an HTTP code 200 to pass the validation.
  11. Click Save.

Optional Configuration

Headers

Add one or more headers (key-value pairs) to the webhook notification.

Custom Payload

Select Custom from the Payload drop-down menu. A text field will open after selecting Custom. You can use the following variables and/or VictorOps fields to make your notification more dynamic. To test your template, go here or visit the GitHub page. Example The below example sends a notification that states the event’s category name, the name and ID of the element in violation, and the policy name of the violating element. Once the event has ended, it sends a RECOVERY notification stating the time that the event ended.

{
   "message_type":"<#if payloadType == "event">${eventCategory.name}</#if><#if payloadType == "event_cleared">RECOVERY</#if>", 
   "entity_id":"${elementId}",
   "entity_display_name":"${elementName}",
     "state_message":"<#if payloadType == "event"> [${elementName}] [${policyName}] [${eventTimestamp}] : ${policyDescription}</#if><#if payloadType == "event_cleared">The policy ${policyName} has CLEARED for ${elementName} and is no longer generating events as of ${eventTimestamp}</#if>"
}
 

VictorOps Fields

You can visit the VictorOps knowledge base for more information.

Field Name Description
message_type String value. This field allows the following values: INFO, WARNING, ACKNOWLEDGMENT, CRITICAL, RECOVERY.

This field is required.
entity_id String value. The name of the alerting entity.
timestamp Number value. Timestamp of the alert in seconds since epoch.
state_start_time Number value. The time the entity entered its current state (in seconds since epoch).
state_message String value. Any additional status information from the alert.
monitoring_tool String value. The name of the monitoring system software/application.
{
  "message_type":"INFO",
  "entity_is_host":"Yes",
  "entity_id":"Metricly Test",
  "state_message":"host is up"
}
 
Variables

For more information on Freemarker variables and examples of JSON payloads that use them, check out the main notifications page

{
  "message_type":"INFO",
  "entity_is_host":"Yes",
  "entity_id":"${elementId}",
  "state_message":"${elementName} is up, 
but an event occurred at ${eventTimestamp}."
}

Here’s what the custom payload looks like in VictorOps:

More About Notifications

For more information about notifications, see them main Notifications page.

capterra

Join other DevOps who love Metricly!

Sign up for a free, fully featured, 21-day trial. No credit card required!