系列文章

Grafana Prometheus 数据源

Grafana 提供了对 Prometheus 的内置支持。本文会介绍 Grafana Prometheus(也包括 Prometheus 的兼容实现,如 Thanos, Mimir 等) 数据源的部分选项、变量 (Variable)、查询 (Query) 和其他针对 Prometheus 数据源的功能。

配置 Prometheus 数据源

这里选择几项重要的部分进行说明:

  • URL
    : Prometheus Server 的 URL, 示例为:
    http://prometheus.example.org:9090
    (不需要 path 等信息)
  • Manage alerts via Alerting UI
    : 启用后可以集成 AlertManager, Grafana 可以显示、管理 AlertManager。启用后,可以选择对应的 Prometheus AlertManager 数据源
    • Alertmanager data source
      : 下拉框,选择对应的 Prometheus AlertManager 数据源
  • Type
    : Prometheus Server 的类型;包括
    Prometheus
    ,
    Cortex
    ,
    Thanos
    ,
    Mimir
    。当选择时,版本字段会尝试使用 Prometheus buildinfo API 自动填充。一些普罗米修斯类型,如 Cortex,不支持这个 API,必须手动填入。
  • Disable metrics lookup
    : 勾选该选项将禁用查询字段自动完成中的度量选择器和度量/标签支持。如果你在较大的 Prometheus 实例中遇到性能问题,这将有所帮助。
  • Custom query parameters
    : 在 Prometheus 查询 URL 中添加自定义参数。例如,
    timeout

    partial_response

    dedup
    、或
    max_source_resolution
    。多个参数应该用
    &
    连接起来。
    • 如:
      max_source_resolution=5m&timeout=10

配置 Exemplars


标签: none

添加新评论