Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
GitLab x Prometheus -Application Performance-
Shingo.Kitayama
November 17, 2017
Technology
0
67
GitLab x Prometheus -Application Performance-
2017/11/17
GitLab Meetup Tokyo #5
https://gitlab-jp.connpass.com/event/69475/
Shingo.Kitayama
November 17, 2017
Tweet
Share
More Decks by Shingo.Kitayama
See All by Shingo.Kitayama
Kubernetes CICD Pipelines Book
shkitayama
1
1.3k
Shipwright Overview
shkitayama
0
840
CloudNative CICD in OpenShift Commons Japan
shkitayama
5
8.5k
The State of Container Security in Red Hat Experience
shkitayama
2
330
OperatorLifecycleManager 101
shkitayama
5
1.6k
OpenShift Monitoring - 自律化したPrometheus運用 -
shkitayama
5
1.9k
JTF-B30: Container by default -Kubernetesがまだ浸透しない日本を変える取り組み-
shkitayama
3
1.1k
Introduction of OpenDataHub
shkitayama
2
410
Change the Game, Change the World
shkitayama
7
4.7k
Other Decks in Technology
See All in Technology
New Features in C# 10/11
chack411
0
410
We’re all on the path of growth 🌱
mosky
1
350
tfcon-2022-cpp
cpp
5
4.1k
Nutanix_Meetup_20220511
keigotomomatsu
0
130
Power BIのモバイルと都 +1 / Tokyo
ishiayaya
0
130
OSINT/GEOINT ワークショップ 20220514 古橋資料
furuhashilab
2
200
AWSの基礎を学ぼうで学んだ9種類のDBを勝手にふりかえる
98lerr
1
690
AWS全体のセキュリティ管理と快適なセキュリティ運用
cmusudakeisuke
2
10k
組織でPower Virtual Agentsを導入するために知っておきたいこと
miyakemito
0
1.3k
Steps toward self-service operations in eureka
fukubaka0825
0
350
SRE_チーム立ち上げから1年_気づいたら_SRE_っぽくない仕事まで貢献しちゃってる説
bitkey
PRO
0
1.3k
Power BI Report Ops
hanaseleb
0
140
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
253
11k
Fantastic passwords and where to find them - at NoRuKo
philnash
25
1.4k
Testing 201, or: Great Expectations
jmmastey
21
5.4k
Practical Orchestrator
shlominoach
178
8.6k
Stop Working from a Prison Cell
hatefulcrawdad
261
17k
Building Applications with DynamoDB
mza
83
4.6k
Unsuck your backbone
ammeep
659
55k
Learning to Love Humans: Emotional Interface Design
aarron
261
37k
The Most Common Mistakes in Cover Letters
jrick
PRO
4
24k
How New CSS Is Changing Everything About Graphic Design on the Web
jensimmons
212
11k
A Tale of Four Properties
chriscoyier
149
20k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
655
120k
Transcript
GitLab x Prometheus デプロイアプリのPerformance測定 Shingo.Kitayama 2017/11/17 GitLab Meetup Tokyo #5
https://gitlab-jp.connpass.com/event/69475/
Introduction GitLab x Prometheus 2 日本ヒューレット・パッカード株式会社 テクニカルアーキテクト ・オープンソースソリューションの提案 ・コンサルティング、および構築デリバリーを担当 Now
on Sale
Introduction ITmediaエンタープライズ 連載中 3 変化を拒むおっさんに 喝をいれる連載 執筆中!! お仕事の息抜き&気分転換に ご覧ください。
本日のIndex GitLab x Prometheus 4 1. とりあえず理解するPrometheus 2. GitLabとPrometheusの連携 3.
アプリパフォーマンス監視
1. とりあえず理解するPrometheus 5 - What’s Prometheus -
Prometheusとは オープンソースの軽量サービス監視ツール 6 https://qiita.com/tnir/items/7dd63b7baa4299135194 パフォーマンスデータの収集やグラフの表示、アラートなどの通常監視機能に加え、クエリを利用して、CPUの負荷やメモリ、 ストレージの利用率、HTTPのレイテンシなどのメトリクスを計算しグラフ化することも可能。 - Pull型監視 - 監視対象
Prometheus 管理サーバ側から管理対象に情報をリクエストし、ステータスを収集する方法。監視対象を完全にコントロールできる 反面、監視対象ホストが増えるたびに管理サーバの設定ファイルを更新する必要があります。 情報収集 リクエスト
Prometheusの仕組み Prometheus Architecture 7 監視対象 Prometheus Server Retrieval PromQL ローカル
ストレージ Storage 監視対象プロセス Exporter 情報収集 リクエスト ジョブプログラム PushGateway リクエスト 情報収集 情報送信 Alert manager Web UI ・ Grafana ・ API Client アラート送信 mail slack web hook Expression Browser 『メトリクスの収集/格納』 『アラートの通知』 『クエリの返答』
Prometheus Exporters メトリクスの収集 8 監視対象 node exporter mysqld exporter mysql
監視対象 既存の監視メトリックをPrometheusメトリックとしてエクスポートするのに役立つライブラリ。 http://target.local:9100/metrics - job_name: node static_configs: - targets: - ":9100" Prometheus Server
2. GitLabとPrometheusの連携 9 - Prometheus within GitLab -
GitLabにおけるPrometheusの用途 Omnibus GitLabに付随しているPrometheusはGitLab管理用途 10 GitLabのプロセスステータス管理用Prometheus GitLabでデプロイしたアプリの パフォーマンス測定用Prometheus Omnibus GitLabに付随しているPrometheusでは、GitLab上で利用するプロセスのステー タスチェックを行う。
個別にExporterを用意することによって、Environmentに配置したアプリケーションのパフォー マンスチェックを動的に行う。
GitLabのプロセスステータス管理用Prometheus Exporters for Process Status 11 Exporters ステータス内容 ポート Node
exporter メモリ、ディスク、CPU使用率などのマ シンリソースの測定 localhost:9100 Redis exporter Redisプロセスのリソース測定 localhost:9121 Postgres exporter ProstgreSQLプロセスのリソース測定 localhost:9187 GitLab monitor exporter DatabaseやGit、SidekiqなどのGitLab に関するリソース測定 localhost:9168
GitLabのプロセスステータス管理用Prometheus http://gitlab.example.com/-/metrics?token=$token_id 12
GitLabでデプロイしたアプリのパフォーマンス測定用Prometheus サポートメトリクス 13 Exporters Support Metric Kubernetes Average Memory Usage
(MB) Average CPU Utilization (%) NGINX VTS exporter Throughput (req/sec) Latency (ms) HTTP Error Rate (HTTP Errors / sec) NGINX Ingress Controller Throughput (req/sec) Latency (ms) HTTP Error Rate (HTTP Errors / sec) HAProxy Throughput (req/sec) HTTP Error Rate (%) Amazon Cloud Watch Throughput (req/sec) Latency (ms) HTTP Error Rate (%)
3. アプリパフォーマンス監視 14 - Performance Monitoring -
アプリケーションデプロイメント Sample Application 15
Application構成 デプロイメント構成 16 Docker Engine Prometheus Server GitLab 情報収集 リクエスト
http://haproxy:8080/admin?stats HAProxy Exporter http://gitlab-runner01:9101/metrics HAProxy Tomcat ユーザー アクセス - job_name: review-develop-33z241 static_configs: - targets: - gitlab-runner01:9101 relabel_configs: - source_labels: - job target_label: environment
Demo 17 でも(時間があったら
Environment Monitoring $CI_ENVIRONMENT_SLUG 18 Environment = $CI_ENVIRONMENT_SLUG
19 Thank you