telemetry

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Signal

type Signal struct {
	ToolID  ToolID
	Kind    SignalKind
	Reason  string
	Line    int
	Command instructions.Command
}

Signal records the earliest stage evidence for one tool.

type SignalKind

type SignalKind string

SignalKind explains why a tool was detected for a stage.

const (
	SignalKindCommand  SignalKind = "command"
	SignalKindInstall  SignalKind = "install"
	SignalKindManifest SignalKind = "manifest"
)

type StageSignals

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

StageSignals contains the deduplicated tool evidence for one stage.

func DetectStage

func DetectStage(
	stage instructions.Stage,
	stageFacts *facts.StageFacts,
	semInfo *semantic.StageInfo,
) StageSignals

DetectStage scans one stage for telemetry-aware tool usage.

func (*StageSignals) Anchor

func (s *StageSignals) Anchor() (Signal, bool)

Anchor returns the earliest stage signal.

func (*StageSignals) Empty

func (s *StageSignals) Empty() bool

Empty reports whether any telemetry-target tools were detected.

func (*StageSignals) OrderedToolIDs

func (s *StageSignals) OrderedToolIDs() []ToolID

OrderedToolIDs returns detected tools in catalog order.

type Tool

type Tool struct {
	ID       ToolID
	Name     string
	EnvKey   string
	EnvValue string
}

Tool describes one official telemetry opt-out supported by the rule.

func OrderedTools

func OrderedTools() []Tool

OrderedTools returns the catalog in stable insertion order.

func ToolByID

func ToolByID(id ToolID) (Tool, bool)

ToolByID looks up a tool by catalog id.

type ToolID

type ToolID string

ToolID identifies a telemetry-aware tool in the catalog.

const (
	ToolBun         ToolID = "bun"
	ToolAzureCLI    ToolID = "azure-cli"
	ToolWrangler    ToolID = "wrangler"
	ToolHuggingFace ToolID = "hugging-face"
	ToolYarnBerry   ToolID = "yarn-berry"
	ToolNextJS      ToolID = "nextjs"
	ToolNuxt        ToolID = "nuxt"
	ToolGatsby      ToolID = "gatsby"
	ToolAstro       ToolID = "astro"
	ToolTurborepo   ToolID = "turborepo"
	ToolDotNetCLI   ToolID = "dotnet-cli"
	ToolPowerShell  ToolID = "powershell"
	ToolVcpkg       ToolID = "vcpkg"
	ToolHomebrew    ToolID = "homebrew"
)

func OrderedToolIDs

func OrderedToolIDs(set map[ToolID]bool) []ToolID

OrderedToolIDs returns ids from the provided set using catalog order.

Jump to

Keyboard shortcuts

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