telemetry

package
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const CLIENT_ID_HEADER = "X-Daytona-Client-Id"
View Source
const ENABLED_HEADER = "X-Daytona-Telemetry-Enabled"
View Source
const SESSION_ID_HEADER = "X-Daytona-Session-Id"
View Source
const SOURCE_HEADER = "X-Daytona-Source"

Variables

This section is empty.

Functions

func ClientId

func ClientId(ctx context.Context) string

func ServerId

func ServerId(ctx context.Context) string

func SessionId

func SessionId(ctx context.Context) string

func SetCommonProps added in v0.52.0

func SetCommonProps(version string, source TelemetrySource, properties map[string]interface{})

func TelemetryEnabled

func TelemetryEnabled(ctx context.Context) bool

Types

type AbstractEvent added in v0.52.0

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

func (AbstractEvent) Name added in v0.52.0

func (e AbstractEvent) Name() string

func (AbstractEvent) Props added in v0.52.0

func (e AbstractEvent) Props() map[string]interface{}

type ApiKeyEvent added in v0.52.0

type ApiKeyEvent struct {
	AbstractEvent
	// contains filtered or unexported fields
}

func (ApiKeyEvent) Props added in v0.52.0

func (e ApiKeyEvent) Props() map[string]interface{}

type ApiKeyEventName added in v0.52.0

type ApiKeyEventName string
const (
	ApiKeyEventLifecycleCreated        ApiKeyEventName = "api_key_lifecycle_created"
	ApiKeyEventLifecycleCreationFailed ApiKeyEventName = "api_key_lifecycle_creation_failed"
)

type BuildEventName added in v0.52.0

type BuildEventName string
const (
	BuildEventLifecycleCreated             BuildEventName = "build_lifecycle_created"
	BuildEventLifecycleCreationFailed      BuildEventName = "build_lifecycle_creation_failed"
	BuildEventLifecycleDeleted             BuildEventName = "build_lifecycle_deleted"
	BuildEventLifecycleDeletionFailed      BuildEventName = "build_lifecycle_deletion_failed"
	BuildEventLifecycleForceDeleted        BuildEventName = "build_lifecycle_force_deleted"
	BuildEventLifecycleForceDeletionFailed BuildEventName = "build_lifecycle_force_deletion_failed"
)

type CliEventName added in v0.52.0

type CliEventName string
const (
	CliEventCommandStarted      CliEventName = "cli_command_started"
	CliEventCommandCompleted    CliEventName = "cli_command_completed"
	CliEventCommandFailed       CliEventName = "cli_command_failed"
	CliEventCommandInvalid      CliEventName = "cli_command_invalid"
	CliEventCommandInterrupted  CliEventName = "cli_command_interrupted"
	CliEventTargetOpened        CliEventName = "cli_target_opened"
	CliEventTargetOpenFailed    CliEventName = "cli_target_open_failed"
	CliEventWorkspaceOpened     CliEventName = "cli_workspace_opened"
	CliEventWorkspaceOpenFailed CliEventName = "cli_workspace_open_failed"
	CliEventDefaultIdeSet       CliEventName = "cli_default_ide_set"
)

type Event added in v0.52.0

type Event interface {
	Name() string
	Props() map[string]interface{}
}

func NewApiKeyEvent added in v0.52.0

func NewApiKeyEvent(name ApiKeyEventName, key *models.ApiKey, err error, extras map[string]interface{}) Event

func NewBuildEvent added in v0.52.0

func NewBuildEvent(name BuildEventName, b *models.Build, err error, extras map[string]interface{}) Event

func NewCliEvent added in v0.52.0

func NewCliEvent(name CliEventName, cmd *cobra.Command, flags []string, err error, extras map[string]interface{}) Event

func NewGitProviderConfigEvent added in v0.52.0

func NewGitProviderConfigEvent(name GitProviderConfigEventName, b *models.GitProviderConfig, err error, extras map[string]interface{}) Event

func NewJobEvent added in v0.52.0

func NewJobEvent(name JobEventName, j *models.Job, err error, extras map[string]interface{}) Event

func NewRunnerEvent added in v0.52.0

func NewRunnerEvent(name RunnerEventName, r *models.Runner, err error, extras map[string]interface{}) Event

func NewTargetConfigEvent added in v0.52.0

func NewTargetConfigEvent(name TargetConfigEventName, tc *models.TargetConfig, err error, extras map[string]interface{}) Event

func NewTargetEvent added in v0.52.0

func NewTargetEvent(name TargetEventName, t *models.Target, err error, extras map[string]interface{}) Event

func NewWorkspaceEvent added in v0.52.0

func NewWorkspaceEvent(name WorkspaceEventName, w *models.Workspace, err error, extras map[string]interface{}) Event

func NewWorkspaceTemplateEvent added in v0.52.0

func NewWorkspaceTemplateEvent(name WorkspaceTemplateEventName, wt *models.WorkspaceTemplate, err error, extras map[string]interface{}) Event

type GitProviderConfigEvent added in v0.52.0

type GitProviderConfigEvent struct {
	AbstractEvent
	// contains filtered or unexported fields
}

func (GitProviderConfigEvent) Props added in v0.52.0

func (e GitProviderConfigEvent) Props() map[string]interface{}

type GitProviderConfigEventName added in v0.52.0

type GitProviderConfigEventName string
const (
	GitProviderConfigEventLifecycleSaved               GitProviderConfigEventName = "git_provider_config_lifecycle_saved"
	GitProviderConfigEventLifecycleSaveFailed          GitProviderConfigEventName = "git_provider_config_lifecycle_save_failed"
	GitProviderConfigEventLifecycleDeleted             GitProviderConfigEventName = "git_provider_config_lifecycle_deleted"
	GitProviderConfigEventLifecycleDeletionFailed      GitProviderConfigEventName = "git_provider_config_lifecycle_deletion_failed"
	GitProviderConfigEventLifecycleForceDeleted        GitProviderConfigEventName = "git_provider_config_lifecycle_force_deleted"
	GitProviderConfigEventLifecycleForceDeletionFailed GitProviderConfigEventName = "git_provider_config_lifecycle_force_deletion_failed"
)

type JobEventName added in v0.52.0

type JobEventName string
const (
	JobEventLifecycleCreated        JobEventName = "job_lifecycle_created"
	JobEventLifecycleCreationFailed JobEventName = "job_lifecycle_creation_failed"
	JobEventRunStarted              JobEventName = "job_run_started"
	JobEventRunCompleted            JobEventName = "job_run_completed"
	JobEventRunFailed               JobEventName = "job_run_failed"
)

type RunnerEventName added in v0.52.0

type RunnerEventName string
const (
	RunnerEventLifecycleRegistered          RunnerEventName = "runner_lifecycle_registered"
	RunnerEventLifecycleRegistrationFailed  RunnerEventName = "runner_lifecycle_registration_failed"
	RunnerEventLifecycleDeleted             RunnerEventName = "runner_lifecycle_deleted"
	RunnerEventLifecycleDeletionFailed      RunnerEventName = "runner_lifecycle_deletion_failed"
	RunnerEventProviderInstalled            RunnerEventName = "runner_provider_installed"
	RunnerEventProviderInstallationFailed   RunnerEventName = "runner_provider_installation_failed"
	RunnerEventProviderUninstalled          RunnerEventName = "runner_provider_uninstalled"
	RunnerEventProviderUninstallationFailed RunnerEventName = "runer_provider_uninstallation_failed"
	RunnerEventProviderUpdated              RunnerEventName = "runner_provider_updated"
	RunnerEventProviderUpdateFailed         RunnerEventName = "runner_provider_update_failed"
)

type TargetConfigEventName added in v0.52.0

type TargetConfigEventName string
const (
	TargetConfigEventLifecycleCreated        TargetConfigEventName = "target_config_lifecycle_created"
	TargetConfigEventLifecycleCreationFailed TargetConfigEventName = "target_config_lifecycle_creation_failed"
	TargetConfigEventLifecycleDeleted        TargetConfigEventName = "target_config_lifecycle_deleted"
	TargetConfigEventLifecycleDeletionFailed TargetConfigEventName = "target_config_lifecycle_deletion_failed"
)

type TargetEventName added in v0.52.0

type TargetEventName string
const (
	TargetEventLifecycleCreated             TargetEventName = "target_lifecycle_created"
	TargetEventLifecycleCreationFailed      TargetEventName = "target_lifecycle_creation_failed"
	TargetEventLifecycleStarted             TargetEventName = "target_lifecycle_started"
	TargetEventLifecycleStartFailed         TargetEventName = "target_lifecycle_start_failed"
	TargetEventLifecycleRestarted           TargetEventName = "target_lifecycle_restarted"
	TargetEventLifecycleRestartFailed       TargetEventName = "target_lifecycle_restart_failed"
	TargetEventLifecycleStopped             TargetEventName = "target_lifecycle_stopped"
	TargetEventLifecycleStopFailed          TargetEventName = "target_lifecycle_stop_failed"
	TargetEventLifecycleDeleted             TargetEventName = "target_lifecycle_deleted"
	TargetEventLifecycleDeletionFailed      TargetEventName = "target_lifecycle_deletion_failed"
	TargetEventLifecycleForceDeleted        TargetEventName = "target_lifecycle_force_deleted"
	TargetEventLifecycleForceDeletionFailed TargetEventName = "target_lifecycle_force_deletion_failed"
)

type TelemetryContextKey

type TelemetryContextKey string
var (
	ENABLED_CONTEXT_KEY    TelemetryContextKey = "telemetry-enabled"
	CLIENT_ID_CONTEXT_KEY  TelemetryContextKey = "cli-id"
	SESSION_ID_CONTEXT_KEY TelemetryContextKey = "session-id"
	SERVER_ID_CONTEXT_KEY  TelemetryContextKey = "server-id"
)

type TelemetryService

type TelemetryService interface {
	io.Closer
	Track(event Event, clientId string) error
}

type TelemetrySource

type TelemetrySource string
var (
	CLI_SOURCE            TelemetrySource = "cli"
	CLI_AGENT_MODE_SOURCE TelemetrySource = "cli_agent_mode"
	AGENT_SOURCE          TelemetrySource = "agent"
	RUNNER_SOURCE         TelemetrySource = "runner"
	SERVER_SOURCE         TelemetrySource = "server"
)

type WorkspaceEventName added in v0.52.0

type WorkspaceEventName string
const (
	WorkspaceEventLifecycleCreated             WorkspaceEventName = "workspace_lifecycle_created"
	WorkspaceEventLifecycleCreationFailed      WorkspaceEventName = "workspace_lifecycle_creation_failed"
	WorkspaceEventLifecycleStarted             WorkspaceEventName = "workspace_lifecycle_started"
	WorkspaceEventLifecycleStartFailed         WorkspaceEventName = "workspace_lifecycle_start_failed"
	WorkspaceEventLifecycleRestarted           WorkspaceEventName = "workspace_lifecycle_restarted"
	WorkspaceEventLifecycleRestartFailed       WorkspaceEventName = "workspace_lifecycle_restart_failed"
	WorkspaceEventLifecycleStopped             WorkspaceEventName = "workspace_lifecycle_stopped"
	WorkspaceEventLifecycleStopFailed          WorkspaceEventName = "workspace_lifecycle_stop_failed"
	WorkspaceEventLifecycleDeleted             WorkspaceEventName = "workspace_lifecycle_deleted"
	WorkspaceEventLifecycleDeletionFailed      WorkspaceEventName = "workspace_lifecycle_deletion_failed"
	WorkspaceEventLifecycleForceDeleted        WorkspaceEventName = "workspace_lifecycle_force_deleted"
	WorkspaceEventLifecycleForceDeletionFailed WorkspaceEventName = "workspace_lifecycle_force_deletion_failed"
	WorkspaceEventLabelsUpdated                WorkspaceEventName = "workspace_labels_updated"
	WorkspaceEventLabelsUpdateFailed           WorkspaceEventName = "workspace_label_update_failed"
)

type WorkspaceTemplateEventName added in v0.52.0

type WorkspaceTemplateEventName string
var (
	WorkspaceTemplateEventLifecycleSaved          WorkspaceTemplateEventName = "workspace_template_lifecycle_saved"
	WorkspaceTemplateEventLifecycleSaveFailed     WorkspaceTemplateEventName = "workspace_template_lifecycle_save_failed"
	WorkspaceTemplateEventLifecycleDeleted        WorkspaceTemplateEventName = "workspace_template_lifecycle_deleted"
	WorkspaceTemplateEventLifecycleDeletionFailed WorkspaceTemplateEventName = "workspace_template_lifecycle_deletion_failed"
	WorkspaceTemplateEventPrebuildSaved           WorkspaceTemplateEventName = "workspace_template_prebuild_saved"
	WorkspaceTemplateEventPrebuildSaveFailed      WorkspaceTemplateEventName = "workspace_template_prebuild_save_failed"
	WorkspaceTemplateEventPrebuildDeleted         WorkspaceTemplateEventName = "workspace_template_prebuild_deleted"
	WorkspaceTemplateEventPrebuildDeletionFailed  WorkspaceTemplateEventName = "workspace_template_prebuild_deletion_failed"
)

Jump to

Keyboard shortcuts

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