Documentation
¶
Overview ¶
Package graphql provides functions to trace the graph-gophers/graphql-go package (https://github.com/graph-gophers/graphql-go).
We use the tracing mechanism available in the https://godoc.org/github.com/graph-gophers/graphql-go/trace subpackage. Create a new Tracer with `NewTracer` and pass it as an additional option to `MustParseSchema`.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*config)
Option represents an option that can be used customize the Tracer.
func WithAnalytics ¶
WithAnalytics enables Trace Analytics for all started spans.
func WithAnalyticsRate ¶
WithAnalyticsRate sets the sampling rate for Trace Analytics events correlated to started spans.
func WithOmitTrivial ¶
func WithOmitTrivial() Option
WithOmitTrivial enables omission of graphql fields marked as trivial. This also opts trivial fields out of Threat Detection (and blocking).
func WithServiceName ¶
WithServiceName sets the given service name for the client.
func WithTraceVariables ¶
func WithTraceVariables() Option
WithTraceVariables enables tracing of variables passed into GraphQL queries and resolvers.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
A Tracer implements the graphql-go/trace.Tracer interface by sending traces to the Datadog tracer.
func (*Tracer) TraceField ¶
func (t *Tracer) TraceField(ctx context.Context, _, typeName, fieldName string, trivial bool, arguments map[string]interface{}) (context.Context, tracer.FieldFinishFunc)
TraceField traces a GraphQL field access.
func (*Tracer) TraceQuery ¶
func (t *Tracer) TraceQuery(ctx context.Context, queryString, operationName string, variables map[string]interface{}, _ map[string]*introspection.Type) (context.Context, tracer.QueryFinishFunc)
TraceQuery traces a GraphQL query.