tracer

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const AwsServiceKey = "aws.service"
View Source
const EpsagonHTTPTraceIDKey = "http_trace_id"
View Source
const EpsagonRequestTraceIDKey = "request_trace_id"
View Source
const IsTrimmedKey = "is_trimmed"
View Source
const LabelsKey = "labels"
View Source
const MaxLabelsSize = 10 * 1024

MaxLabelsSize is the maximum allowed total labels size (in bytes)

View Source
const MaxTraceSize = 64 * 1024

MaxTraceSize is the maximum allowed trace size (in bytes)

View Source
const VERSION = "1.14.0"

VERSION is Epsagon tracer version

Variables

This section is empty.

Functions

func AddEvent

func AddEvent(event *protocol.Event)

AddEvent adds an event to the tracer

func AddException

func AddException(exception *protocol.Exception)

AddException adds an exception to the tracer

func AddLabel added in v1.6.0

func AddLabel(key string, value interface{})

AddLabel adds a label to the tracer

func GetTimestamp

func GetTimestamp() float64

GetTimestamp returns the current time in miliseconds

func HandleSendTracesResponse

func HandleSendTracesResponse(resp *http.Response, err error)

HandleSendTracesResponse handles responses from the trace collector

func StopGlobalTracer added in v1.4.0

func StopGlobalTracer()

StopTracer will close the tracer and send all the data to the collector

Types

type Config

type Config struct {
	ApplicationName string // Application name in Epsagon
	Token           string // Epsgaon Token
	CollectorURL    string // Epsagon collector url
	MetadataOnly    bool   // Only send metadata about the event
	Debug           bool   // Print Epsagon debug information
	SendTimeout     string // Timeout for sending traces to Epsagon
	Disable         bool   // Disable sending traces
}

Config is the configuration for Epsagon's tracer

func GetGlobalTracerConfig

func GetGlobalTracerConfig() *Config

GetGlobalTracerConfig returns the configuration of the global tracer

type EpsagonLabel added in v1.6.0

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

type MockedEpsagonTracer

type MockedEpsagonTracer struct {
	Exceptions *[]*protocol.Exception
	Events     *[]*protocol.Event
	Config     *Config

	PanicStart        bool
	PanicAddEvent     bool
	PanicAddException bool
	PanicStop         bool
}

MockedEpsagonTracer will not send traces if closed

func (*MockedEpsagonTracer) AddError added in v1.6.0

func (t *MockedEpsagonTracer) AddError(errorType string, value interface{})

AddLabel implements AddError

func (*MockedEpsagonTracer) AddEvent

func (t *MockedEpsagonTracer) AddEvent(e *protocol.Event)

AddEvent implementes mocked AddEvent

func (*MockedEpsagonTracer) AddException

func (t *MockedEpsagonTracer) AddException(e *protocol.Exception)

AddException implementes mocked AddEvent

func (*MockedEpsagonTracer) AddExceptionTypeAndMessage added in v1.2.0

func (t *MockedEpsagonTracer) AddExceptionTypeAndMessage(exceptionType, msg string)

AddExceptionTypeAndMessage implements AddExceptionTypeAndMessage

func (*MockedEpsagonTracer) AddLabel added in v1.6.0

func (t *MockedEpsagonTracer) AddLabel(key string, value interface{})

AddLabel implements AddLabel

func (*MockedEpsagonTracer) GetConfig

func (t *MockedEpsagonTracer) GetConfig() *Config

GetConfig implementes mocked AddEvent

func (*MockedEpsagonTracer) Running

func (t *MockedEpsagonTracer) Running() bool

Running implementes mocked Running

func (*MockedEpsagonTracer) Start

func (t *MockedEpsagonTracer) Start()

Start implementes mocked Start

func (*MockedEpsagonTracer) Stop

func (t *MockedEpsagonTracer) Stop()

Stop implementes mocked Stop

func (*MockedEpsagonTracer) Stopped

func (t *MockedEpsagonTracer) Stopped() bool

Stopped implementes mocked Stopped

type Tracer

type Tracer interface {
	AddEvent(*protocol.Event)
	AddException(*protocol.Exception)
	AddExceptionTypeAndMessage(string, string)
	AddLabel(string, interface{})
	AddError(string, interface{})
	Start()
	Running() bool
	Stop()
	Stopped() bool
	GetConfig() *Config
}

Tracer is what a general program tracer had to provide

var (

	// GlobalTracer A global Tracer for all internal uses
	GlobalTracer Tracer
)

func CreateGlobalTracer added in v1.4.0

func CreateGlobalTracer(config *Config) Tracer

CreateTracer will initiallize a global epsagon tracer

func CreateTracer

func CreateTracer(config *Config) Tracer

CreateTracer will initiallize a new epsagon tracer

Jump to

Keyboard shortcuts

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