otelwsgraphql

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package otelwsgraphql provides opentelemetry instrumentation for wsgraphql

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultSpanAttributesResolver

func DefaultSpanAttributesResolver(
	_ context.Context,
	payload *apollows.PayloadOperation,
) (attrs []attribute.KeyValue)

DefaultSpanAttributesResolver default span attributes resolver function

func DefaultSpanNameResolver

func DefaultSpanNameResolver(_ context.Context, payload *apollows.PayloadOperation) string

DefaultSpanNameResolver default span name resolver function

func NewOperationInterceptor

func NewOperationInterceptor(options ...OperationOption) wsgraphql.InterceptorOperation

NewOperationInterceptor returns new otel-span reporting wsgraphql operation interceptor

Types

type OperationOption

type OperationOption interface {
	// contains filtered or unexported methods
}

OperationOption provides customizations for operation interceptor

func WithSpanAttributesResolver

func WithSpanAttributesResolver(resolver SpanAttributesResolver) OperationOption

WithSpanAttributesResolver provides custom attribute resolver

func WithSpanNameResolver

func WithSpanNameResolver(resolver SpanNameResolver) OperationOption

WithSpanNameResolver provides custom name resolver

func WithStartSpanOptions

func WithStartSpanOptions(spanOptions ...trace.SpanStartOption) OperationOption

WithStartSpanOptions provides extra starting span options

func WithTracer

func WithTracer(tracer trace.Tracer) OperationOption

WithTracer provides predefined tracer instance

func WithTracerProvider added in v1.5.1

func WithTracerProvider(tracerProvider trace.TracerProvider) OperationOption

WithTracerProvider sets predefined tracer provider instance

type SpanASTAttributesResolver

type SpanASTAttributesResolver func(ctx context.Context, payload *apollows.PayloadOperation) []attribute.KeyValue

SpanASTAttributesResolver determines span attributes from payload operation after AST parsing

type SpanAttributesResolver

type SpanAttributesResolver func(ctx context.Context, payload *apollows.PayloadOperation) []attribute.KeyValue

SpanAttributesResolver determines span attributes from payload operation

type SpanNameResolver

type SpanNameResolver func(ctx context.Context, payload *apollows.PayloadOperation) string

SpanNameResolver determined span name from payload operation

Jump to

Keyboard shortcuts

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