Add Events to Wavefront

Gary Forrest
2 min readApr 18, 2019

--

How to add events to Wavefront for use on your dashboards.

In a previous post I talked about the benefits of recording all change events for an environment (operations & engineering environments). I can’t emphasize enough how beneficial it is to record all change events to an environment and then overlay them to your monitoring dashboards. I love how adding deployment events can quickly show the cause of an issue, see adding annotations to Grafana via Jenkins.

In this guide I’ll show you how to add a backup event to Wavefront via an API call. This example will create a start event and then and end, with will then show the complete duration of the backup. You can create alerts, via Wavefront, to alarm if the backup is too long, did not happen, etc.

The first thing you need to do is create a Wavefront token, to use with your API call. Follow this guide to create your token.

The following script will run a backup of Broker App, with a start event and then end event sent to the Wavefront api.

Backup Script

Let’s look at the key parts of the script. First we create an event and capture the event id. We need the event id so we can end the event.

You’ll will need to update the script with your Wavefront organization name and the tags and names you want to use. Wavefront allows you to also set the severity of the event, since this is a backup I set the severity to info, you can use severe or warn too. Now that the event is added, the script will run a backup of Broker application. The last thing to do is end the Wavefront event, for this we need the Wavefront event IDs we captured earlier ($wavefront_event_id1, $wavefront_event_id2)

Now that the event is closed out you can to add your event to a Wavefront dashboard. Login into Wavefront and choose a dashboard, in this example it would be the Broker App dashboard. From the settings, I like to use the From Chart & Dashboard option.

--

--