Documentation
¶
Index ¶
- func KeyValAdd(kv *KeyVal, key string, value string)
- func KeyValToInterfaceMap(kv *KeyVal) map[string]interface{}
- func KeyValToInterfaceSlice(kv *KeyVal) []interface{}
- func MergeKeyVal(target *KeyVal, source *KeyVal)
- func MergeKeyValWithPrefix(target *KeyVal, source *KeyVal, prefix string)
- type App
- type Browser
- type Event
- type Exception
- type ExceptionContext
- type Frame
- type KeyVal
- type Log
- type LogContext
- type LogLevel
- type Measurement
- type MeasurementContext
- type Meta
- type Page
- type Payload
- type SDK
- type SDKIntegration
- type Session
- type Stacktrace
- type TraceContext
- type Traces
- type User
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyValToInterfaceMap ¶
KeyValToInterfaceMap converts KeyVal to map[string]interface
func KeyValToInterfaceSlice ¶
func KeyValToInterfaceSlice(kv *KeyVal) []interface{}
KeyValToInterfaceSlice converts KeyVal to []interface{}, typically used for logging
func MergeKeyVal ¶
MergeKeyVal will merge source in target
func MergeKeyValWithPrefix ¶
MergeKeyValWithPrefix will merge source in target, adding a prefix to each key being merged in
Types ¶
type App ¶
type App struct {
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
Release string `json:"release,omitempty"`
Version string `json:"version,omitempty"`
Environment string `json:"environment,omitempty"`
}
App holds metadata about the application event originates from
type Browser ¶
type Browser struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
OS string `json:"os,omitempty"`
Mobile bool `json:"mobile,omitempty"`
}
Browser holds metadata about a client's browser
type Event ¶
type Event struct {
Name string `json:"name"`
Domain string `json:"domain,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
Timestamp time.Time `json:"timestamp,omitempty"`
Trace TraceContext `json:"trace,omitempty"`
}
Event holds RUM event data
type Exception ¶
type Exception struct {
Type string `json:"type,omitempty"`
Value string `json:"value,omitempty"`
Stacktrace *Stacktrace `json:"stacktrace,omitempty"`
Timestamp time.Time `json:"timestamp"`
Trace TraceContext `json:"trace,omitempty"`
Context ExceptionContext `json:"context,omitempty"`
}
Exception struct controls all the data regarding an exception
type ExceptionContext ¶
ExceptionContext is a string to string map structure that represents the context of an exception
type Frame ¶
type Frame struct {
Function string `json:"function,omitempty"`
Module string `json:"module,omitempty"`
Filename string `json:"filename,omitempty"`
Lineno int `json:"lineno,omitempty"`
Colno int `json:"colno,omitempty"`
}
Frame struct represents a single stacktrace frame
type KeyVal ¶
type KeyVal = om.OrderedMap
KeyVal is an ordered map of string to interface
func KeyValFromFloatMap ¶ added in v1.2.0
KeyValFromMap will instantiate KeyVal from a map[string]float64
func KeyValFromMap ¶
KeyValFromMap will instantiate KeyVal from a map[string]string
func SpanToKeyVal ¶
SpanToKeyVal returns KeyVal representation of a Span.
type Log ¶
type Log struct {
Message string `json:"message,omitempty"`
LogLevel LogLevel `json:"level,omitempty"`
Context LogContext `json:"context,omitempty"`
Timestamp time.Time `json:"timestamp"`
Trace TraceContext `json:"trace,omitempty"`
}
Log struct controls the data that come into a Log message
type LogContext ¶
LogContext is a string to string map structure that represents the context of a log message
type LogLevel ¶
type LogLevel string
LogLevel is log level enum for incoming app logs
const ( // LogLevelTrace is "trace" LogLevelTrace LogLevel = "trace" // LogLevelDebug is "debug" LogLevelDebug LogLevel = "debug" // LogLevelInfo is "info" LogLevelInfo LogLevel = "info" // LogLevelWarning is "warning" LogLevelWarning LogLevel = "warning" // LogLevelError is "error" LogLevelError LogLevel = "error" )
type Measurement ¶
type Measurement struct {
Type string `json:"type,omitempty"`
Values map[string]float64 `json:"values,omitempty"`
Timestamp time.Time `json:"timestamp,omitempty"`
Trace TraceContext `json:"trace,omitempty"`
Context MeasurementContext `json:"context,omitempty"`
}
Measurement holds the data for user provided measurements
func (Measurement) KeyVal ¶
func (m Measurement) KeyVal() *KeyVal
KeyVal representation of the measurement object
type MeasurementContext ¶
MeasurementContext is a string to string map structure that represents the context of a log message
type Meta ¶
type Meta struct {
SDK SDK `json:"sdk,omitempty"`
App App `json:"app,omitempty"`
User User `json:"user,omitempty"`
Session Session `json:"session,omitempty"`
Page Page `json:"page,omitempty"`
Browser Browser `json:"browser,omitempty"`
View View `json:"view,omitempty"`
}
Meta holds metadata about an app event
type Page ¶
type Page struct {
ID string `json:"id,omitempty"`
URL string `json:"url,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
}
Page holds metadata about the web page event originates from
type Payload ¶
type Payload struct {
Exceptions []Exception `json:"exceptions,omitempty"`
Logs []Log `json:"logs,omitempty"`
Measurements []Measurement `json:"measurements,omitempty"`
Events []Event `json:"events,omitempty"`
Meta Meta `json:"meta,omitempty"`
Traces *Traces `json:"traces,omitempty"`
}
Payload is the body of the receiver request
type SDK ¶
type SDK struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Integrations []SDKIntegration `json:"integrations,omitempty"`
}
SDK holds metadata about the app agent that produced the event
type SDKIntegration ¶
type SDKIntegration struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
}
SDKIntegration holds metadata about a plugin/integration on the app agent that collected and sent the event
func (SDKIntegration) String ¶
func (i SDKIntegration) String() string
type Session ¶
type Session struct {
ID string `json:"id,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
}
Session holds metadata about the browser session the event originates from
type Stacktrace ¶
type Stacktrace struct {
Frames []Frame `json:"frames,omitempty"`
}
Stacktrace is a collection of Frames
type TraceContext ¶
TraceContext holds trace id and span id associated to an entity (log, exception, measurement...).
func (TraceContext) KeyVal ¶
func (tc TraceContext) KeyVal() *KeyVal
KeyVal representation of the trace context object.
type Traces ¶
Traces wraps the otel traces model.
func (Traces) MarshalJSON ¶
MarshalJSON marshals Traces model to json.
func (*Traces) UnmarshalJSON ¶
UnmarshalJSON unmarshals Traces model.