Documentation ¶
Index ¶
- Constants
- func AddEvent(event *protocol.Event)
- func AddException(exception *protocol.Exception)
- func AddLabel(key string, value interface{})
- func GetTimestamp() float64
- func HandleSendTracesResponse(resp *http.Response, err error)
- func StopGlobalTracer()
- type Config
- type EpsagonLabel
- type MockedEpsagonTracer
- func (t *MockedEpsagonTracer) AddError(errorType string, value interface{})
- func (t *MockedEpsagonTracer) AddEvent(e *protocol.Event)
- func (t *MockedEpsagonTracer) AddException(e *protocol.Exception)
- func (t *MockedEpsagonTracer) AddExceptionTypeAndMessage(exceptionType, msg string)
- func (t *MockedEpsagonTracer) AddLabel(key string, value interface{})
- func (t *MockedEpsagonTracer) GetConfig() *Config
- func (t *MockedEpsagonTracer) Running() bool
- func (t *MockedEpsagonTracer) Start()
- func (t *MockedEpsagonTracer) Stop()
- func (t *MockedEpsagonTracer) Stopped() bool
- type Tracer
Constants ¶
const AwsServiceKey = "aws.service"
const EpsagonHTTPTraceIDKey = "http_trace_id"
const EpsagonRequestTraceIDKey = "request_trace_id"
const IsTrimmedKey = "is_trimmed"
const LabelsKey = "labels"
const MaxLabelsSize = 10 * 1024
MaxLabelsSize is the maximum allowed total labels size (in bytes)
const MaxTraceSize = 64 * 1024
MaxTraceSize is the maximum allowed trace size (in bytes)
const VERSION = "1.14.0"
VERSION is Epsagon tracer version
Variables ¶
This section is empty.
Functions ¶
func AddException ¶
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 ¶
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
CreateTracer will initiallize a global epsagon tracer
func CreateTracer ¶
CreateTracer will initiallize a new epsagon tracer