我想持续监视以java usinf prometheus实现的(metricType Gauge)自定义指标,并基于该值自动缩放kubernetes pod。该值在Prometheus仪表板中公开,我可以在其余的http://localhost:9090/api/v1/query?query=中进行访问。本教程仅适用于序列查询(用于prometheus适配器),并且我想在prometheus适配器中实现即时查询以监视此指标,因为如果使用序列查询,我将获得自定义指标值(以毫秒为单位),而不是整数。 prometheus-adapter.yaml配置。
rules:
default: false
custom:
- seriesQuery: '{__name__=~"<custom-metric>"}'
resources: { template: "<<.Resource>>" }
name:
matches: "custom-metric"
as: "custom-metric"
prometheus:
url: http://prom-demo-prometheus-opera-prometheus<namespace>
port: port
有人可以让我知道如何实现吗? 预先感谢!