Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Health endpoint pattern as application monitoring #mackerelio

Health endpoint pattern as application monitoring #mackerelio

Health endpoint pattern as application monitoring #mackerelio

original: https://docs.google.com/presentation/d/1ihsnXBN4ELwL5kuKUICgM3EmZ4zWjUYPtGo3DJxYTGE/edit?usp=sharing

Kazuki Higashiguchi

March 01, 2019
Tweet

More Decks by Kazuki Higashiguchi

Other Decks in Technology

Transcript

  1. @hgsgtk Kazuki Higashiguchi job is … Software Engineer lang is

    ... PHP, Go ...etc belongs to ... BASE BANK株式会社 (BASE株式会社の100%子会社) worked with … Mackerel, Docker, AWS(ECS/Fargate) 3
  2. = • like “canary endpoint”, “status endpoint” • アプリケーション内のHTTPエンドポイント •

    アプリケーションの健全性を伝える(外形監視) • デプロイバージョン・依存性のステータスなど基本情報を含む場合もある 6 Health endpoint pattern
  3. = Status Code • ヘルスチェック成功時は、200 (OK) • ヘルスチェック失敗時は、503 (Service Unavaialbe)

    HTTP Response • ステータス・依存している連携サービスの状態などの状態情報 • JSON形式など構造化したデータ形式で返却 7 Health endpoint pattern Implementation
  4. = • コンテナベースアプリケーションにおける、Health endpoint pattern • Principles of container-based application

    design(Redhat) ◦ https://www.redhat.com/en/resources/cloud-native-container-design-whitepaper • HIGH OBSERVABILITY PRINCIPLE (HOP) 高観測可能性の原則 ◦ 活動状況や準備状況など、様々な状態チェックに対して APIを提供する • HOP観点でも、HTTPエンドポイントを用意するこのパターンは有益 13 閑話休題:コンテナベースアプリケーションとの親和性
  5. = • Health Check Response Format for HTTP APIs (IETF)

    ◦ https://tools.ietf.org/id/draft-inadarei-api-health-check-02.html • ヘルスチェックのためのJSONレスポンスの共通フォーマットの議論 ◦ “This document proposes a service health check response format for HTTP APIs.” • 進行中のIssues ◦ https://github.com/inadarei/rfc-healthcheck/issues 15 Health Check Response Format for HTTP APIs
  6. = • API Health Response ◦ https://tools.ietf.org/id/draft-inadarei-api-health-check-02.html#api-health-response • format ◦

    status ◦ version (optional) ◦ releaseId (optional) ◦ notes (optional) ◦ output (optional) ◦ details (optional) - The Details Object ◦ links (optional) ◦ serviceId (optional) ◦ description (optional) - human readable 16 API Health Response Format (draft)
  7. = 次のどれかの値を設定する • “pass”: ◦ healthy (acceptable aliases: “ok” to

    support Node’s Terminius and “up” for Java’s SpringBoot) • “fail”: ◦ unhealthy (acceptable aliases: “error” to support Node’s Terminius and “down” for Java’s SpringBoot) • “warn”: ◦ healthy, with some concerns. 18 抜粋:Status
  8. = • アプリケーションの状態監視としてのHealth endpoint pattern • 議論が進行中の ”Health Check Response

    Format for HTTP APIs” • 「こういう情報はどう扱うのがいいんだろう?」という迷いが出たら参考にしてみ ると良さそう。 • 運用を意識したアプリケーション設計のためにも、監視のパターンは知っておく と良い。 • 「入門 監視」は最高。 19 Summary