Documentation
¶
Index ¶
- Variables
- func AgentWireGuardTransport(ctx context.Context, transport string)
- func DeployStatus(ctx context.Context, payload DeployStatusPayload)
- func FlushMetrics(ctx context.Context) error
- func FlushPending()
- func GetMetricsToken(parentCtx context.Context) (token string, err error)
- func IsFlushMetricsDisabled(ctx context.Context) bool
- func LaunchStatus(ctx context.Context, payload LaunchStatusPayload)
- func OperatorFromSignals(s clientsignals.Signals) (operator, agentName string)
- func RecordCommandContext(ctx context.Context)
- func RecordCommandFinish(cmd *cobra.Command, failed bool)
- func Send[T any](ctx context.Context, metricSlug string, value T)
- func SendImmediate[T any](ctx context.Context, metricSlug string, value T)
- func SendJson(ctx context.Context, metricSlug string, payload json.RawMessage)
- func SendMetrics(ctx context.Context, jsonData string) error
- func SendNoData(ctx context.Context, metricSlug string)
- func SetAppOrgIDs(app, org string)
- func StartTiming(ctx context.Context, metricSlug string) func()
- func Started(ctx context.Context, metricSlug string)
- func Status(ctx context.Context, metricSlug string, success bool)
- func WithDisableFlushMetrics(ctx context.Context) context.Context
- type DeployStatusPayload
- type LaunchStatusPayload
Constants ¶
This section is empty.
Variables ¶
var (
Enabled = true
)
var IsUsingGPU bool
Functions ¶
func AgentWireGuardTransport ¶ added in v0.4.70
AgentWireGuardTransport reports which transport the agent used to establish a WireGuard tunnel: "udp" or "websocket". It sends immediately because the agent daemon never reaches the end-of-command metrics flush.
func DeployStatus ¶ added in v0.2.61
func DeployStatus(ctx context.Context, payload DeployStatusPayload)
func FlushMetrics ¶ added in v0.1.116
Spawns a forked `flyctl metrics send` process that sends metrics to the flyctl-metrics server
func FlushPending ¶
func FlushPending()
func GetMetricsToken ¶ added in v0.1.116
func IsFlushMetricsDisabled ¶ added in v0.1.117
IsFlushMetricsDisabled returns true if FlushMetrics should not be called after a command completes.
func LaunchStatus ¶ added in v0.2.24
func LaunchStatus(ctx context.Context, payload LaunchStatusPayload)
func OperatorFromSignals ¶ added in v0.4.70
func OperatorFromSignals(s clientsignals.Signals) (operator, agentName string)
OperatorFromSignals returns an operator classification and, when the operator is "agent", the agent name. Precedence is defined by clientsignals.Signals.Operator(): ci > agent > interactive > unknown.
func RecordCommandContext ¶ added in v0.0.550
func RecordCommandFinish ¶ added in v0.0.550
func SendImmediate ¶ added in v0.4.70
SendImmediate sends a single metric to the collector right away instead of queueing it for the end-of-command flush. Long-running processes (e.g. the agent) queue metrics that would otherwise never be flushed.
func SendNoData ¶
func SetAppOrgIDs ¶ added in v0.4.96
func SetAppOrgIDs(app, org string)
SetAppOrgIDs records the internal numeric IDs of the app and organization the running command is acting on, to be reported with its stats. Either argument may be empty, so a caller that only knows one of the two can leave the other alone.
func StartTiming ¶
Types ¶
type DeployStatusPayload ¶ added in v0.2.61
type DeployStatusPayload struct {
TraceID string `json:"traceId"`
Error string `json:"error"`
Duration time.Duration `json:"duration"`
AppName string `json:"app"`
OrgSlug string `json:"org"`
AppID string `json:"app_id,omitempty"`
OrgID string `json:"org_id,omitempty"`
PrimaryRegion string `json:"primary_region"`
Image string `json:"image"`
Strategy string `json:"strategy"`
FlyctlVersion string `json:"flyctlVersion"`
Operator string `json:"operator,omitempty"`
AgentName string `json:"agentName,omitempty"`
}
type LaunchStatusPayload ¶ added in v0.2.24
type LaunchStatusPayload struct {
TraceID string `json:"traceId"`
Error string `json:"error"`
Duration time.Duration `json:"duration"`
AppName string `json:"app"`
OrgSlug string `json:"org"`
AppID string `json:"app_id,omitempty"`
OrgID string `json:"org_id,omitempty"`
Region string `json:"region"`
HighAvailability bool `json:"ha"`
VM struct {
Size string `json:"size"`
Memory string `json:"memory"`
ProcessN int `json:"processCount"`
} `json:"vm"`
HasPostgres bool `json:"hasPostgres"`
HasRedis bool `json:"hasRedis"`
HasSentry bool `json:"hasSentry"`
ScannerFamily string `json:"scanner_family"`
FlyctlVersion string `json:"flyctlVersion"`
Operator string `json:"operator,omitempty"`
AgentName string `json:"agentName,omitempty"`
}