Closed
Description
Was just brainstorming how cool it'd be if GraphQL was self-instrumented. Imagine if GraphQL logged every query + resolve timings for each field AND exposed all this data as a built-in type.
On top of this you could build:
- Monitoring (e.g. if query times for this customer critical query goes above 100 ms, send an alert)
- Something analogous to DBs' slow query log
- Build tool similar to GraphiQL but for ops. Connect to your production system and watch a live log of queries. Show histogram of 20 slowest queries over the past week. Zoom in on trouble spots and prioritize speeding those queries.
- Audit logs for users.
- etc.
The default implementation would be in-memory but easily overridable for any serious install so logs could be persisted.
Thoughts? What does Facebook do for instrumenting/logging GraphQL?
This is potentially a huge advantage to using GraphQL. Monitoring/alerting/auditing is freaking hard and this would standardize a big chunk of it.