How to probe prometheus & grafana. What is helm on shinjuku mokumoku programming vol.20
How to probe prometheus &grafanaWhat is helm@threetreeslighton shinjuku mokumoku programming #201 / 19
View Slide
WhoVP of Engineering atEvent Organizerおじさん Repro2 / 19
今⽇やることblog監視のgrafanaにおいて外形監視が落ちるを解決するIstioのchartを基にprometheusとgrafanaの設定⾒直す3 / 19
できたことblog監視のgrafanaにおいて外形監視が落ちるを解決するIstioのchartを基にprometheusとgrafanaの設定⾒直すあわせてhelm chartの構成理解istioの正常(多分)稼働4 / 19
迷ったこと1.すでにPrometheus, Grafanaでcluster監視している場合、Istioに同梱されているchartは使わないよね?2. istioは個別のnamespaceに分けたほうがつかやすかったりするのか?3. helmを複数のservice account,複数のclusterで使う場合どうするのか?5 / 19
せっかくなのでいくつかtipsご紹介6 / 19
healthcheckPrometheusGrafana7 / 19
Prometheus helthcheckCNCF graduagted projectのprometheus、healthcheck endpoint実装されてたhttps://github.com/prometheus/prometheus/blob/47a673c3router.Get("/-/healthy", func(w http.ResponseWriter, r *http.Request)w.WriteHeader(http.StatusOK)fmt.Fprintf(w, "Prometheus is Healthy.\n")})router.Get("/-/ready", readyf(func(w http.ResponseWriter, r *http.Reqw.WriteHeader(http.StatusOK)fmt.Fprintf(w, "Prometheus is Ready.\n")}))8 / 19
思ったより?揉めずにサクッとはいっていた模様。/-/readyが先にあったからかな?Add /-/healthy and /-/ready endpoints #28319 / 19
Prometheus Probeこんな感じシンプルになった livenessProbe:httpGet:path: /-/healthyport: 9090readinessProbe:httpGet:path: /-/readyport: 909010 / 19
Grafana health checkで /api/health endpointが提供されていた。Grafana 4.3https://github.com/grafana/grafana/blob/e78c1b4abc7eda7func (hs *HTTPServer) healthHandler(ctx *macaron.Context) {notHeadOrGet := ctx.Req.Method != http.MethodGet && ctx.Req.Method !=if notHeadOrGet || ctx.Req.URL.Path != "/api/health" {return}data := simplejson.New()data.Set("database", "ok")data.Set("version", setting.BuildVersion)data.Set("commit", setting.BuildCommit)11 / 19
ぼちぼちコメントがそれなりにこまっていたということだろうか?ぼちぼちコメントが有る。grafanaのiconが帰ってくるかどうかでwork aroundしているひともいるぐらい。アクセスすると認証前だったらlogin画⾯に⾶ばされたり、そもそもそのログイン画⾯がちょいと重かったりするから欲しい気持ちめっちゃわかる。Monitoring Grafana #330212 / 19
Grafana Probeこんな感じシンプルになった readinessProbe:httpGet:path: /api/healthport: 300013 / 19
health checkの仕組みが提供されているとよいよね14 / 19
helm chart15 / 19
What is helmhelm ( )とは、CNCF ()でhostingされているkubernetes上のpackage manager。https://helm.sh/https://www.cncf.io/16 / 19
stop the copy-and-paste madness.この表現がなされるほどのyaml wall 1. Helmは単純にkubernetesのresourceをGo templatingしているだけ2. localにchartをおいて複数clusterに展開することもできるので便利だったりする細かい話はblogにあげていく17 / 19
Tips終わり18 / 19
頑張っていく19 / 19