diagnostics

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MIT Imports: 27 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KeyServerMethod = tag.MustNewKey("grpc_server_method")
	KeyServerStatus = tag.MustNewKey("grpc_server_status")

	KeyClientMethod = tag.MustNewKey("grpc_client_method")
	KeyClientStatus = tag.MustNewKey("grpc_client_status")
)

Tag key definitions for http requests

View Source
var (
	// DefaultReportingPeriod is the default view reporting period
	DefaultReportingPeriod = 1 * time.Minute

	// DefaultMonitoring holds service monitoring metrics definitions
	DefaultMonitoring = newServiceMetrics()
	// DefaultGRPCMonitoring holds default gRPC monitoring handlers and middleswares
	DefaultGRPCMonitoring = newGRPCMetrics()
	// DefaultHTTPMonitoring holds default HTTP monitoring handlers and middleswares
	DefaultHTTPMonitoring = newHTTPMetrics()
)

Functions

func AppendToOutgoingGRPCContext added in v0.7.0

func AppendToOutgoingGRPCContext(ctx context.Context, spanContext trace.SpanContext) context.Context

AppendToOutgoingGRPCContext appends binary serialized SpanContext to the outgoing GRPC context

func FromContext added in v0.7.0

func FromContext(ctx context.Context) trace.SpanContext

FromContext returns the SpanContext stored in a context, or nil if there isn't one.

func FromGRPCContext added in v0.7.0

func FromGRPCContext(ctx context.Context) (trace.SpanContext, bool)

FromGRPCContext returns the SpanContext stored in a context, or empty if there isn't one.

func FromOutgoingGRPCContext added in v0.7.0

func FromOutgoingGRPCContext(ctx context.Context) (trace.SpanContext, bool)

FromOutgoingGRPCContext returns the SpanContext stored in a context, or empty if there isn't one.

func GetDefaultSpanContext added in v0.7.0

func GetDefaultSpanContext(spec config.TracingSpec) trace.SpanContext

GetDefaultSpanContext returns default span context when not provided by the client

func GetSpanContextFromGRPC added in v0.7.0

func GetSpanContextFromGRPC(ctx context.Context, spec config.TracingSpec) trace.SpanContext

func GetSpanContextFromRequestContext added in v0.7.0

func GetSpanContextFromRequestContext(ctx *fasthttp.RequestCtx, spec config.TracingSpec) trace.SpanContext

func InitMetrics added in v0.5.0

func InitMetrics(appID string) error

InitMetrics initializes metrics

func NewContext added in v0.7.0

func NewContext(ctx context.Context, spanContext trace.SpanContext) context.Context

NewContext returns a new context with the given SpanContext attached.

func SetTracingSpanContextFromHTTPContext added in v0.7.0

func SetTracingSpanContextFromHTTPContext(next fasthttp.RequestHandler, spec config.TracingSpec) fasthttp.RequestHandler

SetTracingSpanContextFromHTTPContext sets the trace SpanContext in the request context

func SetTracingSpanContextGRPCMiddlewareStream added in v0.7.0

func SetTracingSpanContextGRPCMiddlewareStream(spec config.TracingSpec) grpc.StreamServerInterceptor

SetTracingSpanContextGRPCMiddlewareStream sets the trace spancontext into gRPC stream

func SetTracingSpanContextGRPCMiddlewareUnary added in v0.7.0

func SetTracingSpanContextGRPCMiddlewareUnary(spec config.TracingSpec) grpc.UnaryServerInterceptor

SetTracingSpanContextGRPCMiddlewareUnary sets the trace spancontext into gRPC unary calls

func SpanContextFromRequest added in v0.7.0

func SpanContextFromRequest(req *fasthttp.Request) (sc trace.SpanContext, ok bool)

SpanContextFromRequest extracts a span context from incoming requests.

func SpanContextFromString added in v0.7.1

func SpanContextFromString(h string) (sc trace.SpanContext, ok bool)

SpanContextFromString extracts a span context from given string which got earlier from SpanContextToString format

func SpanContextToRequest added in v0.7.0

func SpanContextToRequest(sc trace.SpanContext, req *fasthttp.Request)

SpanContextToRequest modifies the given request to include traceparent and tracestate headers.

func SpanContextToString added in v0.7.1

func SpanContextToString(sc trace.SpanContext) string

SpanContextToString returns the SpanContext string representation

func StartTracingClientSpanFromGRPCContext added in v0.7.0

func StartTracingClientSpanFromGRPCContext(ctx context.Context, method string, spec config.TracingSpec) (context.Context, *trace.Span)

StartTracingClientSpanFromGRPCContext creates a client span before invoking gRPC method call

func StartTracingClientSpanFromHTTPContext added in v0.7.0

func StartTracingClientSpanFromHTTPContext(ctx context.Context, req *fasthttp.Request, method string, spec config.TracingSpec) (context.Context, *trace.Span)

StartTracingClientSpanFromHTTPContext creates a client span before invoking http method call

func StartTracingServerSpanFromGRPCContext added in v0.7.0

func StartTracingServerSpanFromGRPCContext(ctx context.Context, method string, spec config.TracingSpec) (context.Context, *trace.Span)

StartTracingServerSpanFromGRPCContext creates a span on receiving an incoming gRPC method call from remote client

func UpdateSpanPairStatusesFromError added in v0.5.0

func UpdateSpanPairStatusesFromError(span *trace.Span, err error, method string)

UpdateSpanPairStatusesFromError updates tracer span statuses based on error object

func UpdateSpanStatus added in v0.7.0

func UpdateSpanStatus(span *trace.Span, spanName string, code int)

UpdateSpanStatus updates trace span status based on response code

Types

type DaprTraceContextKey added in v0.7.0

type DaprTraceContextKey struct{}

Directories

Path Synopsis
mocks
Package mock_helloworld is a generated GoMock package.
Package mock_helloworld is a generated GoMock package.

Jump to

Keyboard shortcuts

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