instrumentation

package
v0.2.1-0...-d3ae3b1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServiceName is our Jaeger and Prometheus service names.
	ServiceName = "CRI-RM"
)

Variables

This section is empty.

Functions

func ConfigureTracing

func ConfigureTracing(tc TraceConfig) error

ConfigureTracing configures Jaeger-tracing.

func GetHTTPMux

func GetHTTPMux() *http.ServeMux

GetHTTPMux get our singleton HTTP request multiplexer for instrumentation.

func GetHTTPServer

func GetHTTPServer() *http.Server

GetHTTPServer returns our singleton HTTP server.

func HTTPClose

func HTTPClose() error

HTTPClose Close()'s our HTTP server.

func HTTPShutdown

func HTTPShutdown() error

HTTPShutdown does a graceful Shutdown() of our HTTP server.

func HTTPStart

func HTTPStart() error

HTTPStart starts our HTTP server.

func InjectGrpcClientTrace

func InjectGrpcClientTrace(opts ...grpc.DialOption) []grpc.DialOption

InjectGrpcClientTrace injects gRPC dial options for instrumentation if necessary.

func InjectGrpcServerTrace

func InjectGrpcServerTrace(opts ...grpc.ServerOption) []grpc.ServerOption

InjectGrpcServerTrace injects gRPC server options for instrumentation if necessary.

func RegisterGatherer

func RegisterGatherer(g prom.Gatherer)

RegisterGatherer registers a new prometheus Gatherer.

func Start

func Start() error

Start sets up instrumentation (tracing, metrics collection, etc.).

func Stop

func Stop()

Stop shuts down instrumentation.

func TracingEnabled

func TracingEnabled() bool

TracingEnabled returns true if the tracing sampler is not disabled.

Types

type TraceConfig

type TraceConfig float64

TraceConfig represents a pre-defined instrumentation configuration.

const (
	// Disabled is the trace configuration for disabling tracing.
	Disabled TraceConfig = 0.0
	// Production is a trace configuration for production use.
	Production TraceConfig = 0.1
	// Testing is a trace configuration for testing.
	Testing TraceConfig = 1.0
	// Full is the trace configuration for full probabilistic sampling.
	Full TraceConfig = 1.0
)

func (TraceConfig) MarshalJSON

func (tc TraceConfig) MarshalJSON() ([]byte, error)

MarshalJSON is the JSON marshaller for TraceConfig values.

func (TraceConfig) Sampler

func (tc TraceConfig) Sampler() trace.Sampler

Sampler returns a trace.Sampler corresponding to the TraceConfig value.

func (TraceConfig) String

func (tc TraceConfig) String() string

Sampler returns a trace.Sampler corresponding to the TraceConfig value.

func (*TraceConfig) UnmarshalJSON

func (tc *TraceConfig) UnmarshalJSON(raw []byte) error

UnmarshalJSON is the JSON unmarshaller for TraceConfig values.

Jump to

Keyboard shortcuts

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