Documentation ¶
Index ¶
- Constants
- Variables
- func DeserializeSpanContext(ctx string) trace.SpanContext
- func DeserializeSpanContextPointer(ctx string) *trace.SpanContext
- func InitMetrics(appID string) error
- func ProjectStatusCode(code int) int32
- func SerializeSpanContext(ctx trace.SpanContext) string
- func TraceSpanFromFastHTTPContext(c *fasthttp.RequestCtx, spec config.TracingSpec) (TracerSpan, TracerSpan)
- func TraceSpanFromFastHTTPRequest(r *fasthttp.Request, spec config.TracingSpec) (TracerSpan, TracerSpan)
- func TracingGRPCMiddlewareStream(spec config.TracingSpec) grpc_go.StreamServerInterceptor
- func TracingGRPCMiddlewareUnary(spec config.TracingSpec) grpc_go.UnaryServerInterceptor
- func TracingHTTPMiddleware(spec config.TracingSpec, next fasthttp.RequestHandler) fasthttp.RequestHandler
- func TracingSpanFromGRPCContext(c context.Context, req interface{}, method string, spec config.TracingSpec) (TracerSpan, TracerSpan)
- func UpdateSpanPairStatusesFromError(span, spanc TracerSpan, err error, method string)
- func UpdateSpanPairStatusesFromHTTPResponse(span, spanc TracerSpan, resp *fasthttp.Response)
- type TracerSpan
Constants ¶
const (
// CorrelationID is the header key name of correlation id for trace
CorrelationID = "X-Correlation-ID"
)
Variables ¶
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 DeserializeSpanContext ¶
func DeserializeSpanContext(ctx string) trace.SpanContext
DeserializeSpanContext deserializes a span context from a string
func DeserializeSpanContextPointer ¶
func DeserializeSpanContextPointer(ctx string) *trace.SpanContext
DeserializeSpanContextPointer deserializes a span context from a trace pointer
func InitMetrics ¶ added in v0.5.0
InitMetrics initializes metrics
func ProjectStatusCode ¶ added in v0.5.0
func SerializeSpanContext ¶
func SerializeSpanContext(ctx trace.SpanContext) string
SerializeSpanContext serializes a span context into a simple string
func TraceSpanFromFastHTTPContext ¶
func TraceSpanFromFastHTTPContext(c *fasthttp.RequestCtx, spec config.TracingSpec) (TracerSpan, TracerSpan)
TraceSpanFromFastHTTPContext creates a tracing span form a fasthttp request context
func TraceSpanFromFastHTTPRequest ¶ added in v0.5.0
func TraceSpanFromFastHTTPRequest(r *fasthttp.Request, spec config.TracingSpec) (TracerSpan, TracerSpan)
TraceSpanFromFastHTTPRequest creates a tracing span form a fasthttp request
func TracingGRPCMiddlewareStream ¶ added in v0.5.0
func TracingGRPCMiddlewareStream(spec config.TracingSpec) grpc_go.StreamServerInterceptor
TracingGRPCMiddlewareStream plugs tracer into gRPC stream
func TracingGRPCMiddlewareUnary ¶
func TracingGRPCMiddlewareUnary(spec config.TracingSpec) grpc_go.UnaryServerInterceptor
TracingGRPCMiddlewareUnary plugs tracer into gRPC unary calls
func TracingHTTPMiddleware ¶
func TracingHTTPMiddleware(spec config.TracingSpec, next fasthttp.RequestHandler) fasthttp.RequestHandler
TracingHTTPMiddleware plugs tracer into fasthttp pipeline
func TracingSpanFromGRPCContext ¶
func TracingSpanFromGRPCContext(c context.Context, req interface{}, method string, spec config.TracingSpec) (TracerSpan, TracerSpan)
TracingSpanFromGRPCContext creates a span from an incoming gRPC method call
func UpdateSpanPairStatusesFromError ¶ added in v0.5.0
func UpdateSpanPairStatusesFromError(span, spanc TracerSpan, err error, method string)
UpdateSpanPairStatusesFromError updates tracer span statuses based on error object
func UpdateSpanPairStatusesFromHTTPResponse ¶ added in v0.5.0
func UpdateSpanPairStatusesFromHTTPResponse(span, spanc TracerSpan, resp *fasthttp.Response)
UpdateSpanPairStatusesFromHTTPResponse updates tracer span statuses based on HTTP response
Types ¶
type TracerSpan ¶
TracerSpan defines a tracing span that a tracer users to keep track of call scopes