Package graphql provides functions to trace the graph-gophers/graphql-go package (

    We use the tracing mechanism available in the subpackage. Create a new Tracer with `NewTracer` and pass it as an additional option to `MustParseSchema`.





    This section is empty.


    This section is empty.


    func NewTracer

    func NewTracer(opts ...Option) trace.Tracer

      NewTracer creates a new Tracer.


      type Option

      type Option func(*config)

        Option represents an option that can be used customize the Tracer.

        func WithAnalytics

        func WithAnalytics(on bool) Option

          WithAnalytics enables Trace Analytics for all started spans.

          func WithAnalyticsRate

          func WithAnalyticsRate(rate float64) Option

            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.

              func WithServiceName

              func WithServiceName(name string) Option

                WithServiceName sets the given service name for the client.

                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, label string, typeName string, fieldName string, trivial bool, args map[string]interface{}) (context.Context, trace.TraceFieldFinishFunc)

                    TraceField traces a GraphQL field access.

                    func (*Tracer) TraceQuery

                    func (t *Tracer) TraceQuery(ctx context.Context, queryString string, operationName string, variables map[string]interface{}, varTypes map[string]*introspection.Type) (context.Context, trace.TraceQueryFinishFunc)

                      TraceQuery traces a GraphQL query.