ocgin

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlerFunc

func HandlerFunc(opts ...TraceOption) gin.HandlerFunc

Types

type TraceOption

type TraceOption func(o *TraceOptions)

func WithDefaultAttributes

func WithDefaultAttributes(attrs ...trace.Attribute) TraceOption

WithDefaultAttributes will be set to each span as default.

func WithPublicEndpoint

func WithPublicEndpoint(isPublic bool) TraceOption

func WithSample

func WithSample(f func(c *gin.Context) trace.Sampler) TraceOption

type TraceOptions

type TraceOptions struct {
	// DefaultAttributes will be set to each span as default.
	DefaultAttributes []trace.Attribute

	// IsPublicEndpoint should be set to true for publicly accessible HTTP(S)
	// servers. If true, any trace metadata set on the incoming request will
	// be added as a linked trace instead of being added as a parent of the
	// current trace.
	IsPublicEndpoint bool

	// Sample is applied to the span started by this Handler around each
	// request. default is 0.0001
	Sample func(c *gin.Context) trace.Sampler
}

Jump to

Keyboard shortcuts

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