前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >自定义指标扩缩容(2)

自定义指标扩缩容(2)

作者头像
随心助手
发布2023-09-01 09:59:53
1320
发布2023-09-01 09:59:53
举报
文章被收录于专栏:nginx遇上redisnginx遇上redis

podinfo应用暴露了一个名为http_requests_total的自定义metric。Prometheas适配器删除_total后缀,并将度量标记为计数器度量(counter metric)。 从自定义metrics API中获取每秒请求总数:

kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1/namespaces/default/pods/*/http_requests" | jq .

查询结果:

{

"kind": "MetricValueList",

"apiVersion": "custom.metrics.k8s.io/v1beta1",

"metadata": {

"selfLink": "/apis/custom.metrics.k8s.io/v1beta1/namespaces/default/pods/%2A/http_requests"

},

"items": [

{

"describedObject": {

"kind": "Pod",

"namespace": "default",

"name": "podinfo-6b86c8ccc9-kv5g9",

"apiVersion": "/__internal"

},

"metricName": "http_requests",

"timestamp": "2018-01-10T16:49:07Z",

"value": "901m"

},

{

"describedObject": {

"kind": "Pod",

"namespace": "default",

"name": "podinfo-6b86c8ccc9-nm7bl",

"apiVersion": "/__internal"

},

"metricName": "http_requests",

"timestamp": "2018-01-10T16:49:07Z",

"value": "898m"

}

]

}

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2023-05-30,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 nginx遇上redis 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档