PyCon  APAC  2013
Pythonと
DataDogを
使って簡単な
システムモニターリング
13年9月15日日曜日
Engineering Advice
You are only as smart as
the average
of the top 5 people
you hang out with.
by Gene Kim
13年9月15日日曜日
Engineering Advice
You are only as smart as
the average
of the top 5 people
you hang out with.
by Gene Kim仲
間
を
巻
き
込
ん
で
学
ぼ
う
!
13年9月15日日曜日
http://www.flickr.com/photos/sk8geek/4959759309/
興味のあることは、
質問して下さい!
13年9月15日日曜日
Visualize
&
Display
13年9月15日日曜日
•Collection
•Correlation
•Collaboration
Keywords
13年9月15日日曜日
例例えば:
開発/運⽤用している場所に
監視⽤用モニターが設置されている!
13年9月15日日曜日
page-14: 9-11
”謝辞”
CMSコミュニケーションズの寺田さん(@terapyon)と
掘⽥田さん(@jhotta)
13年9月15日日曜日
page-14: 9-11
”謝辞”
CMSコミュニケーションズの寺田さん(@terapyon)と
掘⽥田さん(@jhotta)堀⽥田
13年9月15日日曜日
13年9月15日日曜日
DevOps
The (Short) History of DevOps:
http://www.youtube.com/watch?v=o7-IuYS0iSE
13年9月15日日曜日
DevOps  is  an  enterprise  
capability  for  continuous    
(software)  service  delivery  that  
enables  clients  to  seize  market  
opportunities  and  reduce  time  
to  customer  feedback.
by  IBM
13年9月15日日曜日
CI & CD
Puppet, Chef
Log Analysis
Monitoring
Metrics Management
Corporate culture
Communication
13年9月15日日曜日
できるなら、
開発に専念念したい!
13年9月15日日曜日
DBへのクエリーの
正常動作の閾値は?
13年9月15日日曜日
監視に係る⼿手間は、
最⼩小限!
13年9月15日日曜日
監視に係る⼿手間は、
最⼩小限!
13年9月15日日曜日
でも!
本業開発じゃないし〜~。
構築がめんださ〜~い!
表⽰示画⾯面汚いし〜~、
アラート成るまで
画⾯面⾒見見たこと無いよね。
13年9月15日日曜日
どうする?
13年9月15日日曜日
13年9月15日日曜日
Pythonベースで
サービスを企画/開発。
↓
Python周りの
Toolsが充実&安定!
http://www.publickey1.jp/blog/12/devops_3.html この時移、システムの説明もされていた。
13年9月15日日曜日
http://www.youtube.com/embed/7RhKDTxybEE?
国内での有償利利⽤用実績
ITを使って
依頼者と翻訳者の
マッチング
13年9月15日日曜日
提供:  gengo
13年9月15日日曜日
5ホストまで無料料!
13年9月15日日曜日
5ホストまで無料料!
13年9月15日日曜日
5ホストまで無料料!
13年9月15日日曜日
http://www.datadoghq.com/product/
13年9月15日日曜日
Integrations
13年9月15日日曜日
dogstatsd-python
13年9月15日日曜日
13年9月15日日曜日
13年9月15日日曜日
無料料アカウントへは、
登録している前提で!
13年9月15日日曜日
Docs(http://docs.datadoghq.com/)
13年9月15日日曜日
Datadog agent install(https://app.datadoghq.com/account/settings#agent)
13年9月15日日曜日
Datadog agent install(https://app.datadoghq.com/account/settings#agent)
$ DD_API_KEY=c81dc7fbacbfca8c9e4f1c02d439f112 bash -
c "$(wget -qO- http://dtdg.co/agent-install-ubuntu)"
$ sudo sh -c "echo 'deb http://apt.datadoghq.com/ unstable
main' > /etc/apt/sources.list.d/datadog.list"
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-
keys C7A7DA52
$ sudo apt-get update
$ sudo apt-get install datadog-agent
$ sudo sh -c "sed 's/api_key:.*/api_key:
c81dc7fbacbfca8c9e4f1c02d439f112/' /etc/dd-agent/
datadog.conf.example > /etc/dd-agent/datadog.conf"
$ sudo /etc/init.d/datadog-agent start
13年9月15日日曜日
提供:  gengo
13年9月15日日曜日
提供:  gengo
13年9月15日日曜日
Send Apps Metrics 1(http://docs.datadoghq.com/guides/metrics/)
$ easy_install dogstatsd-python
13年9月15日日曜日
Send Apps Metrics 2(http://docs.datadoghq.com/guides/metrics/)
✓Counters(function)
✓Gauges(function)
✓Histograms(function)
✓Sets(function)
✓Tags(variable)
✓Sample Rates(variable)
13年9月15日日曜日
Send Apps Metrics 3(http://docs.datadoghq.com/guides/metrics/)
# Counter
from statsd import statsd
def render_page():
""" Render a web page. """
statsd.increment('web.page_views')
return 'Hello World!'
13年9月15日日曜日
Send Apps Metrics 4(http://docs.datadoghq.com/guides/metrics/)
# Gauges
from statsd import statsd
def get_free_memory()
...
return free_memory
while True:
statsd.gauge('system.mem.free', get_free_memory())
time.sleep(10)
13年9月15日日曜日
Send Apps Metrics 5(http://docs.datadoghq.com/guides/metrics/)
# Histograms
from statsd import statsd
@statsd.timed('database.query.time')
def get_data():
return db.query()
13年9月15日日曜日
Send Apps Metrics 6(http://docs.datadoghq.com/guides/metrics/)
# Sets
from statsd import statsd
def login(self, user_id):
# Log the user in ...
statsd.set('users.uniques', user_id)
13年9月15日日曜日
Send Events 1(http://docs.datadoghq.com/api/)
$ easy_install dogapi
13年9月15日日曜日
Send Events 2(http://docs.datadoghq.com/api/)
✓title [required] The event title.
✓text [required] The body of the event.
✓date_happened [optional, default=now] POSIX timestamp of the event.
✓priority [optional, default='normal'] The priority of the event ('normal' or 'low').
✓tags [optional, default=None] A list of tags to apply to the event.
✓alert_type [optional, default='info'] "error", "warning", "info" or "success"
✓aggregation_key [optional, default=None] An arbitrary string to use for aggregation.
✓source_type_name [optional, default=None] The type of event being posted.
(Options: nagios, hudson, jenkins, user, my apps, feed, chef, puppet, git, bitbucket, fabric, capistrano)
13年9月15日日曜日
Send Events 3(http://docs.datadoghq.com/api/)
from dogapi import dog_http_api as api
api.api_key = 'your datadog api key'
api.application_key = 'your datadog api application key'
title = 'PythonとDatadogで簡単にシステム監視”
text = 'PyCon 満員御礼!'
tags = ['version:1', 'application:web']
api.event_with_response(title, text, tags=tags)
13年9月15日日曜日
ここらの作業は
APIでもできるけど
今回は⼿手作業!
13年9月15日日曜日
13年9月15日日曜日
13年9月15日日曜日
TimeBorad:  
状況の解析を⽬目的としているため、URLのアクセスにはloginが必要。
ScreenBorad:
状況のシェアを⽬目的としているため、loginをしなくても表⽰示。
13年9月15日日曜日
http://player.vimeo.com/video/68172585?autoplay=1
13年9月15日日曜日
TV de 表示
Raspberry  piでも充分!
(TVのbrowserでもOKかも?)
http://www.triggeredmessaging.com/blog/server-‐‑‒monitoring-‐‑‒with-‐‑‒a-‐‑‒raspberry-‐‑‒pi-‐‑‒and-‐‑‒graphite
http://raspberrypi.stackexchange.com/questions/2059/disable-‐‑‒screen-‐‑‒blanking-‐‑‒in-‐‑‒x-‐‑‒windows-‐‑‒on-‐‑‒raspbian
13年9月15日日曜日
約3500円∼
http://www.raspberrypi.org/
Raspberry pi
13年9月15日日曜日
変更成果の可視化
例例)x100  PostgressSQL  コード変更更
応答時間 cpu負荷
13年9月15日日曜日
例例)同⼀一H/WのEC2インスタンスの
cpu・オーバーコミットの影響
リスク要素の可視化
13年9月15日日曜日
KPIの可視化
DevOps 的視点(例)
1.ディプロイ回数
2.ディプロイスピード
3.ディプロイの成功率
4.ディプロイの失敗時のリカバリー時間
5.その他(企業文化など…)
13年9月15日日曜日
KPIの可視化
Lean Start Up 的視点(例)
検証
仮説
メトリックス設計
(AARRR等)
data  collection
↓
correlation  (⽐比較  )
graphing  (グラフ化)
13年9月15日日曜日
まとめ
• 監視のためのインフラには手間を掛けず、監
視の内容と情報共有に手間をかける。
• Datadogなら、pythonで簡単に高度な計測値収
集が始める。
• 監視用モニターを設置し、各種の情報を集中
して表示。
• ”百聞は一見にしかず”、改善案や異常検知は
日常的に監視結果を見ることから。
13年9月15日日曜日
DevOps  Day  Tokyo  2013  来⽇日決定!
9/28
13年9月15日日曜日
おまけ
gengo APIで翻訳
”Sgin up now!”
13年9月15日日曜日
おまけ
gengo APIで翻訳
”Sgin up now!”“今でしょ!”
13年9月15日日曜日
質問?
13年9月15日日曜日

Pythonと DataDogを 使って簡単な システムモニターリング (Pycon apac 2013)