cli
cli copied to clipboard
As an application developer I want to see call stats for my function so that I can diagnose problems/failures
It would be awesome to provide statistics as part of fn calls.
At this moment Fn can ship function statistics like:
- container stats (RAM, CPU consumption, disk and networking IO usage)
- timestamps (Created At, Started At, Completed At)
As developer i'd like to see the following:
-
provide execution time for each call (to enable external visualization tool implementation must spit out JSON object):
<call-id>:<execution-time> -
average execution time for calls filtered by the particular path (
--path) within last hour (or since) -
average RAM consumption for calls filtered by the particular path (
--path) within last hour
Maybe something else?
it's possible to calculate this info now from API on the small scale, and i'm not sure this is an API that would be very fun to support in a really scaled up environment -- we're essentially running map-reduce queries against our database. this seems like some UI / tooling sugar (for UI, could work off a read replica of the data to not disturb main db, but this gets really involved), if we bake into default tooling we risk same scale issues. most of this we're going to want to yank out of some metrics backend I assume, but am not sure how this would look if it were part of normal API ?(UI using prometheus endpoint to aggregate across fn already, this seems like a good starting point)
We're doing something like this for 1.0, restricted to [last 1000 || last 24 hrs), with aggregated stats for successful calls and per-function details for failures. Still working out details and plumbing but It's likely that the existing calls API will evolve/get replaced as it doesn't really scale when you start pointing CLI at a big production system.
(And @rdallman is correct, it does get really involved...)