prometheus.yml
文件添加GitLab监控目标,如scrape_configs: - job_name: 'gitlab' static_configs: - targets: ['gitlab.example.com']
,在Grafana中添加Prometheus数据源并创建仪表盘展示指标,还可设置告警规则。gitlab-ctl tail
命令查看实时日志,或用cat
命令查看特定日志文件,如/var/log/gitlab/gitlab-rails/production.log
。/etc/gitlab/gitlab.rb
文件,可设置日志目录、切割大小、保留天数等参数,如logging['logrotate_frequency'] = "daily"
等。