htrace

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphQLErrorPresenter added in v0.10.1

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

func GraphQLRecoverFunc added in v0.10.1

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 added in v0.10.1

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

func NewGraphqlTracer added in v0.10.1

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 added in v0.10.1

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

func (Tracer) ExtensionName added in v0.10.1

func (t Tracer) ExtensionName() string

func (Tracer) InterceptField added in v0.10.1

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

InterceptField instruments timing of individual fields resolved.

func (Tracer) InterceptResponse added in v0.10.1

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 added in v0.10.1

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

func (Tracer) WithRequestFieldLogging added in v0.10.1

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