Documentation ¶
Index ¶
- Constants
- Variables
- func End(span trace.Span)
- func EndWithErrorStatus(span trace.Span, err error)
- func EndWithStatusCode(span trace.Span, statusCode int)
- func Init(version string)
- func NewNoopSpan() trace.Span
- type Identity
- type InMemoryClient
- type InMemoryOtlpClient
- func (mc *InMemoryOtlpClient) ExportProtoSpans() ([]byte, error)
- func (mc *InMemoryOtlpClient) Spans() (string, error)
- func (mc *InMemoryOtlpClient) Start(_ context.Context) error
- func (mc *InMemoryOtlpClient) Stop(_ context.Context) error
- func (mc *InMemoryOtlpClient) UploadTraces(_ context.Context, protoSpans []*tracepb.ResourceSpans) error
- type NoopOtlpClient
- func (mc *NoopOtlpClient) ClearSpans()
- func (mc *NoopOtlpClient) ExportProtoSpans() ([]byte, error)
- func (mc *NoopOtlpClient) Spans() (string, error)
- func (mc *NoopOtlpClient) Start(_ context.Context) error
- func (mc *NoopOtlpClient) Stop(_ context.Context) error
- func (mc *NoopOtlpClient) UploadTraces(_ context.Context, _ []*tracepb.ResourceSpans) error
- type TracedContext
- type TracedHTTPRequest
Constants ¶
const ( TracerContextName = "cf-trace-id" TracerContextNameOverride = "uber-trace-id" IntNetscaleTracingHeader = "cf-int-netscale-tracing" MaxErrorDescriptionLen = 100 )
const (
// 16 bytes for tracing ID, 8 bytes for span ID and 1 byte for flags
IdentityLength = 16 + 8 + 1
)
const (
MaxTraceAmount = 20
)
Variables ¶
var ( CanonicalNetscaleTracingHeader = http.CanonicalHeaderKey(IntNetscaleTracingHeader) Http2TransportAttribute = trace.WithAttributes(transportAttributeKey.String("http2")) QuicTransportAttribute = trace.WithAttributes(transportAttributeKey.String("quic")) HostOSAttribute = semconv.HostTypeKey.String(runtime.GOOS) HostArchAttribute = semconv.HostArchKey.String(runtime.GOARCH) )
Functions ¶
func EndWithErrorStatus ¶
EndWithErrorStatus will set a status for the span and then end it.
func EndWithStatusCode ¶
EndWithStatusCode will set a status for the span and then end it.
func NewNoopSpan ¶
Types ¶
type Identity ¶
type Identity struct {
// contains filtered or unexported fields
}
func NewIdentity ¶
func (*Identity) MarshalBinary ¶
func (*Identity) String ¶
TODO: TUN-6604 Remove this. To reconstruct into Jaeger propagation format, convert tracingContext to tracing.Identity
func (*Identity) UnmarshalBinary ¶
type InMemoryClient ¶
type InMemoryClient interface { // Spans returns a copy of the list of in-memory stored spans as a base64 // encoded otlp protobuf string. Spans() (string, error) // ExportProtoSpans returns a copy of the list of in-memory stored spans as otlp // protobuf byte array and clears the in-memory spans. ExportProtoSpans() ([]byte, error) }
type InMemoryOtlpClient ¶
type InMemoryOtlpClient struct {
// contains filtered or unexported fields
}
InMemoryOtlpClient is a client implementation for otlptrace.Client
func (*InMemoryOtlpClient) ExportProtoSpans ¶
func (mc *InMemoryOtlpClient) ExportProtoSpans() ([]byte, error)
ProtoSpans returns the list of in-memory stored spans as the protobuf byte array.
func (*InMemoryOtlpClient) Spans ¶
func (mc *InMemoryOtlpClient) Spans() (string, error)
Spans returns the list of in-memory stored spans as a base64 encoded otlp protobuf string.
func (*InMemoryOtlpClient) UploadTraces ¶
func (mc *InMemoryOtlpClient) UploadTraces(_ context.Context, protoSpans []*tracepb.ResourceSpans) error
UploadTraces adds the provided list of spans to the in-memory list.
type NoopOtlpClient ¶
type NoopOtlpClient struct{}
NoopOtlpClient is a client implementation for otlptrace.Client that does nothing
func (*NoopOtlpClient) ClearSpans ¶
func (mc *NoopOtlpClient) ClearSpans()
func (*NoopOtlpClient) ExportProtoSpans ¶
func (mc *NoopOtlpClient) ExportProtoSpans() ([]byte, error)
Spans always returns no traces error
func (*NoopOtlpClient) Spans ¶
func (mc *NoopOtlpClient) Spans() (string, error)
Spans always returns no traces error
func (*NoopOtlpClient) UploadTraces ¶
func (mc *NoopOtlpClient) UploadTraces(_ context.Context, _ []*tracepb.ResourceSpans) error
type TracedContext ¶
func NewTracedContext ¶
NewTracedContext creates a new tracer for the current context.
func (TracedContext) AddSpans ¶
AddSpans assigns spans as base64 encoded protobuf otlp traces to provided HTTP headers.
func (TracedContext) GetProtoSpans ¶
func (cft TracedContext) GetProtoSpans() (proto []byte)
GetProtoSpans returns the spans as the otlp traces in protobuf byte array.
type TracedHTTPRequest ¶
type TracedHTTPRequest struct { *http.Request ConnIndex uint8 // The connection index used to proxy the request // contains filtered or unexported fields }
func NewTracedHTTPRequest ¶
func NewTracedHTTPRequest(req *http.Request, connIndex uint8, log *zerolog.Logger) *TracedHTTPRequest
NewTracedHTTPRequest creates a new tracer for the current HTTP request context.
func (TracedHTTPRequest) AddSpans ¶
AddSpans assigns spans as base64 encoded protobuf otlp traces to provided HTTP headers.
func (TracedHTTPRequest) GetProtoSpans ¶
func (cft TracedHTTPRequest) GetProtoSpans() (proto []byte)
GetProtoSpans returns the spans as the otlp traces in protobuf byte array.
func (TracedHTTPRequest) GetSpans ¶
func (cft TracedHTTPRequest) GetSpans() (enc string)
GetSpans returns the spans as base64 encoded string of protobuf otlp traces.
func (*TracedHTTPRequest) ToTracedContext ¶
func (tr *TracedHTTPRequest) ToTracedContext() *TracedContext