Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GitLabサーバーのモニタリング / gitlab server monitoring
Search
Teraoka Yoshinori
April 24, 2019
Technology
2.9k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GitLabサーバーのモニタリング / gitlab server monitoring
GitLab server monitoring with Prometheus.
And some server configurations.
Teraoka Yoshinori
April 24, 2019
More Decks by Teraoka Yoshinori
See All by Teraoka Yoshinori
Job に挿入される sidecar を停止させる sidecar を挿入する話
yteraoka
0
200
What is the difference between docker and containerd about logging?
yteraoka
2
1.1k
Prometheus の relabeling
yteraoka
1
19k
Other Decks in Technology
See All in Technology
しろおびから始める!ログ活用の第一歩
shumei_ito
0
560
あなたの知らないAmazon VPC Route Server/Amazon VPC Route Server you don't know about
masakiokuda
2
230
自作バイナリを動かす「入口」8選
puhitaku
1
300
データ品質を壊しながらSnowflakeのAIに分析させてみた
kawanago
0
540
BedrockとLambdaで作る リアルタイム進行型推理ゲーム
kawametho
0
200
不可逆な意思決定を避けながら10億超の顧客データを AI Ready にするデータ基盤設計
baseballyama
1
160
SDDの運用にめげずに向き合った話
sansantech
PRO
1
140
購入ドメインでの課題と取り組み
ykagano
0
150
使いこなすために知っておきたい Azure SRE Agent アンチパターン
torumakabe
2
410
オブザーバビリティを高める AI エージェント体験を考える / Designing AI Agent Experiences That Enhance Observability
aoto
PRO
2
310
AI時代のAPI開発を加速する品質ガードレール / API Quality Guardrails in the AI Era
yokawasa
0
160
私の推しは「聞いてから進む」AIです -AI-DLCに一人でアプリを作らせた話
yama3133
1
180
Featured
See All Featured
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Into the Great Unknown - MozCon
thekraken
41
2.8k
Building an army of robots
kneath
307
47k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
The Curious Case for Waylosing
cassininazir
1
560
Utilizing Notion as your number one productivity tool
mfonobong
4
610
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
480
Six Lessons from altMBA
skipperchong
29
4.5k
Being A Developer After 40
akosma
91
590k
Transcript
GitLabサーバーの モニタリング Yoshinori Teraoka 2019.4.24 GitLab Meetup Tokyo #16 @PLAID
自己紹介 エムスリー株式会社 エンジニアリンググループ SREチーム yteraoka yteraoka
自己紹介 ◀ これ書きました autoscale runner のことはこ れ読めばだいたいわかる https://www.m3tech.blog/entry/advent-calendar-2018-2
エムスリーと GitLab ユーザーの作成日時を見ると 2012年7月~(っぽい) 当然タヌキは昔のやつ 当時はまだ Omnibus package はまだ存在しなかったし、DB は
MySQL だった どこかのタイミングで OS 更新に合わせて Omnibus package に変更 現在のプロジェクト数1200超 GitLab CI, GitLab Pages, Review Apps 使ってます
今日はモニタリングの話
Agenda • Prometheus の活用 • 私の欲しかったもの • gitlab.rb 見てますか?
Prometheus Monitoring GitLab with Prometheus https://docs.gitlab.com/ce/administration/monitoring/prometheus/ GitLab 9.0 以降では有効になっているはず 初期は有効にしていると問題があったので弊社ではながらく無効にしていました
Prometheus Expoters • GitLab monitor exporter ◦ database (:9168/database) ◦
process (:9168/process) ◦ sidekiq (:9168/sidekiq) • Node exporter (:9100/metrics) • Redis exporter (:9121/metrics) • Postgres exporter (:9187/metrics) • Nginx exporter (:8060/metrics) • Gitaly exporter (:9236/metrics) • GitLab Sidekiq exporter (:8082/metrics) • GitLab Workhorse exporter (:9229/metrics) • GitLab Unicorn (:8080/-/metrics)
Grafana Dashboard Grafana Dashboard Repository がある https://gitlab.com/gitlab-org/grafana-dashboards Omnibus package 用
https://gitlab.com/gitlab-org/grafana-dashboards/tree/master/omnibus (でも別にこれ使う必要はないし、必要なものを自分で作ったほうが良い)
Overview Dashboard
コレジャナイ感... Overview だけじゃなくて他にもいくつかあるし、必要なら自分で Dashboard も作れ ば良いのだが、何かあったら見ればよいメトリクスで、 GitLab で普段見る必要がある ようなものではない 私が欲しかったものは
GitLab CI の待ち時間が知りたかった Runner 不足があるなら早く気づいて対処したい (実はまだ autoscale Runner 導入してない) しかし、Job
の状況を確認できるメトリクスが見つからない 無かったら作るしかない
GitLab CI の待ち時間が知りたかった node_exporter には Textfile Collector という機能があり、デフォルトで --collector.textfile.directory=/var/opt/gitlab/node-exporter/textfile_collector というオプションが指定してある
このディレクトリに .prom という拡張子でテキストファイルを置けばメトリクスとして取得 可能になる DB から定期的に取りだしてファイルに書き出すようにしました
GitLab CI の待ち時間が知りたかった こんなのが見れるようになった 赤い横線は Grafana のアラートの閾値
GitLab には Prometheus の alertmanager も含まれているが Grafana でやるとグラフ付きで Slack に送れます
入門 Prometheus 良さそうな本が出るみたいです 2019/05/18 発売 自分の見たい情報は自分で Dashboard 作るのが良い。 Grafana のサイトに共有されているものが参考になる。
モニタリングだけじゃ時間が余りそうなので...
gitlab.rb 見てますか? Omnibus package では /etc/gitlab/gitlab.rb にあり chef を使ったセットアップのための 変数定義がされています。
yum update ではこれは更新されずに新機能はデフォルト値でセットアップされます。 カスタマイズしたい場合は /opt/gitlab/etc/gitlab.rb.template をもとに更新しましょう。 Release note に書かれていない新機能が見つかるはずです。
S3 利用の拡大 利用者が増えるとストレージの容量を気にする必要がでてきますが S3 もしくはその互換ストレージにファイルを保存できるものが増えてます • Backup • LFS •
MergeRequest の diff • Artifacts (CI の生成物保存) • Uploads (Avatar 画像や添付ファイル) • Container registry
Rack Attack かつてデフォルトで有効になっていましたが、オンプレ GitLab の導入理由を考えたらデ フォルトでは無効の方が良かったということでしょう。 インターネットに公開する場合は有効にしましょう。
Unicorn worker killer GitLab には unicorn worker killer が組み込まれています。かつて、この値が弊社環境 には小さすぎたため頻繁に
woker が kill されて遅いという問題がありました。気になる 場合はログを確認して unicorn['worker_memory_limit_min'] unicorn['worker_memory_limit_max'] を調整しましょう。
まとめ • GI の待ち時間を減らしたい ◦ 可視化したので効果も見える ◦ autoscale させるぞ •
gitlab.rb の差分をちょいちょい見ておくと良いですよ • GitLab CI (gitlab-ci.yml) のドキュメントもときどき見直すと発見がある