oteltracing

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package oteltracing provides a gqlgen middleware that adds otel tracing.

You can use it like:

srv := handler.New(es)
srv.Use(oteltracing.Tracer{})

If you would like spans for every field in the response you can enable FieldSpans:

srv := handler.New(es)
srv.Use(oteltracing.Tracer{FieldSpans: true})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracer

type Tracer struct {
	// FieldSpans allow you to enable a span for each field in the response
	FieldSpans bool
}

Tracer provides an otel tracer for gqlgen servers

func (Tracer) ExtensionName

func (Tracer) ExtensionName() string

ExtensionName returns the name of this extension

func (Tracer) InterceptField

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

InterceptField adds the middleware that lets us add traces to each field of a request

func (Tracer) Validate

Validate is required to meet HandlerExtension interface

Jump to

Keyboard shortcuts

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