fasthttptrace

package
v1.60.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartSpanFromContext

func StartSpanFromContext(fctx *fasthttp.RequestCtx, operationName string, opts ...tracer.StartSpanOption) tracer.Span

StartSpanFromContext returns a new span with the given operation name and options. If a span is found in the `fctx`, it will be used as the parent of the resulting span. The resulting span is then set on the given `fctx`. This function is similar to tracer.StartSpanFromContext, but it modifies the given fasthttp context directly. If the ChildOf option is passed, it will only be used as the parent if there is no span found in `fctx`.

Types

type HTTPHeadersCarrier

type HTTPHeadersCarrier struct {
	ReqHeader *fasthttp.RequestHeader
}

HTTPHeadersCarrier implements tracer.TextMapWriter and tracer.TextMapReader on top of fasthttp's RequestHeader object, allowing it to be used as a span context carrier for distributed tracing.

func (*HTTPHeadersCarrier) ForeachKey

func (f *HTTPHeadersCarrier) ForeachKey(handler func(key, val string) error) error

ForeachKey iterates over fasthttp request header keys and values

func (*HTTPHeadersCarrier) Set

func (f *HTTPHeadersCarrier) Set(key, val string)

Set adds the given value to request header for key. Key will be lowercased to match the metadata implementation.

Jump to

Keyboard shortcuts

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