就Prometheus而言,pull拉取採樣點的端點服務稱之爲instance,一般對應一個過程(實例)。具備相同目的的instance,例如,爲可伸縮性或可靠性而複製的流程稱爲做業。, 則構成了一個jobgit
例如, 一個被稱做api-server的任務有四個相同的實例。github
api-server
1.2.3.4:5670
1.2.3.4:5671
5.6.7.8:5670
5.6.7.8:5671
當Prometheus拉取一個目標,會自動地把兩個標籤添加到度量名稱的標籤列表中,分別是:api
host:port
若是以上兩個標籤兩者之一存在於採樣點中,這個取決於honor_labels
配置選項。詳見文檔post
對於每一個採樣點所在服務instance,Prometheus都會存儲如下的度量指標採樣點:code
up{job="[job-name]", instance="instance-id"}
:1
,表示採樣點所在服務健康;0
,標識抓取失敗scrape_duration_seconds{job="[job-name]", instance="[instance-id]"}
: 抓取的持續時間scrape_samples_post_metric_relabeling{job="<job-name>", instance="<instance-id>"}
: 應用度量標準從新標記後剩餘的樣本數。scrape_samples_scraped{job="<job-name>", instance="<instance-id>"}
: 目標暴露的樣本數量。up
度量指標對服務健康的監控是很是有用的。server
Prometheus官網地址:prometheus.io/文檔
個人Github:github.com/Alrights/pr…get