otelgql

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

This package is inspired by the work of Ravil Galaktionov on https://github.com/ravilushqa/otelgqlgen project

The project is rewritted on s42 app due to the fact of how otel is used. On August 2022, this option is not possible with the package of ravilushqa, that the motivation of the rewrite. All credits to Ravil Galaktionov

This package is inspired by the work of Ravil Galaktionov on https://github.com/ravilushqa/otelgqlgen project

The project is rewritted on s42 app due to the fact of how otel is used. On August 2022, this option is not possible with the package of ravilushqa, that the motivation of the rewrite. All credits to Ravil Galaktionov

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOperationName

func GetOperationName(ctx context.Context) string

GetOperationName gets the operation name from the context.

func RequestComplexityLimit

func RequestComplexityLimit(complexityLimit int64) attribute.KeyValue

RequestComplexityLimit sets the complexity limit.

func RequestOperationComplexity

func RequestOperationComplexity(complexityLimit int64) attribute.KeyValue

RequestOperationComplexity sets the operation complexity.

func RequestQuery

func RequestQuery(requestQuery string) attribute.KeyValue

RequestQuery sets the request query.

func RequestVariables

func RequestVariables(requestVariables map[string]interface{}) []attribute.KeyValue

RequestVariables sets request variables.

func ResolverAlias

func ResolverAlias(resolverAlias string) attribute.KeyValue

ResolverAlias sets resolver alias.

func ResolverArgs

func ResolverArgs(argList ast.ArgumentList) []attribute.KeyValue

ResolverArgs sets resolver args.

func ResolverErrors

func ResolverErrors(errorList gqlerror.List) []attribute.KeyValue

ResolverErrors sets errors.

func ResolverField

func ResolverField(resolverField string) attribute.KeyValue

ResolverField sets resolver field.

func ResolverObject

func ResolverObject(resolverObject string) attribute.KeyValue

ResolverObject sets resolver object.

func ResolverPath

func ResolverPath(resolverPath string) attribute.KeyValue

ResolverPath sets resolver path.

func SetOperationName

func SetOperationName(ctx context.Context, name string) context.Context

SetOperationName adds the operation name to the context so that the interceptors can use it. It will replace the operation name if it already exists in the context. example:

	ctx = otelgqlgen.SetOperationName(r.Context(), "my-operation")
 	r = r.WithContext(ctx)

Types

type RequestVariablesBuilderFunc

type RequestVariablesBuilderFunc func(requestVariables map[string]interface{}) []attribute.KeyValue

RequestVariablesBuilderFunc is the signature of the function used to build the request variables attributes.

type Tracer

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

func Middleware

func Middleware(tr trace.Tracer) Tracer

Middleware sets up a handler to start tracing the incoming requests. The service parameter should describe the name of the (virtual) server handling the request. extension parameter may be empty string.

func (Tracer) ExtensionName

func (a Tracer) ExtensionName() string

func (Tracer) InterceptField

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

func (Tracer) InterceptResponse

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

func (Tracer) Validate

func (a Tracer) Validate(_ graphql.ExecutableSchema) error

Jump to

Keyboard shortcuts

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