Systems fail from time to time. And there is nothing worse than being unaware a system is down at all. Which is why we wrote the email alerts from Lenses.io tutorial.
But what about those evenings where you are enjoying a documentary or just having an email-free evening? After all, system failures rarely happen at a magically convenient time.
This is why we have created this tutorial, which will illustrate how to integrate Lenses Alerts with Zapier to get SMS messages directly to your phone when one of your Kafka brokers is down.
Pre-requisites
In order to be able to follow the steps of this tutorial, you will need the following:
Lenses up and running. You can use our free Lenses Box instance if necessary.
An Internet connection and a Zapier account that will allow you to create a webhook and use Zapier SMS. As Zapier currently supports USA and UK mobile numbers only, you will also need to have a USA or UK mobile number. In our case, we will use a UK mobile number.
The Scenario
We want to get SMS notifications for certain types of Lenses Alerts, which is this case will be a Kafka broker going offline.
Note that the same process will allow you to get SMS alerts for all the available Lenses Infrastructure alert rules.
The Implementation
This section will present the steps needed for implementing the described scenario beginning from Lenses.
Creating a Zap in Zapier
The first thing that you should do is create a new Zap in Zapier. The Zap will have two components:
A Zap Webhook that will be used by Lenses.
A Zap SMS that will send an SMS each time the Webhook is visited. You will associate that Zap SMS app with the desired mobile number in a while.
After logging in to Zapier, select or Create Zap
from your Zapier screen.MAKE A ZAP

After that you will have to configure your Zap using existing Zapier components.
At this point it would also be a good idea to name you Zap by putting some text in the upper left corner. We will name our Zap . Although you can use any description you want, it is good to give a descriptive name followed by your name or surname in order to be able to find your Zap easily.Lenses Alert to SMS - (Tsoukalos)
After that, select , which will take you to the next screen. The name of the App will automatically appear on the screen – for that app you will have to select the Trigger Event, which in this case will be Webhooks by Zapier
.Catch Raw Hook

Press on the CONTINUE text in order for Zapier to generate the URL of the webhook, which in this case will be .https://hooks.zapier.com/hooks/catch/6433676/oiooeim/

After making sure that you copy and paste the webhook URL for easy access, press on . As it would be difficult to test the webhook at this phase, press CONTINUE
on the screen in order to continue, select and configure the next component of your pipeline.Skip Test
From the next screen, select from the SMS by Zapier
or Built-In Apps
group. This will take you to the next screen.Your Apps

If this is the first time that you are using , you will have to connect a mobile number to that app for reasons of security. Press SMS by Zapier
to continue to the next screen:Sign in to SMS by Zapier

For now only US and UK numbers are supported by app – we are going to use a number from the UK (thanks Adil!) and get a confirmation via SMS:SMS by Zapier

Now press the button to continue. In the meantime, check your mobile phone for a message from Zapier with the PIN number. Once you get that, type it in the related text box.Send PIN

Press the button to complete the process and go to the next screen:Yes, Continue

Clink on the button for the SMS text configuration.CONTINUE

Select from the Random
list and From Number
for the message and press the Your Kafka broker is down!
button. After that press the CONTINUE
button, which will make Zapier send a text message to your mobile.TEST & CONTINUE

You are done creating your Zap. The last action you should perform is turning on that Zap by pressing on the relevant switch that appears at the end of your screen and at the upper right corner. After that, press the click and select DONE EDITING
.GO TO MY ZAPS
Your newly created Zap should appear on the Zapier list. Press the down sign on the right side of your Zap and select from the menu that appears.Task History

Keep that screen open for easy reference. We are done with Zapier – we will now continue with Lenses.
Creating a Lenses Connection
You will use the Zapier webhook to create a new Lenses Connection from Lenses UI. Go to the Lenses screen and select ADMIN
. Then click on Connections
where you should select the + New Connection
kind of connection.Webhook
Based on the address (), of the Zapier webhook, you should type https://hooks.zapier.com/hooks/catch/6433676/oiooeim/
on the hooks.zapier.com
box and turn on the Host
switch.Use HTTPS
Please make sure that you do not put or HTTP
in front of the value of the HTTPS
box. The name of the connection can be whatever you want provided that is an alphanumeric string up to 127 characters long that does not contain any special symbol or whitespaces. For this tutorial, the name of the connection is Host
.zapier-sms
Click on the box and you are done. The next screen will present summary information about your connection.Save Connection

Creating a Lenses Channel
Now select , which is under the Channels
group, and then click on ALERTS
. The type of the new channel will be New Alert Channel
, so click on the relevant button.Webhook
In the screen that follows, you will need to fill in the required information, including the of the channel, which you will discover from the Zapier webhook address – in this case the value will be Request path
. The configuration of the channel appears on the next screenshot./hooks/catch/6433676/oiooeim/

After that press the button and you are done! The name of the new channel is Create Alert Channel
.zapier-channel-sms
Using a Channel for getting Alerts
The last step is about connecting that channel to the desired alert rules – in this case the rule of interest is . For that, you should go the Kafka Broker is down
screen and edit the Rules
Rule as follows:Kafka Broker is down

That is the last step for connecting Zapier with Lenses.
Note that you are allowed to associate a channel with multiple rules but this might be confusing sometimes.
Seeing the results
If a Kafka broker goes down or becomes unreachable, Lenses will use the Zapier webhook as a trigger for sending an SMS message. The same will happen when a Kafka broker goes up again!

Additionally, you can visit the screen of your Zap to see the number of SMS messages that have been sent for that particular Zap.Task History

Next steps
Now that you know how to send SMS alerts from Lenses, you should begin designing your strategy in order to get notified when something happens to your Kafka infrastructure.







