Stackdriver Introduction
GCPUG Admin
Google Developers Expert
Mercari / Merpay Solution Team
@sinmetal
https://gcpug.jp
2
https://gcpug.jp
Stackdriver Services
3
https://gcpug.jp
Stackdriver Monitoring
https://gcpug.jp
What’s Stackdriver Monitoring
5
https://gcpug.jp
Monitoring Demo
6
個人的に便利だなーと思うのは、Cloud StorageのBucketごとのStorage Sizeを見れること
https://gcpug.jp
Alert Demo
7
https://gcpug.jp
8
https://gcpug.jp
Uptime Check
9
それぞれ、レイテンシも教えてくれる
https://gcpug.jp
Monitoring : Price
10
GCEのCPUなどのGCPが自動で出力するmetricsは無料なので、Monitoring AgentやCustom Metricsを使わない限りは、さほどお金はかからない
https://gcpug.jp
Stackdriver Loggingと
Error Reporting
https://gcpug.jp
What’s Stackdriver Logging
12
https://gcpug.jp
Logging : Price
13
GCPの中で最も高いと言ってもいいんじゃないかと思うぐらい高い!!
なので、リアルタイムに見る必要がないログは、除外設定とExportを組み合わせてBigQueryなどに退避しよう
https://gcpug.jp
ExportとIngestion
14
https://gcpug.jp
ExportとIngestion Demo
15
Exclusionsの設定はいつでもEnable/Dissbleを切り替えれるので、リリース時はDisableにしておいて、落ち着いたらEnableにすることも可能
Blogにも書いてあるので、見てみてね
https://gcpug.jp
16
https://gcpug.jp
Stackdriver Error Reporting
17
https://gcpug.jp
Stackdriver Error Reporting
18
https://gcpug.jp
Error Reporting : Price
19
https://gcpug.jp
Application Performance Management
https://gcpug.jp
21
https://gcpug.jp
22
Requestの中で、Datastore, Vision API, Functionを使っている時に、2秒かかっている。
この時、どこにどれだけ時間がかかっている?というのをトレースし続けることができる
https://gcpug.jp
Stackdriver Trace
23
レイテンシ計測したいところで、StartSpanする
func (d *dqnImpl) Prediction(ctx context.Context, body *Payload) (*Answer, error) {
ctx, span := trace.StartSpan(ctx, "/dqn")
defer span.End()
https://gcpug.jp
Stackdriver Trace
24
https://gcpug.jp
多段でトレースすることもできる
25
App EngineのRequestのTraceIDをFunctionに渡せば、FunctionからのDatastore, Storageのアクセスも一緒に出てくる
https://gcpug.jp
Traceのタイミング
26
https://gcpug.jp
Trace : Price
27
サンプリングして送られるので、ほとんど料金はかからない
https://gcpug.jp
28
sinmetalはソースコードをうまいこと噛み合わせる設定を入れるのがめんどうだなと思って、使ったことがない...
https://gcpug.jp
Debugger : Price
29
https://gcpug.jp
30
https://gcpug.jp
Stackdriver Profiler
31
https://gcpug.jp
Stackdriver Profiler
32
Goの場合は、アプリケーションの最初に呼ぶだけなので、導入はとっても簡単
func main() {
profiler.Start(profiler.Config{
Service: "myservice",
ServiceVersion: "1.0.0",
}
https://gcpug.jp
Profiler : Price
33
https://gcpug.jp
Thank you
GCPUG Slack #stackdriver
34
https://gcpug.jp