Hi there,
If MongoDB Team is not planning to add Stitch analytics soon, I would like to try implementing it myself. What do I mean by analytics:
- Request count/hour timeline
- Errors count/hour timeline
- User browser pie chart
- Total time spent per function
- Total execution count per function
- Total error count per function
- Current active users (users active in the last 30 min ?)
How?
- Scheduled trigger that collects “new” stitch logs and stores the logs in a “unprocessed” collection. Because of the function execution time limit I would have to come up with some logic to remember last saved unprocessed timestamp/log id. Next trigger run should start from the lat save timestamp/log_id.
- Another scheduled trigger that aggregates the unprocessed data and stores the result in “processed” collection.
- Use MongoDB Charts to display different types of graphs.
Possible problems?
- Too many logs
- Slow log API
- Function execution time limit
What do you think about this idea?
P.S.If others find it useful, I would happily share my code when it’s ready.