traceutils

package
v1.3.191 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestServer

func NewTestServer(t *testing.T, callback func(pdata.Traces)) string

NewTestServer creates a new Server for testing, where received traces will call the callback function. The returned string is the address where traces can be sent using OTLP.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a Tracing testing server that invokes a function every time a span is received.

func NewServer

func NewServer(addr string, callback func(pdata.Traces)) (*Server, error)

NewServer creates an OTLP-accepting server that calls a function when a trace is received. This is primarily useful for testing.

func NewServerWithRandomPort

func NewServerWithRandomPort(callback func(pdata.Traces)) (srv *Server, addr string, err error)

NewServerWithRandomPort calls NewServer with a random port >49152 and <65535. It will try up to five times before failing.

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the testing server.

Jump to

Keyboard shortcuts

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