Documentation ¶
Index ¶
- func GraphQLErrorPresenter(service string) func(ctx context.Context, e error) *gqlerror.Error
- func GraphQLRecoverFunc() graphql.RecoverFunc
- func NewGormPlugin(opts ...PluginOption) gorm.Plugin
- func SetupGORMTracing(db *gorm.DB, attrs ...attribute.KeyValue) error
- type GraphqlTracer
- type PluginOption
- type Tracer
- func (t Tracer) ExtensionName() string
- func (t Tracer) InterceptField(ctx context.Context, next graphql.Resolver) (interface{}, error)
- func (t Tracer) InterceptResponse(ctx context.Context, next graphql.ResponseHandler) *graphql.Response
- func (t Tracer) Validate(graphql.ExecutableSchema) error
- func (t Tracer) WithRequestFieldLogging() GraphqlTracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GraphQLErrorPresenter ¶
func GraphQLRecoverFunc ¶
func GraphQLRecoverFunc() graphql.RecoverFunc
func NewGormPlugin ¶
func NewGormPlugin(opts ...PluginOption) gorm.Plugin
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 (Tracer) InterceptField ¶
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) WithRequestFieldLogging ¶
func (t Tracer) WithRequestFieldLogging() GraphqlTracer
WithRequestFieldLogging configures the tracer to log each graphql operation.
Click to show internal directories.
Click to hide internal directories.