<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Prometheus &#8211; SRA OSS Tech Blog</title>
	<atom:link href="https://www.sraoss.co.jp/tech-blog/tag/prometheus/feed/index.xml" rel="self" type="application/rss+xml" />
	<link>https://www.sraoss.co.jp/tech-blog/</link>
	<description>OSS専門の技術ブログ。PostgreSQL、Zabbixを中心に10種類以上のOSSの解説、アップデート情報、運用ヒントを提供。</description>
	<lastBuildDate>Fri, 23 Oct 2026 06:34:24 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>

<image>
	<url>https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2018/07/blog-icon-150x150.png</url>
	<title>Prometheus &#8211; SRA OSS Tech Blog</title>
	<link>https://www.sraoss.co.jp/tech-blog/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Prometheusの概要</title>
		<link>https://www.sraoss.co.jp/tech-blog/prometheus/prometheus-introduction/</link>
		
		<dc:creator><![CDATA[盛 宣陽 (Yoshiharu Mori)]]></dc:creator>
		<pubDate>Fri, 07 Feb 2020 04:00:48 +0000</pubDate>
				<category><![CDATA[Prometheus]]></category>
		<category><![CDATA[Zabbix]]></category>
		<guid isPermaLink="false">https://www.sraoss.co.jp/tech-blog/?p=5498</guid>

					<description><![CDATA[Prometheusとは Prometheus は、サーバのリソース状況やソフトウェアの統計情報といった各種メトリックスを収集して監視を行うモニタリングシステムです。ロギングやトレーシングを行うといった多用途のものではな ...]]></description>
										<content:encoded><![CDATA[<h3><strong>Prometheusとは</strong></h3>
<p>Prometheus は、サーバのリソース状況やソフトウェアの統計情報といった各種メトリックスを収集して監視を行うモニタリングシステムです。ロギングやトレーシングを行うといった多用途のものではなくメトリックス収集に特化しているモニタリングシステムで、人気が高まりつつあるモニタリングシステムです。</p>
<p><span id="more-5498"></span>もともと SoundCloud 社によって開発されたツールで、現在では、Cloud Native Computing Foundation によってメンテナンスされており、クラウドや Kubernetes 環境で利用されるケースが多いのも特徴です。</p>
<h2>Prometheus のアーキテクチャ</h2>
<p>Prometheus の全体的なアーキテクチャは次のようになっています。</p>
<figure id="attachment_5510" aria-describedby="caption-attachment-5510" style="width: 600px" class="wp-caption aligncenter"><img fetchpriority="high" decoding="async" class="size-medium wp-image-5510" src="https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/architecture-300x180.png" alt="" width="600" height="360" srcset="https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/architecture-300x180.png 300w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/architecture-768x461.png 768w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/architecture-1024x615.png 1024w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/architecture-304x182.png 304w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/architecture-282x169.png 282w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/architecture.png 1351w" sizes="(max-width: 600px) 100vw, 600px" /><figcaption id="caption-attachment-5510" class="wp-caption-text">https://prometheus.io/docs/introduction/overview/</figcaption></figure>
<p>Prometheus は Prometheus サーバから各コンポーネントに HTTP 通信にてメトリックスの収集、サービスディスカバリ、通知を行います。メトリックスの収集はプル方式( Prometheus サーバから命令を出す方式)で行うのが特徴です。バッチ処理の実行結果など、Prometheus サーバに値を送りたい場合には、Pushgateway 宛に値を送り、Prometheusサーバからは Pushgateway にプル方式で値を取得するようなアーキテクチャとなっております。<br />
プル方式のメリットとして、Prometheus の<a href="https://prometheus.io/docs/introduction/faq/#why-do-you-pull-rather-than-push" target="_blank" rel="noopener noreferrer">FAQ</a>では次のような説明があります。</p>
<ol>
<li>You can run your monitoring on your laptop when developing changes.</li>
<li>You can more easily tell if a target is down.</li>
<li>You can manually go to a target and inspect its health with a web browser.</li>
</ol>
<p>プッシュ方式で値を取得する場合には、サーバ側の負荷を超えて値が送られる場合もあり、プル方式は、サーバ側の性能を超えた処理はしないため、安定的に運用をしやすいのもメリットだと考えられます。一方、プッシュ方式のメリットとしては、プッシュされたデータに監視対象のデータを入れ込むことで、新しくシステムに追加された監視対象を容易に発見(ディスカバリ)できる点にあります。Prometheus は監視対象のディスカバリ機能を持っており、プッシュ方式でなくとも、監視対象のディスカバリができるようになっています。</p>
<h2>exporter</h2>
<p>Prometheus のライブラリを利用してメトリックスを提供している一部のソフトウェアでは、Prometheus サーバから直接アクセスを行うことで、メトリックスを収集することがきます。独自のメトリックス形式を持っている多くのソフトウェアに対しては、exporter とよばれるものでメトリックスを公開します。<br />
例えば、PostgreSQL、Redis、JMX、Linux システム用の exporter といったように用途ごとに exporter が存在します。利用者は、環境に合わせて必要な exporter を利用することになります。<br />
<a href="https://prometheus.io/docs/instrumenting/exporters/" target="_blank" rel="noopener noreferrer">exporter一覧</a></p>
<h2>サービスディスカバリ</h2>
<p>Prometheus のサービスディスカバリを利用することで、監視対象を自動的に見つけることができます。<br />
主なサービスディスカバリ</p>
<ol>
<li>Azure<br />
Azure上のVMのディスカバリ</li>
<li>ec2<br />
Amaozn EC2インスタンス向けのディスカバリ</li>
<li>gce<br />
Google Cloud Platform向けのディスカバリ</li>
<li>kubernetes<br />
kubernetes向けのディスカバリ</li>
<li>dns<br />
DNSレコードを利用したディスカバリ</li>
<li>file<br />
ファイルに記載された情報をもとにディスカバリ</li>
</ol>
<h2>スクレイピング</h2>
<p>サービスディスカバリによって取得した監視対象のリストを利用して、Prometheus サーバによりメトリックスの収集を行えます。Prometheus ではメトリックスの収集を「スクレイピング」と呼びます。サーバ側の設定でスクレイピングの時間間隔を設定することができるようになっています。また、ルールという機能を利用して、スクレイピングして取得したメトリックスを集計・計算して保存するといったこともできます。</p>
<h2>ダッシュボード</h2>
<p>Prometheus のダッシュボードとしては、別の OSS ソフトウェアである Grafana が利用できます。</p>
<p><img decoding="async" class="aligncenter size-medium wp-image-5523" src="https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Prometheus-Demo-Dashboard-Grafana-300x182.png" alt="" width="600" height="364" srcset="https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Prometheus-Demo-Dashboard-Grafana-300x182.png 300w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Prometheus-Demo-Dashboard-Grafana-768x466.png 768w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Prometheus-Demo-Dashboard-Grafana-1024x621.png 1024w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Prometheus-Demo-Dashboard-Grafana-304x184.png 304w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Prometheus-Demo-Dashboard-Grafana-282x171.png 282w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Prometheus-Demo-Dashboard-Grafana.png 1756w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p>Grafana では標準で、データストアとして複数の Prometheus サーバを登録することができるようになっているので、拠点ごとに導入している複数の Prometheus を一つのダッシュボードで表現するといったこともできます。</p>
<p><img decoding="async" class="aligncenter size-medium wp-image-5542" src="https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Grafana-prometheus-300x92.png" alt="" width="600" height="184" srcset="https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Grafana-prometheus-300x92.png 300w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Grafana-prometheus-768x235.png 768w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Grafana-prometheus-304x93.png 304w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Grafana-prometheus-282x86.png 282w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/Grafana-prometheus.png 902w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p>Prometheus 本体にも、取得した値の確認、評価を行う expression browser というものが用意されていますが、機能が限られた UI となっております。</p>
<h2>通知</h2>
<p>通知の閾値設定は Prometheus サーバで行われます。閾値を超えた場合には、メール等の通知を行われますが、Prometheus サーバからメール送信は行われません。Prometheus サーバは HTTPリクエストにて Alertmanager に処理を依頼して、Alertmanager からメール通知やslack通知が行われます。Alertmanager には、通知を集約する機能や、一時的に通知を送らない(ミュートする)といったユニークな機能を有しております。</p>
<h2>ストレージ</h2>
<p>デフォルトでは、Prometheusはローカルのストレージを利用してデータを蓄積します。Prometheus自体は、複数のマシンを利用したクラスタストレージは提供しておりませんが、リモート読み出し書き込みのAPIを提供しています。APIを利用することで、複数のマシン上でデータを読み書きする構成も利用することができるようになっています。</p>
<h2>可用性について</h2>
<p>Prometheusサーバを複数利用して同じ監視対象、exporter から値をとることで可用性を担保することができます。複数の Prometheus サーバから飛んできた通知リクエストを Alertmanager で集約させることもできます。また Alertmanager はクラスタリング機能を有しています。</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium wp-image-5526" src="https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/alertmanager-300x74.png" alt="" width="600" height="148" srcset="https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/alertmanager-300x74.png 300w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/alertmanager-768x189.png 768w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/alertmanager-1024x253.png 1024w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/alertmanager-304x75.png 304w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/alertmanager-282x70.png 282w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/alertmanager.png 1212w" sizes="auto, (max-width: 600px) 100vw, 600px" /></p>
<h2>フェデレーションについて</h2>
<p>Prometheusサーバも exporter として機能します。フェデレーションという機能を利用することで Prometheus サーバが収集したメトリックスを選択して外部に公開することもでき、他の Prometheus サーバからスクレイピングすることができます。ユースケースとしては、データセンタごとに配置してある Prometheus サーバに対して、外部の Prometheus からアクセスして値を評価するといったことに用いられます。</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-medium wp-image-5529" src="https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/federation-300x99.png" alt="" width="600" height="198" srcset="https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/federation-300x99.png 300w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/federation-768x254.png 768w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/federation-304x101.png 304w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/federation-282x93.png 282w, https://www.sraoss.co.jp/tech-blog/wp-content/uploads/2020/01/federation.png 834w" sizes="auto, (max-width: 600px) 100vw, 600px" /></p>
<h2>まとめ</h2>
<p>Prometheusの概要について説明いたしました。次はPrometheusのセットアップとデータ構造について、説明したいと思います。</p>
<div>
<a href="https://www.sraoss.co.jp/prod_serv/support/oss-pro-support/?utm_source=sraoss-techblog&utm_medium=referral&utm_campaign=under-article-oss" rel="noopener" style="color:initial;" target="_blank" class="no-ext"></p>
<div style="background-color:#DAEFF6; padding:20px; border-radius:8px; text-align:center;">
SRA OSSでは、各種OSS のサポートを提供しております。<br />
詳しくは<strong style="color:#2581c4;">弊社ホームページ</strong>をご覧ください。
</div>
<p></a>
</div>

]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
