Get Started
Welcome to Watchlog! Follow these steps to sign up, configure, and install the Agent on your environment:
1. Sign up for an account
Go to watchlog.io and click Sign Up. Fill in your details and verify your email to create your Watchlog account.
2. Copy API Key and Server URL
After logging in, navigate to Hosts and click an existing host or create a new one. Copy your API Key and note your Server URL from the host details page.
3. Install the Watchlog Agent
Ubuntu
sudo apiKey="<API-Key>" server="<Server>" bash -c "$(curl -L https://watchlog.io/ubuntu/watchlog-script.sh)"
1. Stop Agent
sudo pm2 stop watchlog-agent
1. Start Agent
sudo pm2 start watchlog-agent
1. delete Agent
sudo pm2 delete watchlog-agent
Windows
$wl_apiKey="<API-Key>"
$wl_server="<Server>"
iwr https://watchlog.io/windows/install-watchlog.ps1 -OutFile "$env:TEMP\install-watchlog.ps1"
powershell -ExecutionPolicy Bypass -File "$env:TEMP\install-watchlog.ps1" -apiKey $wl_apiKey -server $wl_server
Docker
Step 1: Create integration.json
Create a file named integration.json with your integrations:
[
{
"service": "docker",
"monitor": true
},
{
"service": "postgresql",
"monitor": false,
"host": "127.0.0.1",
"port": "5432",
"username": "postgres",
"password": "",
"database": []
},
{
"service": "mysql",
"monitor": false,
"host": "127.0.0.1",
"port": "3306",
"username": "root",
"password": "",
"database": []
},
{
"service": "redis",
"monitor": false,
"host": "127.0.0.1",
"port": "6379",
"password": ""
},
{
"service": "mongodb",
"monitor": false,
"host": "127.0.0.1",
"port": "27017",
"username": "",
"password": ""
},
{
"service": "nginx",
"monitor": false,
"accessLog": "/var/log/nginx/access.log"
}
]
Step 2: Run the Agent container
docker run -d \
--name watchlog-agent \
--network host \
-v /path/to/integration.json:/app/app/config/integration.json \
-e WATCHLOG_APIKEY="<API-Key>" \
-e WATCHLOG_SERVER="<Server>" \
watchlog/agent:latest
Note: All integrations are configured in the integration.json file. Set "monitor": true for services you want to monitor. You only need to provide WATCHLOG_APIKEY and WATCHLOG_SERVER as environment variables.
Optional: Using Docker Volume
You can also use a Docker volume for persistent configuration:
# Create volume
docker volume create watchlog-agent-config
# Copy your integration.json to the volume
docker run --rm \
-v watchlog-agent-config:/data \
-v /path/to/integration.json:/source/integration.json \
alpine cp /source/integration.json /data/integration.json
# Run container
docker run -d \
--name watchlog-agent \
--network host \
-v watchlog-agent-config:/app/app/config \
-e WATCHLOG_APIKEY="<API-Key>" \
-e WATCHLOG_SERVER="<Server>" \
watchlog/agent:latest
Kubernetes
Step 1: Create namespace
kubectl create namespace monitoring
Step 2: Create integration.json ConfigMap
Create a file named integration.json:
[
{
"service": "docker",
"monitor": true
},
{
"service": "postgresql",
"monitor": false,
"host": "127.0.0.1",
"port": "5432",
"username": "postgres",
"password": "",
"database": []
}
]
Create the ConfigMap:
kubectl create configmap watchlog-config \
--from-file=integration.json=/path/to/integration.json \
-n monitoring
Step 3: Deploy the Agent
Save the following manifest as watchlog-node-agent.yaml and apply:
apiVersion: v1
kind: ServiceAccount
metadata:
name: watchlog-node-agent
namespace: monitoring
automountServiceAccountToken: true
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: watchlog-node-agent-role
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get"]
- apiGroups: [""]
resources: ["pods", "namespaces"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: watchlog-node-agent-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: watchlog-node-agent-role
subjects:
- kind: ServiceAccount
name: watchlog-node-agent
namespace: monitoring
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: watchlog-node-agent
namespace: monitoring
spec:
selector:
matchLabels:
app: watchlog-node-agent
template:
metadata:
labels:
app: watchlog-node-agent
spec:
serviceAccountName: watchlog-node-agent
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: agent
image: watchlog/watchlog-node-agent:latest
imagePullPolicy: Always
ports:
- containerPort: 3774
hostPort: 3774
env:
- name: WATCHLOG_APIKEY
value: "<API-Key>"
- name: WATCHLOG_SERVER
value: "<Server>"
volumeMounts:
- name: config
mountPath: /app/app/config
readOnly: true
tolerations:
- operator: Exists
volumes:
- name: config
configMap:
name: watchlog-config
- name: docker-sock
hostPath:
path: /var/run/docker.sock
Apply the manifest:
kubectl apply -f watchlog-node-agent.yaml
Note: All integrations are configured in the integration.json ConfigMap. Set "monitor": true for services you want to monitor.
5. Verify Your Host Status
Return to the Hosts list. Within a minute, your host should appear Online with live metrics.
6. Explore Integrations & Alerts
Enable integrations like Nginx, MongoDB, Redis under Integrations, and set up thresholds in Alerts to get notified on critical events.
You’re all set! Navigate the sidebar for advanced guides on APM, Custom Dashboards, and more.
