gqlgen_opentelemetry

package module
v0.0.0-...-aaaa1d1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 6 Imported by: 0

README

OpenTelemetry instrumentation for gqlgen

This library provides OpenTelemetry (OTEL) instrumentation for gqlgen server requests.

Usage

Add the gqlgen_opentelemetry.Tracer extension to your server:

h := handler.NewDefaultServer(schema)
h.Use(gqlgen_opentelemetry.Tracer{
    Tracer: tracerProvider.Tracer("my-service"),
})

Options

The following options are available on the extension:

IncludeVariables: Whether to include variables and their values in the trace span attributes. (Default: false)

Tracer: The OTEL tracer to use. If none is provided, a no-op tracer will be used.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracer

type Tracer struct {
	IncludeVariables bool
	Tracer           trace.Tracer
}

func (Tracer) ExtensionName

func (Tracer) ExtensionName() string

func (Tracer) InterceptField

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

func (Tracer) InterceptOperation

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

func (Tracer) Validate

func (t Tracer) Validate(schema graphql.ExecutableSchema) error

Jump to

Keyboard shortcuts

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