trace

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphQLErrorPresenter

func GraphQLErrorPresenter(service string) func(ctx context.Context, e error) *gqlerror.Error

func GraphQLRecoverFunc

func GraphQLRecoverFunc() graphql.RecoverFunc

func NewGormPlugin

func NewGormPlugin(opts ...PluginOption) gorm.Plugin

func SetupGORMTracing

func SetupGORMTracing(db *gorm.DB, attrs ...attribute.KeyValue) error

Types

type GraphqlTracer

type GraphqlTracer interface {
	graphql.HandlerExtension
	graphql.ResponseInterceptor
	graphql.FieldInterceptor
	WithRequestFieldLogging() GraphqlTracer
}

func NewGraphqlTracer

func NewGraphqlTracer(graphName string) GraphqlTracer

type PluginOption

type PluginOption func(p *otelPlugin)

func WithGormAttributes

func WithGormAttributes(attrs ...attribute.KeyValue) PluginOption

WithGormAttributes configures attributes that are used to create a span.

func WithGormDBName

func WithGormDBName(name string) PluginOption

WithGormDBName configures a db.name attribute.

func WithoutGormQueryVariables

func WithoutGormQueryVariables() PluginOption

WithoutGormQueryVariables configures the db.statement attribute to exclude query variables

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

func (Tracer) ExtensionName

func (t Tracer) ExtensionName() string

func (Tracer) InterceptField

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

InterceptField instruments timing of individual fields resolved.

func (Tracer) InterceptResponse

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

InterceptResponse instruments timing, payload size, and error information of the response handler. The metric is grouped by the corresponding operation name.

func (Tracer) Validate

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

func (Tracer) WithRequestFieldLogging

func (t Tracer) WithRequestFieldLogging() GraphqlTracer

WithRequestFieldLogging configures the tracer to log each graphql operation.

Jump to

Keyboard shortcuts

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