欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Grafana?系列之統(tǒng)一展示Prometheus數(shù)據(jù)源

 更新時(shí)間:2023年05月08日 11:03:40   作者:東風(fēng)微鳴  
這篇文章主要為大家介紹了Grafana?系列之統(tǒng)一展示Prometheus數(shù)據(jù)源配置詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪

Grafana Prometheus 數(shù)據(jù)源

系列文章

Grafana 提供了對(duì) Prometheus 的內(nèi)置支持。本文會(huì)介紹 Grafana Prometheus(也包括 Prometheus 的兼容實(shí)現(xiàn),如 Thanos, Mimir 等) 數(shù)據(jù)源的部分選項(xiàng)、變量 (Variable)、查詢 (Query) 和其他針對(duì) Prometheus 數(shù)據(jù)源的功能。

配置 Prometheus 數(shù)據(jù)源

這里選擇幾項(xiàng)重要的部分進(jìn)行說(shuō)明:

  • URL: Prometheus Server 的 URL, 示例為:http://prometheus.example.org:9090 (不需要 path 等信息)
  • Manage alerts via Alerting UI: 啟用后可以集成 AlertManager, Grafana 可以顯示、管理 AlertManager。啟用后,可以選擇對(duì)應(yīng)的 Prometheus AlertManager 數(shù)據(jù)源
    • Alertmanager data source: 下拉框,選擇對(duì)應(yīng)的 Prometheus AlertManager 數(shù)據(jù)源
  • Type: Prometheus Server 的類(lèi)型;包括 Prometheus, Cortex, Thanos, Mimir。當(dāng)選擇時(shí),版本字段會(huì)嘗試使用 Prometheus buildinfo API 自動(dòng)填充。一些普羅米修斯類(lèi)型,如 Cortex,不支持這個(gè) API,必須手動(dòng)填入。
  • Disable metrics lookup: 勾選該選項(xiàng)將禁用查詢字段自動(dòng)完成中的度量選擇器和度量/標(biāo)簽支持。如果你在較大的 Prometheus 實(shí)例中遇到性能問(wèn)題,這將有所幫助。
  • Custom query parameters: 在 Prometheus 查詢 URL 中添加自定義參數(shù)。例如,timeoutpartial_response、dedup、或max_source_resolution。多個(gè)參數(shù)應(yīng)該用&連接起來(lái)。
    • 如:max_source_resolution=5m&timeout=10

配置 Exemplars

??Note:

在 Prometheus v2.26 及以上版本與 Grafana v7.4 及以上版本中可用。 如 前文 所述,Exemplars 用途是用于在 Metric -> Traces 無(wú)縫跳轉(zhuǎn)。

Grafana 7.4 及更高版本可以在 "Explore" 和 "Dashboards" 中顯示 Exemplars 數(shù)據(jù)與指標(biāo)。Exemplars 數(shù)據(jù)將來(lái)自特定事件的 higher-cardinality metadata 與傳統(tǒng)的時(shí)間序列數(shù)據(jù)聯(lián)系起來(lái)。

  • Internal link: 如果你有一個(gè)內(nèi)部鏈接,啟用這個(gè)選項(xiàng)。啟用后,這將顯示數(shù)據(jù)源選擇器。為你的示例數(shù)據(jù)選擇后端 tracing 數(shù)據(jù)存儲(chǔ)。如 Grafana 內(nèi)部的 Tempo 數(shù)據(jù)源或 Jaeger 數(shù)據(jù)源。
  • Data source: (只有當(dāng)你啟用 "Internal link"時(shí)才可見(jiàn)) 為你的示范數(shù)據(jù)選擇后端追蹤數(shù)據(jù)存儲(chǔ)。
  • URL: (只有當(dāng)你禁用 "Internal link"時(shí)才可見(jiàn)) 定義了外部鏈接的完整 URL。你可以通過(guò)使用${__value.raw} 從該字段中插值。
  • Label name: 為 exemplars 的 traceID 屬性添加一個(gè)名稱。

Prometheus YAML 配置示例

典型示例如下:(基于 Grafana 9)

apiVersion: 1
datasources:
  - name: Prometheus
    type: prometheus
    # Access mode - proxy (server in the UI) or direct (browser in the UI).
    access: proxy
    url: http://localhost:9090
    jsonData:
      httpMethod: POST
      manageAlerts: true
      prometheusType: Prometheus
      prometheusVersion: 2.37.0
      cacheLevel: 'High'
      exemplarTraceIdDestinations:
        # Field with internal link pointing to data source in Grafana.
        # datasourceUid value can be anything, but it should be unique across all defined data source uids.
        - datasourceUid: my_jaeger_uid
          name: traceID
        # Field with external link.
        - name: traceID
          url: 'http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Jaeger%22,%7B%22query%22:%22$${__value.raw}%22%7D%5D'

以上就是Grafana 系列之統(tǒng)一展示Prometheus數(shù)據(jù)源的詳細(xì)內(nèi)容,更多關(guān)于Grafana統(tǒng)一展示Prometheus的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

最新評(píng)論