gqlgen_opentelemetry

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 9 Imported by: 0

README

OpenTelemetry instrumentation for gqlgen

Build Status Go Reference

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

Installation

Add the package to your project:

go get github.com/zhevron/gqlgen-opentelemetry

Usage

Add the gqlgen_opentelemetry.Tracer extension to your server:

h := handler.NewDefaultServer(schema)
h.Use(gqlgen_opentelemetry.Tracer{})

Options

The following options are available on the extension:

IncludeFieldSpans: Whether to create an additional child span for each field requested. (Default: false)

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, the global OTEL tracer provider 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 {
	IncludeFieldSpans bool
	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) InterceptResponse added in v1.0.4

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

func (Tracer) Validate

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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