Documentation ¶
Overview ¶
Package otelgqlgen instruments the github.com/99designs/gqlgen package.
Currently only the routing of a received message can be instrumented. To do it, use the Middleware function.
Index ¶
- func GetOperationName(ctx context.Context) string
- func RequestComplexityLimit(complexityLimit int64) attribute.KeyValue
- func RequestOperationComplexity(complexityLimit int64) attribute.KeyValue
- func RequestQuery(requestQuery string) attribute.KeyValue
- func RequestVariables(requestVariables map[string]interface{}) []attribute.KeyValue
- func ResolverAlias(resolverAlias string) attribute.KeyValue
- func ResolverArgs(argList ast.ArgumentList) []attribute.KeyValue
- func ResolverErrors(errorList gqlerror.List) []attribute.KeyValue
- func ResolverField(resolverField string) attribute.KeyValue
- func ResolverObject(resolverObject string) attribute.KeyValue
- func ResolverPath(resolverPath string) attribute.KeyValue
- func SetOperationName(ctx context.Context, name string) context.Context
- type Option
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOperationName ¶
GetOperationName gets the operation name from the context.
func RequestComplexityLimit ¶
RequestComplexityLimit sets the complexity limit.
func RequestOperationComplexity ¶
RequestOperationComplexity sets the operation complexity.
func RequestQuery ¶
RequestQuery sets the request query.
func RequestVariables ¶
RequestVariables sets request variables.
func ResolverAlias ¶
ResolverAlias sets resolver alias.
func ResolverArgs ¶
func ResolverArgs(argList ast.ArgumentList) []attribute.KeyValue
ResolverArgs sets resolver args.
func ResolverErrors ¶
ResolverErrors sets errors.
func ResolverField ¶
ResolverField sets resolver field.
func ResolverObject ¶
ResolverObject sets resolver object.
func ResolverPath ¶
ResolverPath sets resolver path.
func SetOperationName ¶
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 Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option specifies instrumentation configuration options.
func WithComplexityExtensionName ¶
WithComplexityExtensionName specifies complexity extension name
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
func Middleware ¶
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.