简体   繁体   中英

What does apiserver_request_duration_seconds prometheus metric in Kubernetes mean?

I want to know if the apiserver_request_duration_seconds accounts the time needed to transfer the request (and/or response) from the clients (eg kubelets) to the server (and vice-versa) or it is just the time needed to process the request internally (apiserver + etcd) and no communication time is accounted for?

As a plus, I also want to know where this metric is updated in the apiserver's HTTP handler chains?

How long API requests are taking to run. Whole thing, from when it starts the HTTP handler to when it returns a response.

As an addition to the confirmation of @coderanger in the accepted answer. The metric is defined 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 and it clearly shows that the data is fetched from etcd and sent to the user (a blocking operation) then returns back and does the accounting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM