Documentation ¶
Index ¶
- func KeyValAdd(kv *KeyVal, key string, value string)
- func KeyValToInterfaceMap(kv *KeyVal) map[string]interface{}
- func MergeKeyVal(target *KeyVal, source *KeyVal)
- func MergeKeyValWithPrefix(target *KeyVal, source *KeyVal, prefix string)
- func ReadSourceMapFromFS(dir string, path string) ([]byte, error)
- type App
- type Browser
- type CtxVector
- type Exception
- type Frame
- type FrontendGrafanaJavascriptAgentEvent
- type FrontendSentryEvent
- type FrontendSentryException
- type FrontendSentryExceptionValue
- type KeyVal
- type Log
- type LogContext
- type LogLevel
- type Measurement
- type Meta
- type Page
- type Payload
- type ReadSourceMapFn
- type SDK
- type SDKIntegration
- type Session
- type SourceMapStore
- type Stacktrace
- type TraceContext
- type Traces
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyValToInterfaceMap ¶
KeyValToInterfaceMap converts KeyVal to map[string]interface
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"` 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 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"` }
Exception struct controls all the data regarding an exception
func TransformException ¶
func TransformException(ex *Exception, store *SourceMapStore) *Exception
TransformException will attempt to resolved all monified source locations in the stacktrace with original source locations
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
func ResolveSourceLocation ¶
func ResolveSourceLocation(store *SourceMapStore, frame *Frame) (*Frame, error)
ResolveSourceLocation resolves minified source location to original source location
type FrontendGrafanaJavascriptAgentEvent ¶
type FrontendGrafanaJavascriptAgentEvent struct { Exceptions []Exception `json:"exceptions,omitempty"` Logs []Log `json:"logs,omitempty"` Measurements []Measurement `json:"measurements,omitempty"` Meta Meta `json:"meta,omitempty"` Traces *Traces `json:"traces,omitempty"` }
func (*FrontendGrafanaJavascriptAgentEvent) AddMetaToContext ¶
func (event *FrontendGrafanaJavascriptAgentEvent) AddMetaToContext(ctx CtxVector) []interface{}
type FrontendSentryEvent ¶
type FrontendSentryEvent struct { *sentry.Event Exception *FrontendSentryException `json:"exception,omitempty"` }
func (*FrontendSentryEvent) MarshalJSON ¶
func (event *FrontendSentryEvent) MarshalJSON() ([]byte, error)
func (*FrontendSentryEvent) ToLogContext ¶
func (event *FrontendSentryEvent) ToLogContext(store *SourceMapStore) []interface{}
type FrontendSentryException ¶
type FrontendSentryException struct {
Values []FrontendSentryExceptionValue `json:"values,omitempty"`
}
func (*FrontendSentryException) FmtStacktraces ¶
func (exception *FrontendSentryException) FmtStacktraces(store *SourceMapStore) string
type FrontendSentryExceptionValue ¶
type FrontendSentryExceptionValue struct { Value string `json:"value,omitempty"` Type string `json:"type,omitempty"` Stacktrace sentry.Stacktrace `json:"stacktrace,omitempty"` }
func (*FrontendSentryExceptionValue) FmtMessage ¶
func (value *FrontendSentryExceptionValue) FmtMessage() string
func (*FrontendSentryExceptionValue) FmtStacktrace ¶
func (value *FrontendSentryExceptionValue) FmtStacktrace(store *SourceMapStore) string
type KeyVal ¶
type KeyVal = om.OrderedMap
KeyVal is an ordered map of string to interface
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
func (Log) KeyValContext ¶
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 = "warn" // LogLevelError is "error" LogLevelError LogLevel = "error" )
type Measurement ¶
type Measurement struct { Values map[string]float64 `json:"values,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` Trace TraceContext `json:"trace,omitempty"` Type string `json:"type,omitempty"` }
Measurement holds the data for user provided measurements
func (Measurement) KeyVal ¶
func (m Measurement) KeyVal() *KeyVal
KeyVal representation of the Measurement object
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"` }
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"` 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 SourceMapStore ¶
func NewSourceMapStore ¶
func NewSourceMapStore(cfg *setting.Cfg, routeResolver plugins.StaticRouteResolver, readSourceMap ReadSourceMapFn) *SourceMapStore
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.