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
Ansible で Vector を導入し Slack 通知とログレベル色分けまでした話
Search
Shuma
December 05, 2025
Programming
68
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ansible で Vector を導入し Slack 通知とログレベル色分けまでした話
【LT交流会】 テテミート 大阪#1
Shuma
December 05, 2025
More Decks by Shuma
See All by Shuma
信頼性の目標を誰も求めてない
shubox
0
530
DB移行、油断した瞬間に 肝が冷えた話
shubox
0
70
AIの権限設定に悩んでいる話
shubox
0
71
インフラ深掘りLT
shubox
0
70
飲食店長から_SREになった話
shubox
0
67
阿部寛のホームページをSRE観点で改善出来るか考えてみた。
shubox
1
170
一日の終わりに、晩酌しながら眺めたいシステムログの世界
shubox
1
140
プロダクトがクローズした話
shubox
0
220
今も熱いもの!魂を揺さぶる戦士の儀式:マオリ族のハカ
shubox
0
350
Other Decks in Programming
See All in Programming
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
360
スマート反転とウェブアクセシビリティ
camiha
0
220
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5.1k
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
280
すこし踏み込む CancellationToken
htkym
2
1.3k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
18
18k
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
440
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
460
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
7
5.1k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
580
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
560
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
260
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
370
Designing Experiences People Love
moore
143
24k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Everyday Curiosity
cassininazir
0
330
Optimising Largest Contentful Paint
csswizardry
37
4k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
420
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
410
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
850
Google's AI Overviews - The New Search
badams
0
1.6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Transcript
Ansible で Vector を導入し Slack 通知とログレベル色分けまでした話 1 / 13
自己紹介 名前: Shuma 職種: SRE / インフラエンジニア 興味: IaC, 障害対応,
監視, パフォーマンス改善 最近うれしかったこと 懸賞でカニ当たった!!🦀 Shuma @ShuShuShuBOOOx 文鳥が人生を切り開くのです。 2 / 13
ログ監視、こんな課題ありませんか? 課題 1 手作業でミスが起こりやすい 設定の増減やフィルタ変更が頻繁に発生し、人 的ミスのリスクが高い 課題 2 環境ごとに設定が違う 「この環境だけ設定が違う」問題が頻発し、再現
性がない 課題 3 通知が多すぎて見分けられない 重要度がわからず、すべての通知を同じように 扱ってしまう ↓ Ansible × Vector × Slack で解決! 3 / 13
今日お話しすること 1 Vector とは? 高速・軽量なログ収集ツールの紹介 2 Ansible で自動化 インストールから設定管理まで 3
Slack 通知と色分け ログレベル別に視認性を向上 4 運用してわかったこと 導入効果と学び 4 / 13
SECTION 1 Vector とは? Datadog 社が開発 高速で軽量なログ収集・変換システム YAML で設定 柔軟かつ読みやすい設定ファイル
シンプルな 3段階構成 Sources → Transforms → Sinks VRL で変換処理 Vector Remap Language で柔軟に加工 SOURCES 入力 file, syslog, journald... ↓ TRANSFORMS 変換 filter, remap, aggregate... ↓ SINKS 出力 http, file, elasticsearch... 🔗 vector.dev 5 / 13
SECTION 2 Ansible で Vector を導入 📁 ディレクトリ構成 roles/ vector/
tasks/ main.yml install.yml configure.yml handlers/ main.yml templates/ vector.yaml.j2 group_vars/ all.yml ✨ ポイント 1. validate オプション 設定反映前に構文チェック validate: vector validate --config %s 2. Jinja2 テンプレート 変数で設定を動的生成 src: vector.yaml.j2 3. Handler で再起動 設定変更時のみ自動で反映 notify: Restart Vector 6 / 13
アラート定義を vars で管理 📝 group_vars/all.yml # 有効なアラート一覧 enabled_alerts: [1] name:
app_error level: error [2] name: app_warn level: warn ✓ 不要アラートは行を削除するだけ 🔧 vector.yaml.j2(テンプレート) transforms: {% for alert in enabled_alerts %} filter_{{ alert.name }}: type: filter inputs: ["app_logs"] condition: .level == "{{ alert.level }}" {% endfor %} メリット 1 レビュー可能 メリット 2 履歴が残る メリット 3 再現性◎ 7 / 13
オオカミアラートの排除 🐺 問題:対応不要なログが大量に通知される PHPの不要な例外ログ 対応する必要がないのに通知が来て、本当に重要なアラートが埋もれてしまう 例:よくある除外対象 UserNotFoundException TokenExpiredException ValidationException ↓
除外パターンを Ansible で管理 📝 除外設定のテンプレート化 # group_vars/all.yml exclude_patterns: [1] "UserNotFoundException" [2] "TokenExpiredException" [3] "ValidationException" # vector.yaml.j2 (filter) condition: | !match(.message, r'除外パターン') 8 / 13
SECTION 5 🐺 オオカミアラートの排除 😩 問題 対応不要な PHP 例外ログが Slack
に大量通知 → アラート疲れで本当に重要な通知を見逃すリスク ✅ 解決策 mtail で特定の例外パターンを除外フィルタリング → 本当に対応が必要なアラートのみ通知 📝 除外対象の例 正常系だが例外として出力されるログ ユーザー起因の想定内エラー リトライで自動復旧するエラー Deprecation warning 等の非緊急ログ 12 / 13
SECTION 3 Slack 通知をログレベルで色分け 🎨 色の意味 danger(赤) error / critical
warning(黄) warn good(緑) info 💡 色を見るだけで重要度がわかる 📱 Slack 通知イメージ #alerts [ERROR] Database connection failed [WARN] Memory usage exceeds 80% [INFO] Deployment completed → 「やばいやつ」がすぐわかる! 9 / 13
全体のデータフロー 🖥 アプリサー バー ログ出力 → VECTOR Sources file /
journald → VECTOR Transforms filter + remap → VECTOR Sinks http (Webhook) → 💬 Slack 色分け通知 📦 Ansible Vector インストール ⚙ Jinja2 設定テンプレート生成 🔄 Handler 変更時に自動再起動 入力 変換 出力 10 / 13
SECTION 4 運用してわかったこと 🎯 環境差分がゼロに Ansible 化で「この環境だけ設定が 違う」がなくなった 🔒 設定更新が安全に
PR ベースでレビューできるように なった 🗑 不要アラート削除が楽 vars から1行消すだけで反映され る ⚡ 初動が速くなった Slack の色を見るだけで「やばいや つ」がすぐわかる 「設定をコード化する」ことで、 レビュー・変更履歴・再現性が確保できる 11 / 13
SUMMARY まとめ ✓ Vector は YAML で扱いやすく Ansible と相性◎ ✓
Slack の色分けだけで運用効率が大幅向上 ✓ アラートの vars 管理でスリムな運用を実現 ご清聴ありがとうございました! 質問があればお気軽にどうぞ( ^ω^)・・・ 📚 参考: vector.dev | docs.ansible.com 13 / 13