telemetry

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 10 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

View Source
var AdditionalData map[string]interface{} = map[string]interface{}{}

Functions

func ClientId

func ClientId(ctx context.Context) string

func NewBuildRunnerEventProps added in v0.25.0

func NewBuildRunnerEventProps(ctx context.Context, buildId, buildState string) map[string]interface{}

func NewWorkspaceEventProps

func NewWorkspaceEventProps(ctx context.Context, workspace *workspace.Workspace, target *provider.ProviderTarget) map[string]interface{}

func ServerId

func ServerId(ctx context.Context) string

func SessionId

func SessionId(ctx context.Context) string

func TelemetryEnabled

func TelemetryEnabled(ctx context.Context) bool

Types

type AbstractTelemetryService

type AbstractTelemetryService struct {
	TelemetryService
	// contains filtered or unexported fields
}

func NewAbstractTelemetryService

func NewAbstractTelemetryService() *AbstractTelemetryService

func (*AbstractTelemetryService) SetCommonProps

func (t *AbstractTelemetryService) SetCommonProps(properties map[string]interface{})

type BuildRunnerEvent added in v0.26.0

type BuildRunnerEvent string
const (
	// Purge events
	BuildRunnerEventPurgeStarted   BuildRunnerEvent = "build_runner_purge_started"
	BuildRunnerEventPurgeCompleted BuildRunnerEvent = "build_runner_purge_completed"
	BuildRunnerEventPurgeError     BuildRunnerEvent = "build_runner_purge_error"

	// Build events
	BuildRunnerEventRunBuild      BuildRunnerEvent = "build_runner_run_build"
	BuildRunnerEventRunBuildError BuildRunnerEvent = "build_runner_run_build_error"
)

type CliEvent

type CliEvent string
const (
	CliEventCmdStart CliEvent = "cli_cmd_start"
	CliEventCmdEnd   CliEvent = "cli_cmd_end"
)

type ServerEvent

type ServerEvent string
const (
	ServerEventApiRequestStarted ServerEvent = "server_api_request_started"
	ServerEventApiResponseSent   ServerEvent = "server_api_response_sent"
	ServerEventPurgeStarted      ServerEvent = "server_purge_started"
	ServerEventPurgeCompleted    ServerEvent = "server_purge_completed"
	ServerEventPurgeError        ServerEvent = "server_purge_error"

	// Workspace events
	ServerEventWorkspaceCreated      ServerEvent = "server_workspace_created"
	ServerEventWorkspaceDestroyed    ServerEvent = "server_workspace_destroyed"
	ServerEventWorkspaceStarted      ServerEvent = "server_workspace_started"
	ServerEventWorkspaceStopped      ServerEvent = "server_workspace_stopped"
	ServerEventWorkspaceCreateError  ServerEvent = "server_workspace_created_error"
	ServerEventWorkspaceDestroyError ServerEvent = "server_workspace_destroyed_error"
	ServerEventWorkspaceStartError   ServerEvent = "server_workspace_started_error"
	ServerEventWorkspaceStopError    ServerEvent = "server_workspace_stopped_error"
)

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
	TrackCliEvent(event CliEvent, clientId string, properties map[string]interface{}) error
	TrackServerEvent(event ServerEvent, clientId string, properties map[string]interface{}) error
	TrackBuildRunnerEvent(event BuildRunnerEvent, clientId string, properties map[string]interface{}) error
	SetCommonProps(properties map[string]interface{})
}

type TelemetrySource

type TelemetrySource string
var (
	CLI_SOURCE         TelemetrySource = "cli"
	CLI_PROJECT_SOURCE TelemetrySource = "cli-project"
	AGENT_SOURCE       TelemetrySource = "agent"
)

Jump to

Keyboard shortcuts

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