Slide 43
Slide 43 text
継続的なProfiling
cmd/batch/main.go
(import文省略)
package main
func main() {
// profilerを開始
err := profiler.Start(
profiler.WithService("pointclub-api"),
profiler.WithEnv(os.Getenv("APP_ENV")),
profiler.WithProfileTypes(
profiler.CPUProfile,
profiler.HeapProfile,
profiler.GoroutineProfile,
),
)
if err != nil {
logger.Panic("profilerの開始に失敗しました。
", err)
}
defer profiler.Stop()
}
参考:
https://docs.datadoghq.com/ja/tracing/profiler/
enabling/?code-lang=go
43