Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CircleCI_Serverの利用状況を可視化した話 / CircleCI Server ...
Search
dehio3
August 23, 2019
Technology
0
870
CircleCI_Serverの利用状況を可視化した話 / CircleCI Server Visualization of usage status
CircleCI ユーザーコミュニティミートアップ 【LT会】
https://circleci.connpass.com/event/140666/
dehio3
August 23, 2019
Tweet
Share
More Decks by dehio3
See All by dehio3
とっ散らかったログバケットを S3バッチオペレーションで整理整頓 / Organizing disordered log buckets using S3 Batch Operations
tomohide_tanaka
0
220
40代エンジニアの生活の変化とキャリアの歩み
tomohide_tanaka
0
1.3k
AWSソリューションを活用して 1ヶ月で動画配信機能をリリースした話 / The story of releasing the Video distribution service in one month using AWS solutions
tomohide_tanaka
1
1.4k
GitHub Actionsで Terraformをplan&applyしてみた / I tried to plan and apply Terraform with GitHub Actions
tomohide_tanaka
6
6k
CircleCI Server運用のポイント / Point of CirlceCI Server operation
tomohide_tanaka
1
620
Other Decks in Technology
See All in Technology
生成AIで小説を書くためにプロンプトの制約や原則について学ぶ / prompt-engineering-for-ai-fiction
nwiizo
4
1.9k
Fabric + Databricks 2025.6 の最新情報ピックアップ
ryomaru0825
1
140
PHP開発者のためのSOLID原則再入門 #phpcon / PHP Conference Japan 2025
shogogg
4
770
PHPでWebブラウザのレンダリングエンジンを実装する
dip_tech
PRO
0
200
MySQL5.6から8.4へ 戦いの記録
kyoshidaxx
1
220
Oracle Cloud Infrastructure:2025年6月度サービス・アップデート
oracle4engineer
PRO
2
250
Understanding_Thread_Tuning_for_Inference_Servers_of_Deep_Models.pdf
lycorptech_jp
PRO
0
120
AIのAIによるAIのための出力評価と改善
chocoyama
2
560
Javaで作る RAGを活用した Q&Aアプリケーション
recruitengineers
PRO
1
110
Uniadex__公開版_20250617-AIxIoTビジネス共創ラボ_ツナガルチカラ_.pdf
iotcomjpadmin
0
160
SalesforceArchitectGroupOsaka#20_CNX'25_Report
atomica7sei
0
170
Wasm元年
askua
0
140
Featured
See All Featured
For a Future-Friendly Web
brad_frost
179
9.8k
Optimizing for Happiness
mojombo
379
70k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.3k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Thoughts on Productivity
jonyablonski
69
4.7k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.6k
Visualization
eitanlees
146
16k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Transcript
CircleCI Serverの 利用状況を可視化した話 CircleCI ユーザーコミュニティミートアップ #6
自己紹介 Tanaka Tomohide • twitter: @dehio3 • blog:https://www.dehio3.com/ • 音響屋→インフラエンジニア
• CircleCI運用歴:10ヶ月 2
はじめに 3
注意 Workflow、OrbsなどCircle機能の話は 一切出ません!! (そもそもオンプレはOrbs対応してない) 4
CircleCI Serverの 利用状況を可視化した話
CircleCI Serverとは • オンプレミス版のCircleCI • AWS上で利用可能 • 構築用のTerraformが提供 ◦ https://github.com/circleci/enterprise-setup
6
可視化の背景 7
顧客からこんな依頼が 「チーム毎での利用比率を取れない?」 8
なぜ? • ライセンス費は年払い • ユーザー数分ライセンス費がかかる • 利用してるチーム毎に予算を振り分けたい 9
こんなものを作った 10
CircleCIコスト按分ダッシュボード 11
構成 12
lambda + S3 + Athena + Redash 13
ポイント • APIを利用し日次でビルド情報を収集 • AthenaでJSONデータをテーブル化 • Redashにてテーブルデータを可視化 14
ポイント • APIを利用し日次でビルド情報を収集 • AthenaでJSONデータをテーブル化 • Redashにてテーブルデータを可視化 15
APIの選択 / resent-builds API実行時から指定のビルド情報を取得 16
https://circleci.com/docs/api/#recent-builds-across-all-projects
APIの選択 / limitパラメータ • マニュアルでは「Maixmum 100」とあるがオンプレ は制限なし? • limitを大きめの5000にして、取りこぼしのないよう にビルド情報を取得
17
ビルド日時の判断 • ビルド情報を集計する時に日付の判断が必要 • 「queued_at」からビルドの実施日を判断 • 実施日毎でJSONファイルを作成 "queued_at" : "2013-02-12T21:33:30Z"
// time build was queued "start_time" : "2013-02-12T21:33:38Z", // time build started "stop_time" : "2013-02-12T21:34:01Z", // time build finished 18
JSONファイルの管理 作成したJSONファイルはS3で管理 19
ポイント • APIを利用し日次でビルド情報を収集 • AthenaでJSONデータをテーブル化 • Redashにてテーブルデータを可視化 20
JSON用ライブラリでのテーブル作成 CREATE EXTERNAL TABLE circleci_buids_data ( username string, // GitHubのorganization
build_url string, status string, // ビルドのステータス queued_at timestamp, start_time timestamp, stop_time timestamp, build_time_millis int // ビルド走行時間 ) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' LOCATION 's3://<バケット名>/' 21
そのままテーブルを参照するとエラー 日付の取得でERRORが発生する Error running query: HIVE_BAD_DATA: Error parsing field value
'2019-04-11T14:45:00.417Z' for field 3: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff] 22
テーブル作成時はstring型 ”Athena は、Java の TIMESTAMP 形式「YYYY-MM-DD HH:MM:SS.fffffffff」 (小数点以下 9 桁)
を必要とします。 データが必須の TIMESTAMP 形式でない場合は、列を STRING として定義し、次に Presto の日付と時刻の関数を使用してフィー ルドを DATE または TIMESTAMP としてクエリ内に読み取りま す。” https://aws.amazon.com/jp/premiumsupport/knowledge-center/query-table-athena- timestamp-empty/ 23
最終的なテーブル作成クエリ CREATE EXTERNAL TABLE circleci_buids_data ( username string, // GitHubのorganization
build_url string, status string, // ビルドのステータス queued_at string, start_time string, stop_time string, build_time_millis int // ビルド走行時間 ) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' LOCATION 's3://<バケット名>/' 24
ポイント • APIを利用し日次でビルド情報を収集 • AthenaでJSONデータをテーブル化 • Redashにてテーブルデータを可視化 25
string型をtimestamp型に変換 “注意: データが ISO 8601 形式である場合は、操作を進める前に from_iso8601_timestamp() 関数を使用してデータを TIMESTAMP に変換してください。”
https://aws.amazon.com/jp/premiumsupport/knowledge-center/query-table-athena- timestamp-empty/ 26
string型をtimestamp型に変換 from_iso8601_timestamp関数を使用して、参照時にtimestamp型に 変換 SELECT queued_at, typeof(queued_at) as "type", from_iso8601_timestamp(queued_at) as
"queued_at timestamp", typeof(from_iso8601_timestamp(queued_at)) as "type" FROM circleci_buids_data; 27
Redash上でのクエリ 28 https://github.com/kakakakakku/redash-hands-on
CircleCIコスト按分ダッシュボード 29
こんなデータも可視化 30
日毎のOrganization別ビルド数 31
曜日別、時間帯別ビルド数 32
ビルドステータス推移(success以外) 33
まとめ 34
まとめ 35 • APIを使って簡単にビルド情報が取れる • AthenaとBIツールでJSONデータを簡単に可視化 できる • ビルド状況の可視化する事で、チームの活動状 況を把握する事ができる
Thank you!! 36