Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
水淹萌龙
kubesphere
提交
044dd8eb
K
kubesphere
项目概览
水淹萌龙
/
kubesphere
与 Fork 源项目一致
Fork自
KubeSphere / kubesphere
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kubesphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
未验证
提交
044dd8eb
编写于
5月 15, 2020
作者:
G
Guangzhe Huang
提交者:
GitHub
5月 15, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
monitoring: update builtin metrics (#2074)
Signed-off-by:
N
huanggze
<
loganhuang@yunify.com
>
上级
c3d74660
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
76 deletion
+57
-76
pkg/models/monitoring/sort_page.go
pkg/models/monitoring/sort_page.go
+1
-2
pkg/simple/client/monitoring/prometheus/promql.go
pkg/simple/client/monitoring/prometheus/promql.go
+53
-71
pkg/simple/client/monitoring/prometheus/testdata/promqls.go
pkg/simple/client/monitoring/prometheus/testdata/promqls.go
+3
-3
未找到文件。
pkg/models/monitoring/sort_page.go
浏览文件 @
044dd8eb
...
...
@@ -24,10 +24,9 @@ import (
"sort"
)
// TODO(huanggze): the id value is dependent of Prometheus label-value pair (i.e. label_kubesphere_io_workspace). We should regulate the naming convention.
const
(
IdentifierNode
=
"node"
IdentifierWorkspace
=
"
label_kubesphere_io_
workspace"
IdentifierWorkspace
=
"workspace"
IdentifierNamespace
=
"namespace"
IdentifierWorkload
=
"workload"
IdentifierPod
=
"pod"
...
...
pkg/simple/client/monitoring/prometheus/promql.go
浏览文件 @
044dd8eb
此差异已折叠。
点击以展开。
pkg/simple/client/monitoring/prometheus/testdata/promqls.go
浏览文件 @
044dd8eb
...
...
@@ -4,11 +4,11 @@ var PromQLs = map[string]string{
"cluster_cpu_utilisation"
:
`:node_cpu_utilisation:avg1m`
,
"node_cpu_utilisation"
:
`node:node_cpu_utilisation:avg1m{node="i-2dazc1d6"}`
,
"node_cpu_total"
:
`node:node_num_cpu:sum{node=~"i-2dazc1d6|i-ezjb7gsk"}`
,
"workspace_cpu_usage"
:
`round(sum by (
label_kubesphere_io_workspace) (namespace:container_cpu_usage_seconds_total:sum_rate{namespace!="", label_kubesphere_io_
workspace="system-workspace"}), 0.001)`
,
"workspace_memory_usage"
:
`sum by (
label_kubesphere_io_workspace) (namespace:container_memory_usage_bytes:sum{namespace!="", label_kubesphere_io_workspace=~"system-workspace|demo", label_kubesphere_io_
workspace!=""})`
,
"workspace_cpu_usage"
:
`round(sum by (
workspace) (namespace:container_cpu_usage_seconds_total:sum_rate{namespace!="",
workspace="system-workspace"}), 0.001)`
,
"workspace_memory_usage"
:
`sum by (
workspace) (namespace:container_memory_usage_bytes:sum{namespace!="", workspace=~"system-workspace|demo",
workspace!=""})`
,
"namespace_cpu_usage"
:
`round(namespace:container_cpu_usage_seconds_total:sum_rate{namespace!="", namespace="kube-system"}, 0.001)`
,
"namespace_memory_usage"
:
`namespace:container_memory_usage_bytes:sum{namespace!="", namespace=~"kube-system|default"}`
,
"namespace_memory_usage_wo_cache"
:
`namespace:container_memory_usage_bytes_wo_cache:sum{namespace!="",
label_kubesphere_io_
workspace="system-workspace", namespace=~"kube-system|default"}`
,
"namespace_memory_usage_wo_cache"
:
`namespace:container_memory_usage_bytes_wo_cache:sum{namespace!="", workspace="system-workspace", namespace=~"kube-system|default"}`
,
"workload_cpu_usage"
:
`round(namespace:workload_cpu_usage:sum{namespace="default", workload=~"Deployment:apiserver|coredns"}, 0.001)`
,
"workload_deployment_replica_available"
:
`label_join(sum (label_join(label_replace(kube_deployment_status_replicas_available{namespace="default", deployment!="", deployment=~"apiserver|coredns"}, "owner_kind", "Deployment", "", ""), "workload", "", "deployment")) by (namespace, owner_kind, workload), "workload", ":", "owner_kind", "workload")`
,
"pod_cpu_usage"
:
`round(sum by (namespace, pod) (irate(container_cpu_usage_seconds_total{job="kubelet", pod!="", image!=""}[5m])) * on (namespace, pod) group_left(owner_kind, owner_name) kube_pod_owner{owner_kind="ReplicaSet", owner_name=~"^elasticsearch-[^-]{1,10}$"} * on (namespace, pod) group_left(node) kube_pod_info{pod=~"elasticsearch-0", namespace="default"}, 0.001)`
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录