Kubernetes 中的 apiserver_request_duration_seconds prometheus metric 是什么意思?

What does apiserver_request_duration_seconds prometheus metric in Kubernetes mean?

我想知道 apiserver_request_duration_seconds 是否考虑了将请求(and/or 响应)从客户端(例如 kubelets)传输到服务器(反之亦然)所需的时间只是内部处理请求所需的时间(apiserver + etcd)而没有考虑通信时间?

另外,我还想知道在 apiserver 的 HTTP 处理程序链中更新此指标的位置?

API 个请求到 运行 需要多长时间。整个过程,从它启动 HTTP 处理程序到它 returns 响应。

作为对已接受答案中@coderanger 确认的补充。指标已定义 here and it is called from the function MonitorRequest which is defined here. The former is called from a chained route function InstrumentHandlerFunc here which is itself set as the first route handler here (as well as other places) and chained with this function, for example, to handle resource LISTs in which the internal logic is finally implemented here,它清楚地表明数据是从 etcd 获取并发送给用户(阻塞操作),然后 returns 返回并进行统计。