cosmo icon indicating copy to clipboard operation
cosmo copied to clipboard

chore(rfc): Extend core module system to support metrics

Open kaialang opened this issue 1 year ago • 1 comments
trafficstars

Motivation and Context

It extends the open core module system RFC to enable custom metric modules.

  • Expose both the entering point and existing point. RouterRequestHook, SubgraphRequestHook and OperationParse/Normalize/PlanHook It enables taking end to end measurements.
  • Create grouped interfaces: RouterHook, SubgraphHook and OperationHook for easier integration
  • For response hooks, a correct/meaningful statusCode should be given for easier processing.
  • For Error hooks , input error is an object of core.errorType, so the error can be easily casted.
  • Operation name/type should be always included in inputs.
  • Removed Telemetry Hooks, as with the above updates and refactor telemetry to be part of the the module system, it can be achieved by implementing the default metrics module.

New findings need to be discussed:

  • SchemaUsage info needs to populated despite of graphqlMetricsConfig value, graphqlMetricConfig should only turn on/off for the export to control plane part.

Added one example use case.

TODO

kaialang avatar Aug 30 '24 03:08 kaialang