Help us shape the future of Go! Take the 2026 Go Developer Survey

telemetry

package
v1.0.67-beta.1 Latest Latest
Warning

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

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

Documentation

Overview

Package telemetry hands completed CLI events to a short-lived sender process. The command process never initializes the AEM SDK or waits for a network request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptedOut

func OptedOut() bool

OptedOut preserves the existing DO_NOT_TRACK semantics, including "0".

func RunWorker

func RunWorker(args []string, input *os.File) bool

RunWorker handles only the private sender invocation, before command assembly. Even malformed input or an SDK panic must not become a business command.

func Submit

func Submit(event Event)

Submit waits only for a bounded local handoff. A successful handoff is not an acknowledgement of delivery. Incomplete handoffs are discarded by the worker.

Types

type AgentInfo

type AgentInfo struct {
	State         runtimecontext.State `json:"state"`
	ErrorCode     int32                `json:"errorCode"`
	ErrorCategory string               `json:"errorCategory,omitempty"`
	Result        json.RawMessage      `json:"result,omitempty"`
}

AgentInfo preserves unknown SDK fields in a complete JSON object.

func AgentInfoFromSnapshot

func AgentInfoFromSnapshot(snapshot runtimecontext.AgentSnapshot) *AgentInfo

type Event

type Event struct {
	Protocol          int        `json:"protocol"`
	Version           string     `json:"version"`
	Command           string     `json:"command"`
	Path              string     `json:"path"`
	ExitCode          int        `json:"exitCode"`
	DurationMillis    int64      `json:"durationMillis"`
	CompletedAtMillis int64      `json:"completedAtMillis"`
	ErrorSummary      string     `json:"errorSummary,omitempty"`
	Identity          Identity   `json:"identity"`
	AgentInfo         *AgentInfo `json:"agentInfo,omitempty"`
}

Event 描述原始 CLI 命令,不是发送进程自身的执行。基础事件不收集 argv、 stdout 或工作目录;AgentInfo 单独保留 SDK 返回的进程和环境元数据, 由原始 CLI 采集,发送进程不重新识别。

type Identity

type Identity struct {
	UserID   string `json:"userId,omitempty"`
	UserName string `json:"userName,omitempty"`
	CorpID   string `json:"corpId,omitempty"`
}

Identity contains only the existing reviewed profile metadata projection.

Jump to

Keyboard shortcuts

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