observe
packagemoduleThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- Constants
- func AddOtelKeyValueInt64(kvs ...*common.KeyValue) *common.KeyValue
- func GetOtelAttrFromSpan(attr string, span *trace.Span) (int, *common.KeyValue)
- func NewOtelKeyValueInt64(key string, value int64) *common.KeyValue
- func NewOtelKeyValueString(key string, value string) *common.KeyValue
- func NewOtelSpan(traceId string, parentId []byte, name string, start, end time.Time) *trace.Span
- type Adapter
- type AdapterBase
- func (b *AdapterBase) HandleTraceEvent(te TraceEvent)
- func (b *AdapterBase) MakeOtelCallSpans(event CallEvent, parentId []byte, traceId string) []*trace.Span
- func (a *AdapterBase) NewTraceCtx(ctx context.Context, r wazero.Runtime, wasm []byte, opts *Options) (*TraceCtx, error)
- func (b *AdapterBase) SetFlusher(f Flusher)
- func (b *AdapterBase) Start(ctx context.Context, a Adapter)
- func (b *AdapterBase) Stop(wait bool)
- type CallEvent
- type CustomEvent
- type Event
- type EventBucket
- type EventKind
- type Flusher
- type LogEvent
- type LogLevel
- type MemoryGrowEvent
- type MetricEvent
- type MetricFormat
- type Options
- type OtelTrace
- type RawEvent
- type RawEventKind
- type SpanFilter
- type SpanTagsEvent
- type TelemetryId
- type TraceCtx
- func (t *TraceCtx) Abort(context.Context, api.Module, api.FunctionDefinition, error)
- func (t *TraceCtx) After(context.Context, api.Module, api.FunctionDefinition, []uint64)
- func (t *TraceCtx) Before(ctx context.Context, _ api.Module, def api.FunctionDefinition, inputs []uint64, ...)
- func (t *TraceCtx) Finish()
- func (t *TraceCtx) Metadata(metadata interface{})
- func (t *TraceCtx) NewFunctionListener(_ api.FunctionDefinition) experimental.FunctionListener
- func (t *TraceCtx) NewListener(def api.FunctionDefinition) experimental.FunctionListener
- func (t *TraceCtx) SetTraceId(id string) error
- type TraceEvent
Constants¶
const (ErrorLogLevel = 1Warn = 2Info = 3Debug = 4)
Variables¶
This section is empty.
Functions¶
Types¶
typeAdapter¶
type Adapter interface {Start(context.Context)Stop(waitbool)HandleTraceEvent(eTraceEvent)}The primary interface that every Adapter needs to followStart() and Stop() can just call the implementations on AdapterBaseor provide some custom logic. HandleTraceEvent is called afteran invocation of a wasm module is done and all events are collected.
typeAdapterBase¶
type AdapterBase struct {TraceEvents chanTraceEvent// contains filtered or unexported fields}Shared implementation for all Adapters
funcNewAdapterBase¶
func NewAdapterBase(batchSizeint, flushPeriodtime.Duration)AdapterBase
func (*AdapterBase)HandleTraceEvent¶
func (b *AdapterBase) HandleTraceEvent(teTraceEvent)
func (*AdapterBase)MakeOtelCallSpans¶
func (b *AdapterBase) MakeOtelCallSpans(eventCallEvent, parentId []byte, traceIdstring) []*trace.Span
MakeOtelCallSpans recursively constructs call spans in open telemetry format
func (*AdapterBase)NewTraceCtx¶
func (*AdapterBase)SetFlusher¶
func (b *AdapterBase) SetFlusher(fFlusher)
func (*AdapterBase)Stop¶
func (b *AdapterBase) Stop(waitbool)
Stops the adapter and waits for all flushes to complete.Set wait parameter to false if you don't want to wait
typeCallEvent¶
type CallEvent struct {Raw []RawEventTimetime.TimeDurationtime.Duration// contains filtered or unexported fields}func (CallEvent)FunctionIndex¶
func (CallEvent)FunctionName¶
typeCustomEvent¶
funcNewCustomEvent¶
func NewCustomEvent(namestring)CustomEvent
func (CustomEvent)RawEvents¶
func (eCustomEvent) RawEvents() []RawEvent
typeEventBucket¶
type EventBucket struct {// contains filtered or unexported fields}EventBucket is a bucket for outgoing TraceEvents.It only schedules flushes when the bucket goes from empty to 1 item.At most the latency to flush the bucket will be flushPeriod.It will also flush the TraceEvents in batches according to batch size
funcNewEventBucket¶
func NewEventBucket(batchSizeint, flushPeriodtime.Duration) *EventBucket
NewEventBucket creates an EventBucket
func (*EventBucket)Wait¶
func (b *EventBucket) Wait()
Wait will block until all pending flushes are done
typeFlusher¶
type Flusher interface {Flush(events []TraceEvent)error}typeMemoryGrowEvent¶
func (MemoryGrowEvent)FunctionIndex¶
func (eMemoryGrowEvent) FunctionIndex()uint32
func (MemoryGrowEvent)FunctionName¶
func (eMemoryGrowEvent) FunctionName()string
func (MemoryGrowEvent)MemoryGrowAmount¶
func (eMemoryGrowEvent) MemoryGrowAmount()uint32
func (MemoryGrowEvent)RawEvents¶
func (eMemoryGrowEvent) RawEvents() []RawEvent
typeMetricEvent¶
type MetricEvent struct {Timetime.TimeFormatMetricFormatMessagestring}func (MetricEvent)RawEvents¶
func (eMetricEvent) RawEvents() []RawEvent
typeOptions¶
type Options struct {SpanFilter *SpanFilterChannelBufferSizeint}Specify options to change what or how the adapter receives ObserveEvents
typeOtelTrace¶
type OtelTrace struct {TraceIdstringTracesData *trace.TracesData}funcNewOtelTrace¶
func (*OtelTrace)SetMetadata¶
func (t *OtelTrace) SetMetadata(te *TraceEvent, meta map[string]string)
typeRawEvent¶
type RawEvent struct {KindRawEventKindStack []experimental.InternalFunctionFunctionIndexuint32FunctionNamestringMemoryGrowAmountuint32Timetime.TimeDurationtime.Duration}Represents the raw event in our Observe form.Events are transformed into vendor specific formatsin the Adapters.
typeRawEventKind¶
type RawEventKindint
const (RawEnterRawEventKind =iotaRawExitRawMemoryGrowRawMetricRawSpanTagsRawLogRawUnknownEvent)
typeSpanFilter¶
Definition of how to filter our Spans to reduce noise
typeSpanTagsEvent¶
func (SpanTagsEvent)RawEvents¶
func (eSpanTagsEvent) RawEvents() []RawEvent
typeTelemetryId¶
type TelemetryId struct {// contains filtered or unexported fields}This is a shared type for a span or trace id.It's represented by 2 uint64s and can be transformedto different string or int representations where needed.
func (*TelemetryId)FromBytes¶
func (t *TelemetryId) FromBytes(id []byte)error
func (*TelemetryId)FromString¶
func (t *TelemetryId) FromString(idstring)error
func (TelemetryId)Lsb¶
func (idTelemetryId) Lsb()uint64
func (TelemetryId)Msb¶
func (idTelemetryId) Msb()uint64
func (TelemetryId)ToHex16¶
func (tTelemetryId) ToHex16()string
Encode this id into a 16 byte hex (32 chars)Uses both 16 byte uint64 values
func (TelemetryId)ToHex8¶
func (tTelemetryId) ToHex8()string
Encode this id into an 8 byte hex (16 chars)Just uses the least significant of the 16 bytes
func (TelemetryId)ToUint64¶
func (tTelemetryId) ToUint64()uint64
Some adapters may need a raw representation
typeTraceCtx¶
type TraceCtx struct {Options *Options// contains filtered or unexported fields}TraceCtx holds the context for a trace, or wasm module invocation.It collects holds a channel to the Adapter and from the wazero ListenerIt will collect events throughout the invocation of the function. CallingFinish() will then submit those events to the Adapter to be processed and sent
func (*TraceCtx)Abort¶
Null implementation of the Abort() method to satisfy the FunctionListener interface.
func (*TraceCtx)After¶
Null implementation of the After() method to satisfy the FunctionListener interface.
func (*TraceCtx)Before¶
func (t *TraceCtx) Before(ctxcontext.Context, _api.Module, defapi.FunctionDefinition, inputs []uint64, stackexperimental.StackIterator)
Implements the Before() method to satisfy the FunctionListener interface.This takes events from the wazero runtime and sends them to the `raw` channel on the TraceCtx.
func (*TraceCtx)Finish¶
func (t *TraceCtx) Finish()
Finish() will stop the trace and send theTraceEvent payload to the adapter
func (*TraceCtx)NewFunctionListener¶
func (t *TraceCtx) NewFunctionListener(_api.FunctionDefinition)experimental.FunctionListener
Implements the NewFunctionListener() method to satisfy the FunctionListener interface
func (*TraceCtx)NewListener¶
func (t *TraceCtx) NewListener(defapi.FunctionDefinition)experimental.FunctionListener
Implements the NewListener() method to satisfy the FunctionListener interface
func (*TraceCtx)SetTraceId¶
typeTraceEvent¶
type TraceEvent struct {Events []EventTelemetryIdTelemetryIdAdapterMeta interface{}}The payload that contains all the Eventsfrom a single wasm module invocation
Source Files¶
Directories¶
| Path | Synopsis |
|---|---|
adapter | |
bin | |
datadogcommand | |
honeycombcommand | |
lightstepcommand | |
opentelemetrycommand | |
otelstdoutcommand | |
stdoutcommand |