telemetry

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentAPI     = "devguard-api"
	ComponentScanner = "devguard-scanner"

	EventName         = "devguard-instance-start"
	TelemetryEndpoint = "https://umami.l3montree.com/api/send"
	WebsiteID         = "2ab9fe36-42ec-485d-a592-b0f6e78dd1ad"
	DefaultTimeout    = 30 * time.Second
	UserAgent         = "DevguardTelemetry"
	SchemaVersion     = 1
	TransparencyLog   = "sending anonymized telemetry data - nothing personal or critical is included. " +
		"This helps us understand what DevGuard versions are used and which versions we should provide patches for. " +
		"You can disable this by setting DEVGUARD_TELEMETRY_DISABLED=true."

	EnvDisabled = "DEVGUARD_TELEMETRY_DISABLED"
)

Variables

This section is empty.

Functions

func BuildStartupPayload

func BuildStartupPayload(event StartupEvent) umamiRequest

func HashParts

func HashParts(parts ...string) string

func RuntimeVersion

func RuntimeVersion(values ...string) string

func SendAPIStartup

func SendAPIStartup(ctx context.Context, cfg Config, client HTTPDoer, statsCollector APIStatsCollector, version string)

func SendScannerStartup

func SendScannerStartup(ctx context.Context, cfg Config, client HTTPDoer, version, apiURL string, runsInCI bool, command string)

func SendStartup

func SendStartup(ctx context.Context, cfg Config, client HTTPDoer, event StartupEvent)

Types

type APIStats

type APIStats struct {
	OrgCount     *int64
	ProjectCount *int64
	AssetCount   *int64
}

type APIStatsCollector

type APIStatsCollector interface {
	CollectAPIStartupStats(ctx context.Context) APIStats
}

type Config

type Config struct {
	Disabled bool
}

func ConfigFromEnv

func ConfigFromEnv() Config

type GormAPIStatsCollector

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

func NewGormAPIStatsCollector

func NewGormAPIStatsCollector(db shared.DB) GormAPIStatsCollector

func (GormAPIStatsCollector) CollectAPIStartupStats

func (c GormAPIStatsCollector) CollectAPIStartupStats(ctx context.Context) APIStats

type HTTPDoer

type HTTPDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

type StartupEvent

type StartupEvent struct {
	Component  string
	Version    string
	InstanceID string
	Data       map[string]any
}

func APIStartupEvent

func APIStartupEvent(version, frontendURL, postgresHost, postgresDB string, stats APIStats) StartupEvent

func ScannerStartupEvent

func ScannerStartupEvent(version, apiURL, goos, goarch string, runsInCI bool, command string) StartupEvent

Jump to

Keyboard shortcuts

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