Skip to content

Instrument GraphQL and expose data with built-in typeΒ #109

Closed
@KyleAMathews

Description

@KyleAMathews

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions