Documentation
¶
Index ¶
- Constants
- type EventLog
- type EventType
- type SandboxAgentWriter
- type SandboxEvent
- type StandaloneEventsAPI
- func (s *StandaloneEventsAPI) EventLog() *EventLog
- func (s *StandaloneEventsAPI) FetchTailLogs(string) (string, error)
- func (s *StandaloneEventsAPI) GetRuntimeDoneSpans(runtimeStartedTime int64, invokeResponseMetrics *interop.InvokeResponseMetrics, ...) []interop.Span
- func (s *StandaloneEventsAPI) LogTrace(entry TracingEvent)
- func (s *StandaloneEventsAPI) SendEnd(data interop.EndData) error
- func (s *StandaloneEventsAPI) SendExtensionInit(data interop.ExtensionInitData) error
- func (s *StandaloneEventsAPI) SendFault(data interop.FaultData) error
- func (s *StandaloneEventsAPI) SendImageErrorLog(interop.ImageErrorLogData)
- func (s *StandaloneEventsAPI) SendInitReport(data interop.InitReportData) error
- func (s *StandaloneEventsAPI) SendInitRuntimeDone(data interop.InitRuntimeDoneData) error
- func (s *StandaloneEventsAPI) SendInitStart(data interop.InitStartData) error
- func (s *StandaloneEventsAPI) SendInvokeRuntimeDone(data interop.InvokeRuntimeDoneData) error
- func (s *StandaloneEventsAPI) SendInvokeStart(data interop.InvokeStartData) error
- func (s *StandaloneEventsAPI) SendReport(data interop.ReportData) error
- func (s *StandaloneEventsAPI) SendReportSpan(interop.Span) error
- func (s *StandaloneEventsAPI) SendRestoreRuntimeDone(data interop.RestoreRuntimeDoneData) error
- func (s *StandaloneEventsAPI) SetCurrentRequestID(requestID interop.RequestID)
- type StandaloneLogsEgressAPI
- type StandaloneTracer
- func (t *StandaloneTracer) AttachErrorCause(ctx context.Context, errorCause json.RawMessage)
- func (t *StandaloneTracer) BuildTracingCtxAfterInvokeComplete() *interop.TracingCtx
- func (t *StandaloneTracer) BuildTracingCtxForStart() *interop.TracingCtx
- func (t *StandaloneTracer) BuildTracingHeader() func(ctx context.Context) string
- func (t *StandaloneTracer) CaptureInitSubsegment(ctx context.Context, criticalFunction func(context.Context) error) error
- func (t *StandaloneTracer) CaptureInvokeSegment(ctx context.Context, criticalFunction func(context.Context) error) error
- func (t *StandaloneTracer) CaptureInvokeSubsegment(ctx context.Context, criticalFunction func(context.Context) error) error
- func (t *StandaloneTracer) CaptureOverheadSubsegment(ctx context.Context, criticalFunction func(context.Context) error) error
- func (t *StandaloneTracer) Configure(invoke *interop.Invoke)
- func (t *StandaloneTracer) MarkError(ctx context.Context)
- func (t *StandaloneTracer) RecordInitEndTime()
- func (t *StandaloneTracer) RecordInitStartTime()
- func (t *StandaloneTracer) SendInitSubsegmentWithRecordedTimesOnce(ctx context.Context)
- func (t *StandaloneTracer) SendRestoreSubsegmentWithRecordedTimesOnce(ctx context.Context)
- func (t *StandaloneTracer) WithError(ctx context.Context, appCtx appctx.ApplicationContext, ...) func(ctx context.Context) error
- func (t *StandaloneTracer) WithErrorCause(ctx context.Context, appCtx appctx.ApplicationContext, ...) func(ctx context.Context) error
- type TracingEvent
Constants ¶
const ( PlatformInitStart = EventType("platform.initStart") PlatformInitRuntimeDone = EventType("platform.initRuntimeDone") PlatformInitReport = EventType("platform.initReport") PlatformRestoreRuntimeDone = EventType("platform.restoreRuntimeDone") PlatformStart = EventType("platform.start") PlatformRuntimeDone = EventType("platform.runtimeDone") PlatformExtension = EventType("platform.extension") PlatformEnd = EventType("platform.end") PlatformReport = EventType("platform.report") PlatformFault = EventType("platform.fault") )
const InitSubsegmentName = "Initialization"
InitSubsegmentName provides name attribute for Init subsegment
const InvokeSubsegmentName = "Invocation"
InvokeSubsegmentName provides name attribute for Invoke subsegment
const OverheadSubsegmentName = "Overhead"
OverheadSubsegmentName provides name attribute for Overhead subsegment
const RestoreSubsegmentName = "Restore"
RestoreSubsegmentName provides name attribute for Restore subsegment
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventLog ¶
type EventLog struct {
Events []SandboxEvent `json:"events,omitempty"` // populated by the StandaloneEventLog object
Traces []TracingEvent `json:"traces,omitempty"`
}
func NewEventLog ¶
func NewEventLog() *EventLog
type SandboxAgentWriter ¶
type SandboxAgentWriter struct {
// contains filtered or unexported fields
}
func NewSandboxAgentWriter ¶
func NewSandboxAgentWriter(api *StandaloneEventsAPI, source string) *SandboxAgentWriter
type SandboxEvent ¶
type SandboxEvent struct {
Time string `json:"time"`
Type EventType `json:"type"`
PlatformEvent map[string]interface{} `json:"platformEvent,omitempty"`
LogMessage string `json:"logMessage,omitempty"`
}
SandboxEvent represents a generic sandbox event. For example:
{
"time": "2021-03-16T13:10:42.358Z",
"type": "platform.extension",
"platformEvent": { "name": "foo bar", "state": "Ready", "events": ["INVOKE", "SHUTDOWN"]}
}
Or:
{
"time": "2021-03-16T13:10:42.358Z",
"type": "extension",
"logMessage": "raw agent console output"
}
FluxPump produces entries with a single field 'record', containing either an object or a string. We make the distinction explicit by providing separate fields for the two cases, 'PlatformEvent' and 'LogMessage'. Either one of the two would be populated, but not both. This makes code cleaner, but requires test client to merge two fields back, producing a single 'record' entry again -- to match the FluxPump format that tests actually check.
type StandaloneEventsAPI ¶
type StandaloneEventsAPI struct {
// contains filtered or unexported fields
}
func (*StandaloneEventsAPI) EventLog ¶
func (s *StandaloneEventsAPI) EventLog() *EventLog
func (*StandaloneEventsAPI) FetchTailLogs ¶
func (s *StandaloneEventsAPI) FetchTailLogs(string) (string, error)
func (*StandaloneEventsAPI) GetRuntimeDoneSpans ¶
func (s *StandaloneEventsAPI) GetRuntimeDoneSpans( runtimeStartedTime int64, invokeResponseMetrics *interop.InvokeResponseMetrics, runtimeOverheadStartedTime int64, runtimeReadyTime int64, ) []interop.Span
func (*StandaloneEventsAPI) LogTrace ¶
func (s *StandaloneEventsAPI) LogTrace(entry TracingEvent)
func (*StandaloneEventsAPI) SendEnd ¶
func (s *StandaloneEventsAPI) SendEnd(data interop.EndData) error
func (*StandaloneEventsAPI) SendExtensionInit ¶
func (s *StandaloneEventsAPI) SendExtensionInit(data interop.ExtensionInitData) error
func (*StandaloneEventsAPI) SendFault ¶
func (s *StandaloneEventsAPI) SendFault(data interop.FaultData) error
func (*StandaloneEventsAPI) SendImageErrorLog ¶
func (s *StandaloneEventsAPI) SendImageErrorLog(interop.ImageErrorLogData)
func (*StandaloneEventsAPI) SendInitReport ¶
func (s *StandaloneEventsAPI) SendInitReport(data interop.InitReportData) error
func (*StandaloneEventsAPI) SendInitRuntimeDone ¶
func (s *StandaloneEventsAPI) SendInitRuntimeDone(data interop.InitRuntimeDoneData) error
func (*StandaloneEventsAPI) SendInitStart ¶
func (s *StandaloneEventsAPI) SendInitStart(data interop.InitStartData) error
func (*StandaloneEventsAPI) SendInvokeRuntimeDone ¶
func (s *StandaloneEventsAPI) SendInvokeRuntimeDone(data interop.InvokeRuntimeDoneData) error
func (*StandaloneEventsAPI) SendInvokeStart ¶
func (s *StandaloneEventsAPI) SendInvokeStart(data interop.InvokeStartData) error
func (*StandaloneEventsAPI) SendReport ¶
func (s *StandaloneEventsAPI) SendReport(data interop.ReportData) error
func (*StandaloneEventsAPI) SendReportSpan ¶
func (s *StandaloneEventsAPI) SendReportSpan(interop.Span) error
func (*StandaloneEventsAPI) SendRestoreRuntimeDone ¶
func (s *StandaloneEventsAPI) SendRestoreRuntimeDone(data interop.RestoreRuntimeDoneData) error
func (*StandaloneEventsAPI) SetCurrentRequestID ¶
func (s *StandaloneEventsAPI) SetCurrentRequestID(requestID interop.RequestID)
type StandaloneLogsEgressAPI ¶
type StandaloneLogsEgressAPI struct {
// contains filtered or unexported fields
}
func NewStandaloneLogsEgressAPI ¶
func NewStandaloneLogsEgressAPI(api *StandaloneEventsAPI) *StandaloneLogsEgressAPI
func (*StandaloneLogsEgressAPI) GetExtensionSockets ¶
func (*StandaloneLogsEgressAPI) GetRuntimeSockets ¶
type StandaloneTracer ¶
type StandaloneTracer struct {
// contains filtered or unexported fields
}
func NewStandaloneTracer ¶
func NewStandaloneTracer(api *StandaloneEventsAPI) *StandaloneTracer
func (*StandaloneTracer) AttachErrorCause ¶
func (t *StandaloneTracer) AttachErrorCause(ctx context.Context, errorCause json.RawMessage)
func (*StandaloneTracer) BuildTracingCtxAfterInvokeComplete ¶
func (t *StandaloneTracer) BuildTracingCtxAfterInvokeComplete() *interop.TracingCtx
func (*StandaloneTracer) BuildTracingCtxForStart ¶
func (t *StandaloneTracer) BuildTracingCtxForStart() *interop.TracingCtx
func (*StandaloneTracer) BuildTracingHeader ¶
func (t *StandaloneTracer) BuildTracingHeader() func(ctx context.Context) string
func (*StandaloneTracer) CaptureInitSubsegment ¶
func (*StandaloneTracer) CaptureInvokeSegment ¶
func (*StandaloneTracer) CaptureInvokeSubsegment ¶
func (*StandaloneTracer) CaptureOverheadSubsegment ¶
func (*StandaloneTracer) Configure ¶
func (t *StandaloneTracer) Configure(invoke *interop.Invoke)
func (*StandaloneTracer) MarkError ¶
func (t *StandaloneTracer) MarkError(ctx context.Context)
func (*StandaloneTracer) RecordInitEndTime ¶
func (t *StandaloneTracer) RecordInitEndTime()
func (*StandaloneTracer) RecordInitStartTime ¶
func (t *StandaloneTracer) RecordInitStartTime()
func (*StandaloneTracer) SendInitSubsegmentWithRecordedTimesOnce ¶
func (t *StandaloneTracer) SendInitSubsegmentWithRecordedTimesOnce(ctx context.Context)
func (*StandaloneTracer) SendRestoreSubsegmentWithRecordedTimesOnce ¶
func (t *StandaloneTracer) SendRestoreSubsegmentWithRecordedTimesOnce(ctx context.Context)