Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图表怎么创建? #7

Open
qq12157138 opened this issue Apr 27, 2018 · 1 comment
Open

图表怎么创建? #7

qq12157138 opened this issue Apr 27, 2018 · 1 comment
Labels

Comments

@qq12157138
Copy link

Query expression怎么写?

我觉得楼主直接定好模版就行了。

@cuigh
Copy link
Owner

cuigh commented Apr 28, 2018

就是 Prometheus 的查询表达式,可参考其官方文档:https://prometheus.io/docs/prometheus/latest/querying/basics/

下面是几个首页示例图表,你可以使用图表的导入功能来导入 Swirl 中

  • 服务器 1 分钟内平均负载
{
  "name": "node_load1",
  "title": "node_load1",
  "desc": "Node load in 1 minute",
  "metrics": [
    {
      "legend": "${host_name}",
      "query": "node_load1"
    }
  ],
  "kind": "",
  "dashboard": "home",
  "type": "line",
  "unit": "percent:1",
  "width": 6,
  "height": 200,
  "options": {}
}
  • 容器占用的总内存
{
  "name": "container_memory_total",
  "title": "Total memory usage",
  "desc": "Total memory usage of all containers",
  "metrics": [
    {
      "legend": "${host_name}",
      "query": "sum(container_memory_usage_bytes{image!=\"\"}) by(host_name)"
    }
  ],
  "kind": "",
  "dashboard": "home",
  "type": "pie",
  "unit": "size:bytes",
  "width": 3,
  "height": 200,
  "options": {}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants