traceutils

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 21 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(ptrace.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(ptrace.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(ptrace.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