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

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

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

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

系列文章

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

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

這里選擇幾項重要的部分進行說明:

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

配置 Exemplars

??Note:

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

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

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

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ù)源的詳細內(nèi)容,更多關(guān)于Grafana統(tǒng)一展示Prometheus的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

最新評論