telemetry

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(exec executor.Executor, log *progress.Logger, cfg *cli.Config) error

Run executes enterprise telemetry: scan, build payload, upload to S3. Output format matches the shell script's sample_log:

==========================================
StepSecurity Device Agent v1.9.1
==========================================
[scanning] Lock acquired (PID: 32560)
[scanning] Device ID (Serial): ...
...

Types

type ExecutionLogs

type ExecutionLogs struct {
	OutputBase64 string `json:"output_base64"`
	StartTime    int64  `json:"start_time"`
	EndTime      int64  `json:"end_time"`
	ExitCode     int    `json:"exit_code"`
	AgentVersion string `json:"agent_version"`
}

type LogCapture

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

LogCapture captures all stderr output during telemetry execution. The captured output is base64-encoded and included in the execution_logs payload.

func StartCapture

func StartCapture() *LogCapture

StartCapture redirects stderr to a tee that writes to both the original stderr and an in-memory buffer for later base64 encoding.

func (*LogCapture) Finalize

func (lc *LogCapture) Finalize() string

Finalize stops capture and returns the base64-encoded output. Safe to call multiple times — subsequent calls return the cached result.

func (*LogCapture) Fprintf

func (lc *LogCapture) Fprintf(format string, args ...any)

Fprintf is a convenience method.

func (*LogCapture) Write

func (lc *LogCapture) Write(p []byte) (n int, err error)

Write allows direct writing to the capture buffer (for banner etc.) while also writing to stderr.

type Payload

type Payload struct {
	CustomerID     string `json:"customer_id"`
	DeviceID       string `json:"device_id"`
	SerialNumber   string `json:"serial_number"`
	UserIdentity   string `json:"user_identity"`
	Hostname       string `json:"hostname"`
	Platform       string `json:"platform"`
	OSVersion      string `json:"os_version"`
	AgentVersion   string `json:"agent_version"`
	CollectedAt    int64  `json:"collected_at"`
	NoUserLoggedIn bool   `json:"no_user_logged_in"`

	IDEExtensions        []model.Extension           `json:"ide_extensions"`
	IDEInstallations     []model.IDE                 `json:"ide_installations"`
	NodePkgManagers      []model.PkgManager          `json:"node_package_managers"`
	NodeGlobalPackages   []model.NodeScanResult      `json:"node_global_packages"`
	NodeProjects         []model.NodeScanResult      `json:"node_projects"`
	BrewPkgManager       *model.PkgManager           `json:"brew_package_manager,omitempty"`
	BrewScans            []model.BrewScanResult      `json:"brew_scans"`
	PythonPkgManagers    []model.PkgManager          `json:"python_package_managers"`
	PythonGlobalPackages []model.PythonScanResult    `json:"python_global_packages"`
	PythonProjects       []model.ProjectInfo         `json:"python_projects"`
	AIAgents             []model.AITool              `json:"ai_agents"`
	MCPConfigs           []model.MCPConfigEnterprise `json:"mcp_configs"`

	ExecutionLogs      *ExecutionLogs      `json:"execution_logs,omitempty"`
	PerformanceMetrics *PerformanceMetrics `json:"performance_metrics,omitempty"`
}

Payload is the enterprise telemetry JSON structure.

type PerformanceMetrics

type PerformanceMetrics struct {
	ExtensionsCount       int   `json:"extensions_count"`
	NodePackagesScanMs    int64 `json:"node_packages_scan_ms"`
	NodeGlobalPkgsCount   int   `json:"node_global_packages_count"`
	NodeProjectsCount     int   `json:"node_projects_count"`
	BrewFormulaeCount     int   `json:"brew_formulae_count"`
	BrewCasksCount        int   `json:"brew_casks_count"`
	PythonGlobalPkgsCount int   `json:"python_global_packages_count"`
	PythonProjectsCount   int   `json:"python_projects_count"`
}

Jump to

Keyboard shortcuts

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