Documentation ¶
Index ¶
- Variables
- func AppendToOutgoingGRPCContext(ctx context.Context, spanContext trace.SpanContext) context.Context
- func FromContext(ctx context.Context) trace.SpanContext
- func FromGRPCContext(ctx context.Context) (trace.SpanContext, bool)
- func FromOutgoingGRPCContext(ctx context.Context) (trace.SpanContext, bool)
- func GetDefaultSpanContext(spec config.TracingSpec) trace.SpanContext
- func GetSpanContextFromGRPC(ctx context.Context, spec config.TracingSpec) trace.SpanContext
- func GetSpanContextFromRequestContext(ctx *fasthttp.RequestCtx, spec config.TracingSpec) trace.SpanContext
- func InitMetrics(appID string) error
- func NewContext(ctx context.Context, spanContext trace.SpanContext) context.Context
- func SetTracingSpanContextFromHTTPContext(next fasthttp.RequestHandler, spec config.TracingSpec) fasthttp.RequestHandler
- func SetTracingSpanContextGRPCMiddlewareStream(spec config.TracingSpec) grpc.StreamServerInterceptor
- func SetTracingSpanContextGRPCMiddlewareUnary(spec config.TracingSpec) grpc.UnaryServerInterceptor
- func SpanContextFromRequest(req *fasthttp.Request) (sc trace.SpanContext, ok bool)
- func SpanContextFromString(h string) (sc trace.SpanContext, ok bool)
- func SpanContextToRequest(sc trace.SpanContext, req *fasthttp.Request)
- func SpanContextToString(sc trace.SpanContext) string
- func StartTracingClientSpanFromGRPCContext(ctx context.Context, method string, spec config.TracingSpec) (context.Context, *trace.Span)
- func StartTracingClientSpanFromHTTPContext(ctx context.Context, req *fasthttp.Request, method string, ...) (context.Context, *trace.Span)
- func StartTracingServerSpanFromGRPCContext(ctx context.Context, method string, spec config.TracingSpec) (context.Context, *trace.Span)
- func UpdateSpanPairStatusesFromError(span *trace.Span, err error, method string)
- func UpdateSpanStatus(span *trace.Span, spanName string, code int)
- type DaprTraceContextKey
Constants ¶
This section is empty.
Variables ¶
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
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
InitMetrics initializes metrics
func NewContext ¶ added in v0.7.0
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
UpdateSpanPairStatusesFromError updates tracer span statuses based on error object
Types ¶
type DaprTraceContextKey ¶ added in v0.7.0
type DaprTraceContextKey struct{}