Closed gebn closed 4 years ago
Note that bmc_scrape_duration_seconds
is only the duration of the Collect()
method - the request may have to wait for a substantial period of time to get to there, especially if another request for the same target just beat it, and the session had timed out and needed re-establishing.
This could be done by adding a time.Time
parameter to Target
's ServeHTTP()
(it doesn't need to implement http.Handler
), however that's messy.
What we actually care about here is time spent waiting for the event loop to get to us, which we can do entirely within Target
. Can pass the start time.Time
in scrapeReqOpts
, then observe a histogram value for that case
in the event loop. Will be fairly coarse (near-instant to 30s or so), but will provide the desired information.
It would be interesting, especially in the case of multiple scrapers, to expose the time between the request coming in and
Collect()
beginning. This might be difficult for the same reason as #13.