gqlgen_opentelemetry

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

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 10 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)

TracerProvider: The OTEL tracer provider to instantiate a tracer from. 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
	TracerProvider    trace.TracerProvider
}

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

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