sampler

package
v0.0.0-...-62fb702 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook struct {
	sampler.Sampler
}

Hook is a types.Hook implementation which samples the spans. This is supposed to be used for performance reasons in high performance applications.

Setup example:

import (
	"github.com/facebookincubator/go-belt/pkg/sampler"
	samplerhook "github.com/facebookincubator/go-belt/tool/experimental/tracer/hooks/sampler"
	"github.com/facebookincubator/go-belt/tool/experimental/tracer/implementation/zipkin"
)

func main() {
	...
	ctx = tracer.CtxWithTracer(ctx, zipkin.New(zipkinClient).WithPreHooks(
		samplerhook.NewSamplerPreHook(sampler.RandomSampler(0.1)),
	))
	...
}

func (*Hook) Flush

func (hook *Hook) Flush()

Flush implements tracer.Hook

func (*Hook) ProcessSpan

func (hook *Hook) ProcessSpan(span tracer.Span) bool

ProcessSpan implements tracer.Hook

Jump to

Keyboard shortcuts

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