telemetry

package
v0.0.0-...-c0d1a14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
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")
)
View Source
const InitSubsegmentName = "Initialization"

InitSubsegmentName provides name attribute for Init subsegment

View Source
const InvokeSubsegmentName = "Invocation"

InvokeSubsegmentName provides name attribute for Invoke subsegment

View Source
const OverheadSubsegmentName = "Overhead"

OverheadSubsegmentName provides name attribute for Overhead subsegment

View Source
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 EventType

type EventType = string

type SandboxAgentWriter

type SandboxAgentWriter struct {
	// contains filtered or unexported fields
}

func NewSandboxAgentWriter

func NewSandboxAgentWriter(api *StandaloneEventsAPI, source string) *SandboxAgentWriter

func (*SandboxAgentWriter) Write

func (w *SandboxAgentWriter) Write(logline []byte) (int, error)

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 (s *StandaloneLogsEgressAPI) GetExtensionSockets() (io.Writer, io.Writer, error)

func (*StandaloneLogsEgressAPI) GetRuntimeSockets

func (s *StandaloneLogsEgressAPI) GetRuntimeSockets() (io.Writer, io.Writer, error)

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 (t *StandaloneTracer) CaptureInitSubsegment(ctx context.Context, criticalFunction func(context.Context) error) error

func (*StandaloneTracer) CaptureInvokeSegment

func (t *StandaloneTracer) CaptureInvokeSegment(ctx context.Context, criticalFunction func(context.Context) error) error

func (*StandaloneTracer) CaptureInvokeSubsegment

func (t *StandaloneTracer) CaptureInvokeSubsegment(ctx context.Context, criticalFunction func(context.Context) error) error

func (*StandaloneTracer) CaptureOverheadSubsegment

func (t *StandaloneTracer) CaptureOverheadSubsegment(ctx context.Context, criticalFunction func(context.Context) error) error

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)

func (*StandaloneTracer) WithError

func (t *StandaloneTracer) WithError(ctx context.Context, appCtx appctx.ApplicationContext, criticalFunction func(ctx context.Context) error) func(ctx context.Context) error

func (*StandaloneTracer) WithErrorCause

func (t *StandaloneTracer) WithErrorCause(ctx context.Context, appCtx appctx.ApplicationContext, criticalFunction func(ctx context.Context) error) func(ctx context.Context) error

type TracingEvent

type TracingEvent struct {
	Message     string `json:"message"`
	TraceID     string `json:"trace_id"`
	SegmentName string `json:"segment_name"`
	SegmentID   string `json:"segment_id"`
	Timestamp   int64  `json:"timestamp"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL