Prometheus (ソフトウェア)

出典: フリー百科事典『ウィキペディア(Wikipedia)』
Prometheus
初版 2012年11月24日 (11年前) (2012-11-24)
最新版
v2.36.2[1] / 2022年6月20日 (21か月前) (2022-06-20)
リポジトリ github.com/prometheus/prometheus
プログラミング
言語
Go
対応OS クロスプラットフォーム
種別 時系列データベース
ライセンス Apache License 2.0
公式サイト prometheus.io
テンプレートを表示

Prometheus(プロメテウス)は、イベント監視とアラート通知に利用される無料のアプリケーション・ソフトウェアである[2]時系列データベースHTTPプル方式でリアルタイムに構築し、柔軟なクエリーとアラート機能を提供する[3][4]

PrometheusはGoで書かれ、Apache License 2.0の下でライセンスされ、ソースコードはGitHubで公開されており[5]KubernetesEnvoyとともにCloud Native Computing Foundationの卒業プロジェクトとなっている[6]

歴史[編集]

Prometheusは、2012年にSoundCloud社で開発された[7]。同社は、既存のメトリクスおよび監視ソリューション(StatsDGraphiteを使用)が同社の目的に不十分であると気づいた。そこで、多次元データモデル、運用のシンプルさ、スケーラブルなデータ収集、強力なクエリー言語など満たすべき目標を定め、Googleの監視ツールBorgmonを参考に[8][9]単独のツールで実現すべく開発を始めた[10]。このプロジェクトは当初からオープンソースであり、明確にアナウンスされていないにもかかわらず、BoxeverDockerのユーザーにも利用され始めた[10][11]

2013年、SoundCloudの自社システム監視にPrometheusが導入された[10]。それが正式に公示されたのは2015年1月である[10]

2016年5月、Cloud Native Computing Foundation(以下CNCF)は、Kubernetesに次ぐ2番目のインキュベートプロジェクトとしてPrometheusを受け入れた。発表記事には、DigitalOceanEricssonCoreOSWeaveworksRed HatGoogleなど多くの企業でPrometheusが利用されていることが記されている[12]

2016年7月、Prometheus 1.0がリリースされた[13]

2018年8月、CNCFは、Prometheusプロジェクトが“卒業”(graduated)したことを発表した[6]

アーキテクチャー[編集]

Prometheusによる監視プラットフォームは、典型的には次のツールの組み合わせで構成される。

  • 監視対象ホスト上で実行され、メトリクスを提供するExporter
  • メトリクスを定期的に要求(プル)し、一元化して管理するPrometheus
  • メトリクスと設定条件に基づいてアラートを通知するAlertmanager[14]
  • メトリクスをダッシュボードにグラフ表示するGrafana
  • アラート通知やグラフ表示に使用されるクエリ言語PromQL

データ格納形式[編集]

Prometheusが扱う時系列データはメトリクスという形で保存され、各メトリクスには参照用の名前がついている。さらに各メトリクスは、任意の数のキー・バリューの組(ラベル)でドリルダウンすることが可能である。このラベルには、データソース(データがどのサーバーから送られてくるか)の情報や、HTTPステータスコード(HTTP応答に関連するメトリクス用)、HTTPクエリーメソッド(GETとPOST)、エンドポイントURLなど、アプリケーション固有のブレークダウン情報を含めることができる。これらのラベルを組み合わせてクエリーを実行できることから、Prometheusのデータは多次元データモデルと呼ばれる[15][10][11]

データ収集[編集]

Prometheusは、Exporterと呼ばれるデータソースに特定のポーリング頻度で問い合わせを行う(プル方式)。各Exporterは、Prometheusが問い合わせたエンドポイントにそのデータソースの現在値メトリクスを提供する[10]。Prometheusは、こうして集めたメトリクスを集約して保管する。なおPrometheusには、Exporterを自動的に発見するためのメカニズムがいくつか用意されている[16]

PromQL[編集]

Prometheusはデータの選択と集計のため、独自のクエリー言語PromQL(Prometheus Query Language)を備えている。PromQLは時系列データベースに適合するよう設計されており、時間に関連した問い合わせ機能も豊富に用意されている[17]。Prometheusには次の4つのメトリック型が定義されている。

Counter
値が増加する一方の単調な値
Gauge
自由に増減する値
Histogram
度数分布を収集し、ヒストグラムとして視覚的に処理できるようにする
Summary
Histogramと同様に度数分布が記録され、すべての観測値の数と合計も記録される

監視とアラート[編集]

Prometheusでは、閾値や期間の条件によるアラート通知の設定を行うことができる。発行されたアラートはAlertmanagerに転送される。Alertmanagerには、アラートを制限したり、メール、Slack、PagerDutyなどに転送したりするロジックを含めることができる[18]Microsoft Teamsのような他のメッセージングシステムも、外部統合のためのメカニズム「Alertmanager Webhook Receiver」を経由して利用することができる[19]

ダッシュボード[編集]

Prometheusは、ダッシュボードソリューションとしては設計されていない。特定のクエリーを簡易的にグラフ化することはできるものの、本格的なダッシュボードを生成するにはGrafanaなどと連携させる必要がある[20]

相互運用性[編集]

Prometheusはホワイトボックス監視を推奨しており、アプリケーションには内部メトリクスを提供するExporterの公開が望まれている[21]。実際、すでにさまざまなアプリケーションのエクスポーターが公式・非公式に用意されている[22]。Prometheusは、移行時の相互運用を可能にするために、いくつかの監視・管理プロトコルをサポートしている(GraphiteStatsDSNMPJMXCollectD等)。

Prometheusは、プラットフォームの可用性と基本的な操作に重点を置いている[23]。メトリクスは通常数週間保存されるが、リモートストレージを利用することでより長期的かつ安全に保存することもできる[24]

OpenMetricsへの標準化[編集]

Prometheusのメトリクス形式を「OpenMetrics」と呼ばれる標準として普及させる取り組みがある[25]InfluxDataのTICKスイート[26]InfluxDBGoogle Cloud Platform[27]Datadog[28]など、すでにこの形式を採用した製品も存在する。

採用[編集]

Prometheusは前述のとおり、開発元であるSoundCloud社の自社システム監視に初めて使用された[10]。またCNCFには、デジタルホスティングサービスDigitalOcean[29]、デジタルフェスティバルDreamHack[30]、連絡先移行サービスShuttleCloud[31]など、Prometheusを利用する企業の事例が多数掲載されている。ほかにもデータパイプライン監Pandora Radio[32]、リポジトリマネージャーGitLabなどがPrometheusを採用している。

出典[編集]

  1. ^ Latest release at Github
  2. ^ Overview”. prometheus.io. 2022年3月27日閲覧。
  3. ^ James Turnbull (12 June 2018). Monitoring with Prometheus. Turnbull Press. ISBN 978-0-9888202-8-9. https://books.google.com/books?id=EtlfDwAAQBAJ 
  4. ^ Prometheus: From metrics to insight. Power your metrics and alerting with a leading open-source monitoring solution”. 2018年12月26日閲覧。
  5. ^ Prometheus”. GitHub. 2018年12月26日閲覧。
  6. ^ a b Evans, Kristen (2018年8月9日). “Cloud Native Computing Foundation Announces Prometheus Graduation”. 2018年12月26日閲覧。
  7. ^ Brian Brazil (9 July 2018). Prometheus: Up & Running: Infrastructure and Application Performance Monitoring. O'Reilly Media. p. 3. ISBN 978-1-4920-3409-4. https://books.google.com/books?id=QW1jDwAAQBAJ 
  8. ^ Murphy, Niall; Beyer, Betsy; Jones, Chris; Petoff, Jennifer (2016). Site Reliability Engineering:How Google Runs Production Systems. O'Reilly Media. ISBN 978-1491929124. http://shop.oreilly.com/product/0636920041528.do. "Even though Borgmon remains internal to Google, the idea of treating time-series data as a data source for generating alerts is now accessible to everyone through those open source tools like Prometheus ..." 
  9. ^ Volz, Julius (2017年9月4日). “PromCon 2017: Conference Recap”. 2022年3月27日閲覧。 “I joined SoundCloud back in 2012 coming from Google...we didn't yet have any monitoring tools that that works with this kind of dynamic environment. We were kind of missing the way Google did its monitoring for its own internal cluster scheduler and we were very inspired by that and finally decided to build our own open-source solution.”
  10. ^ a b c d e f g Prometheus: Monitoring at SoundCloud”. SoundCloud (2015年1月26日). 2022年3月27日閲覧。
  11. ^ a b Monitor Docker Containers with Prometheus”. 5π Consulting (2015年1月26日). 2022年3月27日閲覧。
  12. ^ Cloud Native Computing Foundation Accepts Prometheus as Second Hosted Project”. Cloud Native Computing Foundation (2016年5月9日). 2018年12月26日閲覧。
  13. ^ Prometheus 1.0 Is Here”. Cloud Native Computing Foundation (2016年7月18日). 2018年12月26日閲覧。
  14. ^ https://github.com/prometheus/alertmanager
  15. ^ Data model”. Prometheus. 2018年12月26日閲覧。
  16. ^ Prometheus: Collects metrics, provides alerting and graphs web UI” (2017年3月18日). 2018年12月26日閲覧。
  17. ^ Querying Prometheus”. 2019年11月4日閲覧。
  18. ^ Dubey, Abhishek (2018年3月25日). “AlertManager Integration with Prometheus”. 2018年12月26日閲覧。
  19. ^ Danuka, Praneeth (2020年3月8日). “Alerting for Cloud-native Applications with Prometheus”. 2020年10月18日閲覧。
  20. ^ Ryckbosch, Frederick (2017年7月28日). “Prometheus monitoring: Pros and cons”. 2018年12月26日閲覧。
  21. ^ Prometheus. “Instrumentation - Prometheus”. prometheus.io. 2022年3月27日閲覧。
  22. ^ Exporters”. prometheus.io. 2022年3月27日閲覧。
  23. ^ Prometheus. “Prometheus - Monitoring system & time series database”. prometheus.io. 2022年3月27日閲覧。
  24. ^ Integrations - Prometheus”. prometheus.io. 2022年3月27日閲覧。
  25. ^ OpenMetrics”. GitHub (2018年11月13日). 2022年3月27日閲覧。
  26. ^ Telegraf from InfluxData”. GitHub (2018年12月25日). 2022年3月27日閲覧。
  27. ^ Announcing Stackdriver Kubernetes Monitoring”. 2022年3月27日閲覧。
  28. ^ DataDogHQ”. 2022年3月27日閲覧。
  29. ^ Evans, Kristen (2017年2月28日). “Prometheus User Profile: How DigitalOcean Uses Prometheus”. Cloud Native Computing Foundation. 2018年12月26日閲覧。
  30. ^ Evans, Kristen (2016年8月24日). “Prometheus User Profile: Monitoring the World's Largest Digital Festival – DreamHack”. Cloud Native Computing Foundation. 2018年12月26日閲覧。
  31. ^ Evans, Kirsten (2017年5月17日). “Prometheus User Profile: ShuttleCloud Explains Why Prometheus Is Good for Your Small Startup”. Cloud Native Computing Foundation. 2018年12月26日閲覧。
  32. ^ Haidrey, Ace (2018年3月15日). “Apache Airflow at Pandora”. Engineering at Pandora. 2018年12月26日閲覧。

参考文献[編集]

  • Russ, McKendrick (2015-12-15). Monitoring Docker : monitor your Docker containers and their apps using various native and third-party tools with the help of this exclusive guide!. Birmingham, UK. ISBN 9781785885501. OCLC 933610431 
  • JOSEPH., HECK (2018). KUBERNETES FOR DEVELOPERS use kubernetes to develop, test, and deploy your applications with the help of containers;use kubernetes to develop. [S.l.]: PACKT PUBLISHING. ISBN 978-1788830607. OCLC 1031909876 
  • Burns, Brendan (2018-02-20). Designing distributed systems : patterns and paradigms for scalable, reliable services (First ed.). Sebastopol, CA. ISBN 9781491983614. OCLC 1023861580 
  • Martin., Helmich (2017). Cloud Native programming with Golang Develop microservice-based high performance web apps for the cloud with Go. Andrawos, Mina., Snoeck, Jelmer.. Birmingham: Packt Publishing. ISBN 9781787127968. OCLC 1020029257 
  • Alok, Shrivastwa (2018-02-23). Hybrid cloud for architects : build robust hybrid cloud solutions using AWS and OpenStack. Birmingham, UK. ISBN 9781788627986. OCLC 1028641698 
  • Kaewkasi, Chanwit (2016). Native Docker Clustering with Swarm. ISBN 978-1786469755