5.1 Get APM event alerts with Slack

What is Slack?

image

Slack works in a variety of web browsers and on iOS and Android platforms. The Slack app allows you to share messages between team members, much like a group chat in KakaoTalk, and all messages are stored on the server and can be retrieved at any time, just like email.

APM gives you the ability to add a bot to the slack that your team members use, which logs all the events that happen in APM in a specific message channel.

Users who subscribe to that channel can receive "alerts" on their mobile devices or web browsers about what’s happening in APM on their servers. It’s like an SMS or KakaoTalk messenger notification.

In the next chapter, we’ll show you how to create a team in Slack, add a bot, and integrate events from APM with Slack.

Access the Slack site

Go to https://slack.com and create an account.

01 image33

Create a Slack account

Click the "Create account" button and enter your email address.

01 image34

We recommend using the email address you use at work.

01 image35

Enter your Slack confirmation code

Check the confirmation code sent to your email address.

01 image36

Enter the confirmation code into the appropriate window in Slack.

01 image37

Create a Slack workspace

Click the "Create workspace" button to create a new workspace.

01 image38

Fill in the information for the four questions.

01 image39

In step 2, you’ll be asked to "Connect with Google" to get suggestions for people to invite to Slack. to get suggestions for people to invite to Slack.

01 image11

Select the Google account you want to connect and allow it.

01 image12 01 image13

In addition to the suggested team members, you can select and remove other team members.

01 image14

In step 3, you can enter the emails of the users you want to invite to the team. Fill in the information until step 4.

01 image15 01 image16

Verify your Slack team’s channels

You can see that your Slack team workspace has been created.

01 image17 01 image18

Setting up application integration

Browse to Slack - Select the Apps menu.

01 image19

Install the bot

Search for "Bots" in your app and add it to Slack.

01 image20

01 image21

Setting the bot username

Enter a username for the bot and click the 'Add bot integration app' button.

01 image22

Check Bot’s API Token

The bot’s APIToken is a key that is required to integrate with APM. Keep it in mind.

01 image23

Save the Bot integration app

After confirming the API Token, click the Save Integration App button to save it.

01 image24

Confirm Bot user

Go to Slack’s screen - Apps - Bot named 'openmaru_apm' and you can see that a bot has been created.

01 image25

Create a channel to store APM events

Click the Add channel - Create new channel button.

01 image26

Name the channel to create it.

01 image27

Click "Add User" to add all members of the channel or add a specific user.

01 image28

Confirm channel creation

You can see that the channel has been created as shown below.

01 image29

Set up APM events

Connect to APM and click the Settings - System Settings - Events menu.

01 image30

In the Slack section, change the value to the one shown.

01 image31

Item Description

Enabled

Sets whether to use the slack integration.

Set to "TRUE" if you want to receive event notifications.

BotAPIToken

Enter the Bot’s APIToken value.

Channel

Enter the channel name to receive events from the APM created earlier.

Message locale / Message language

If set to kr, ko, it sends Korean messages, and if set to us, en, it sends English messages.

Confirm sending events to the channel in Slack

After restarting the APM server, you can now see APM events sent by the @openmaru_apm bot to the 'openmaru-apm' channel in Slack.

You can add users to the openmaru-apm channel that you want to receive events from.

You’ll be able to receive notifications of Slack events through a variety of clients, including iOS and Android apps, browsers, and Windows applications.

01 image32

By default, you can access Slack through a browser, desktop applications on MacOS, Windows, and Linux, or mobile apps on iOS, Android, and Windows Phone.