This tutorial will show you how to integrate Monika with Google Chat using Google Chat webhook so that you can get your Monika notifications through your Google Chat.
To create your Google Chat webhook, you need to create a space. Go to the Google Chat page, and navigate to the bottom-left part of the page. In the “Spaces” section, click the plus icon and click Create Space. Fill out the space details and then click Create.
After you created a new space, click the menu icon on the top-right of the page to minimize the sidebar. Then, click your space’s name and select the Manage Webhook menu.
It should display a new popup to create a new incoming webhook. Fill out the incoming webhooks name and avatar URL (which is optional), and then click Save. Copy the webhook URL into somewhere else, as we are going to use it later.
Now that we have our Google Chat Webhook URL and installed Monika, it’s time to create a configuration called monika.yml
:
notifications:- id: unique-id-webhooktype: google-chatdata:url: <YOUR_GOOGLE_CHAT_WEBHOOK_URL>probes:- id: google_chat_testname: Google Chat Testdescription: Google Chat Notification Channel Testinterval: 10requests:- method: GETurl: https://reqres.in/api/usersalerts:- query: response.status != 200message: Status code is not 200- query: response.time > 500message: Request took more than half a second
Let me explain a little bit about this configuration:
notifications
object. There are 3 properties: id
, type
, and data
. Set the id
to any string values, as it is just an identifier. Then, set the type
field to google-chat
to set the notification channel to Google Chat. After that, put your Google Chat Webhook URL into the data.url
field.Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using monika -c monika.yml
Congratulations! Now that you have successfully integrated Monika with Google Chat.
PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.
Copyright © 2024 Hyperjump Tech. All Rights Reserved.