Prometheus配置和http请求总数

Prometheus配置和http请求总数,prometheus,Prometheus,我已经用默认配置安装了普罗米修斯 我在它的web界面上,试图获取与http请求总数相对应的时间序列 通过名称http\u requests\u total过滤,检索具有不同标签的多个时间序列,例如 http_requests_total{code='200',handler='targets',instance=localhost:9090,job='prometheus',method='get'} http_requests_total{code='200',handler='static

我已经用默认配置安装了普罗米修斯

我在它的web界面上,试图获取与
http
请求总数相对应的时间序列

通过名称
http\u requests\u total
过滤,检索具有不同标签的多个时间序列,例如

http_requests_total{code='200',handler='targets',instance=localhost:9090,job='prometheus',method='get'} 
http_requests_total{code='200',handler='static',instance=localhost:9090,job='prometheus',method='get'} 
http_requests_total{code='200',handler='graph',instance=localhost:9090,job='prometheus',method='get'} 
[...]
这些时间序列是什么?如何找到每个标签背后的语义?

第一,如果您在浏览器中访问,您应该会看到以下内容:

# HELP prometheus_http_request_duration_seconds Histogram of latencies for HTTP requests.
# TYPE prometheus_http_request_duration_seconds histogram
prometheus_http_request_duration_seconds_bucket{handler="/",le="0.1"} 3
prometheus_http_request_duration_seconds_bucket{handler="/",le="0.2"} 3
prometheus_http_request_duration_seconds_bucket{handler="/",le="0.4"} 3
...
这应该解释什么是度量标准,希望标签能代表什么。如果你不知道计数器/量表/直方图是什么,那么你可能应该这样做

如果您想深入研究(并访问受监控服务的源代码,就像普罗米修斯的源代码一样),您可以。请注意,代码中的度量名称可能是最终度量名称的子字符串,因为可以在其前面加上名称空间(我上面的示例中的
prometheus\uuu
部分),对于直方图和摘要
\u count
bucket
,或者可以附加其他内容。因此,在上述度量的情况下,您应该使用“prometheus\u http\u请求\u持续时间\u秒\u桶”