Source
This guide explains how to connect Gitlab to Watchlog so you can monitor metrics such as Pipelines, Jobs, and Runners.
Prerequisite: Watchlog Agent installed
Make sure the Watchlog Agent is already installed on your server. If it is not installed yet, follow the installation guide first and then return to this page.
Step 1 – Update Watchlog Agent integration config
Tell the Watchlog Agent to monitor Gitlab by updating the integration.json file.
Source
Go to /watchlog-agent, open the integration.json file and update your configuration:
cd /opt/watchlog-agent
vim integration.json
# (Make your changes and save)
Add or update the Gitlab section as follows:
{
"service": "gitlab",
"monitor": true,
"baseUrl": "https://gitlab.com",
"token": "",
"projects": [],
"monitorLogs": true,
"metrics": {"pipelines": true, "jobs": true, "runners": true, "mrs": true, "deployments": true}
}
Note: All integration configurations are stored in this file.
Step 2 – Reload the Watchlog Agent
After saving integration.json, reload the Watchlog Agent with PM2:
pm2 reload watchlog-agent
Step 3 – Verify the integration in Watchlog
- Log in to the Watchlog dashboard.
- Go to the Gitlab integration section.
