我正試圖讓普羅米修斯與我的奧爾良筒倉一起運作......
我使用此使用者在埠 8082 上公開 Prometheus 的 Orleans 指標。使用本地 Prometheus 實體并使用來自同一存盤庫的 grafana.json,我發現它可以作業。
_ = builder.AddPrometheusTelemetryConsumerWithSelfServer(port: 8082);按照本指南將 Prometheus 安裝在 Kubernetes 上部署我的孤島的不同命名空間上。
按照說明,我將普羅米修斯標簽添加到我的奧爾良部署 yaml 中:
spec: replicas: 2 selector: matchLabels: app: mysilo template: metadata: annotations: prometheus.io/scrape: 'true' prometheus.io/port: '8082' labels: app: mysilo
我在普羅米修斯 yml 的作業:
- job_name: "orleans"
kubernetes_sd_configs:
- role: pod
namespaces:
names:
- orleans
selectors:
- role: "pod"
label: "app=mysilo"
根據同一指南,如果“pod 元資料使用 prometheus.io/scrape 和 prometheus.io/port 注釋進行注釋”,則所有 pod 指標都會被發現。我想我不需要任何額外的安裝。
有了這一切,并且埠轉發了我的 prometheus pod,我可以看到 prometheus 在 http://localhost:9090/metrics 中作業,但我的 grafana 儀表板中沒有顯示任何指標(同樣,我可以讓它在本地機器上作業,只有一個筒倉)。
在探索 grafana 時,我發現它似乎找不到實體:
sum(rate(process_cpu_seconds_total{job=~"orleans", instance=~"()"}[3m])) * 100
目的是監控我的 orleans 筒倉正在使用的資源(不是 Pod 指標本身,而是 orleans 指標),但我遺漏了一些東西:(
uj5u.com熱心網友回復:
感謝@BozoJoe 的評論,我可以除錯它。
問題是它試圖抓取埠 30000 和 1111 而不是我之前所說的 8082。由于 localhost:9090/targets 的 Prometheus 儀表板,我可以看到這一點
所以我去了 prometheus 組態檔并確保開始報廢正確的埠(我還添加了一些搜索名稱的限制):
- job_name: "orleans"
kubernetes_sd_configs:
- role: pod
namespaces:
names:
- orleans
selectors:
- role: "pod"
label: "app=mysilo"
relabel_configs:
- source_labels: [__meta_kubernetes_pod_container_name]
action: keep
regex: 'my-silo-name*'
- source_labels: [__address__]
action: replace
regex: ([^:] ):.*
replacement: $1:8081
target_label: __address__
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/446663.html
標籤:Kubernetes 普罗米修斯 格拉法纳 奥尔良
