Giám sát
Nền tảng phân tích và giám sát với giao diện bảng điều khiển đẹp mắt để trực quan hóa các chỉ số.
Truy vấn Prometheus, InfluxDB, Elasticsearch, MySQL, PostgreSQL, CloudWatch và hơn 100 nguồn khác
Thư viện trực quan hóa phong phú với biểu đồ, đồng hồ đo, heatmap, bảng và panel tùy chỉnh
Cảnh báo linh hoạt qua Slack, PagerDuty, email, webhook và nhiều kênh khác
Truy vấn ad-hoc và khám phá log với trình xây dựng truy vấn trực quan
Bảng điều khiển động thích ứng với các môi trường và bộ lọc khác nhau
Hệ sinh thái plugin phong phú cho nguồn dữ liệu, panel và ứng dụng
# Add APT repository
sudo apt-get install -y apt-transport-https software-properties-common
sudo wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
# Install
sudo apt-get update
sudo apt-get install grafana
# Start service
sudo systemctl start grafana-server
sudo systemctl enable grafana-server
# Access at http://localhost:3000
# Default login: admin/adminCài đặt bằng Docker:docker run -d --name=grafana -p 3000:3000 \
-v grafana-storage:/var/lib/grafana \
grafana/grafana-oss:latestDocker Compose (với Prometheus):version: '3'
services:
grafana:
image: grafana/grafana-oss:latest
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_INSTALL_PLUGINS=grafana-clock-panel
volumes:
- grafana-data:/var/lib/grafana
prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
volumes:
grafana-data:
prometheus-data:
[server]
http_port = 3000
domain = grafana.yourdomain.com
root_url = https://grafana.yourdomain.com
[database]
type = postgres
host = localhost:5432
name = grafana
user = grafana
password = password
[security]
admin_user = admin
admin_password = secure_password
[smtp]
enabled = true
host = smtp.gmail.com:587
user = your-email@gmail.com
password = your-app-password
from_address = grafana@yourdomain.comThêm nguồn dữ liệu Prometheus (API):curl -X POST http://admin:password@localhost:3000/api/datasources \
-H "Content-Type: application/json" \
-d '{
"name": "Prometheus",
"type": "prometheus",
"url": "http://localhost:9090",
"access": "proxy",
"isDefault": true
}'Dashboard JSON (dashboard CPU đơn giản):{
"dashboard": {
"title": "CPU Monitoring",
"panels": [{
"title": "CPU Usage",
"type": "graph",
"targets": [{
"expr": "100 - (avg(irate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)"
}]
}]
}
}Thực hành tốt nhất:Bắt đầu trong vài phút với quá trình triển khai VPS đơn giản của chúng tôi
Được triển khai trong khoảng 2 phút • Truy cập root đầy đủ • Hỗ trợ bằng vé và email