apollofederatedtracingv1

package
v0.17.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeMap

type NodeMap struct {
	// contains filtered or unexported fields
}

type Tracer

type Tracer struct {
	ClientName  string
	Version     string
	Hostname    string
	TreeBuilder *TreeBuilder
	ShouldTrace bool
}

func (Tracer) ExtensionName

func (Tracer) ExtensionName() string

ExtensionName returns the name of the extension

func (*Tracer) InterceptField

func (t *Tracer) InterceptField(ctx context.Context, next graphql.Resolver) (interface{}, error)

InterceptField is called on each field's resolution, including information about the path and parent node. This information is then used to build the relevant Node Tree used in the FTV1 tracing format

func (*Tracer) InterceptOperation

func (t *Tracer) InterceptOperation(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler

InterceptOperation acts on each Graph operation; on each operation, start a tree builder and start the tree's timer for tracing

func (*Tracer) InterceptResponse

func (t *Tracer) InterceptResponse(ctx context.Context, next graphql.ResponseHandler) *graphql.Response

InterceptResponse is called before the overall response is sent, but before each field resolves; as a result the final marshaling is deferred to happen at the end of the operation

func (*Tracer) MutateOperationParameters

func (t *Tracer) MutateOperationParameters(ctx context.Context, request *graphql.RawParams) *gqlerror.Error

func (Tracer) Validate

Validate returns errors based on the schema; since this extension doesn't require validation, we return nil

type TreeBuilder

type TreeBuilder struct {
	Trace *generated.Trace
	// contains filtered or unexported fields
}

func NewTreeBuilder

func NewTreeBuilder() *TreeBuilder

NewTreeBuilder is used to start the node tree with a default root node, along with the related tree nodes map entry

func (*TreeBuilder) StartTimer

func (tb *TreeBuilder) StartTimer(ctx context.Context)

StartTimer marks the time using protobuf timestamp format for use in timing calculations

func (*TreeBuilder) StopTimer

func (tb *TreeBuilder) StopTimer(ctx context.Context)

StopTimer marks the end of the timer, along with setting the related fields in the protobuf representation

func (*TreeBuilder) WillResolveField

func (tb *TreeBuilder) WillResolveField(ctx context.Context)

On each field, it calculates the time started at as now - tree.StartTime, as well as a deferred function upon full resolution of the field as now - tree.StartTime; these are used by Apollo to calculate how fields are being resolved in the AST

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL