Documentation ¶
Overview ¶
Package nrgraphqlgo instruments https://github.com/graphql-go/graphql applications.
This package creates an Extension that adds segment instrumentation for each portion of the GraphQL execution (Parse, Validation, Execution, ResolveField) to your GraphQL request transactions. Errors in any of these steps will be noticed using NoticeError (https://godoc.org/github.com/newrelic/go-agent/v3/newrelic#Transaction.NoticeError)
Please note that you must also instrument your web request handlers and put the transaction into the context object in order to utilize this instrumentation. For example, you could use newrelic.WrapHandle (https://godoc.org/github.com/newrelic/go-agent/v3/newrelic#WrapHandle) or newrelic.WrapHandleFunc (https://godoc.org/github.com/newrelic/go-agent/v3/newrelic#WrapHandleFunc) or you could use a New Relic integration for the web framework you are using if it is available (for example, https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrgorilla)
For a complete example, including instrumenting a graphql-go-handler, see: https://github.com/newrelic/go-agent/tree/master/v3/integrations/nrgraphqlgo/example/main.go
Index ¶
- type Extension
- func (Extension) ExecutionDidStart(ctx context.Context) (context.Context, graphql.ExecutionFinishFunc)
- func (Extension) GetResult(context.Context) interface{}
- func (Extension) HasResult() bool
- func (Extension) Init(ctx context.Context, _ *graphql.Params) context.Context
- func (Extension) Name() string
- func (Extension) ParseDidStart(ctx context.Context) (context.Context, graphql.ParseFinishFunc)
- func (Extension) ResolveFieldDidStart(ctx context.Context, i *graphql.ResolveInfo) (context.Context, graphql.ResolveFieldFinishFunc)
- func (Extension) ValidationDidStart(ctx context.Context) (context.Context, graphql.ValidationFinishFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extension ¶
type Extension struct{}
Extension is an extension that creates segments for New Relic, tracking each step of the execution process
func (Extension) ExecutionDidStart ¶
func (Extension) ExecutionDidStart(ctx context.Context) (context.Context, graphql.ExecutionFinishFunc)
ExecutionDidStart is called before the execution begins
func (Extension) GetResult ¶
GetResult returns the data that the extension wants to add to the result - in this case, none
func (Extension) HasResult ¶
HasResult returns true if the extension wants to add data to the result - this extension does not.
func (Extension) ParseDidStart ¶
ParseDidStart is called before parsing starts
func (Extension) ResolveFieldDidStart ¶
func (Extension) ResolveFieldDidStart(ctx context.Context, i *graphql.ResolveInfo) (context.Context, graphql.ResolveFieldFinishFunc)
ResolveFieldDidStart is called at the start of the resolving of a field
func (Extension) ValidationDidStart ¶
func (Extension) ValidationDidStart(ctx context.Context) (context.Context, graphql.ValidationFinishFunc)
ValidationDidStart is called before the validation begins