Documentation
¶
Index ¶
- Variables
- 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 RecordCommandContext(ctx context.Context)
- func RecordCommandFinish(cmd *cobra.Command, failed bool)
- func Send[T any](ctx context.Context, metricSlug string, value T)
- func SendJson(ctx context.Context, metricSlug string, payload json.RawMessage)
- func SendMetrics(ctx context.Context, json string) error
- func SendNoData(ctx context.Context, metricSlug 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 ¶
View Source
var (
Enabled = true
)
View Source
var IsUsingGPU bool
Functions ¶
func DeployStatus ¶ added in v0.2.61
func DeployStatus(ctx context.Context, payload DeployStatusPayload)
func FlushMetrics ¶ added in v0.1.116
func FlushMetrics(ctx context.Context) error
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 GetMetricsToken(parentCtx context.Context) (token string, err error)
func IsFlushMetricsDisabled ¶ added in v0.1.117
func IsFlushMetricsDisabled(ctx context.Context) bool
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 RecordCommandContext ¶ added in v0.0.550
func RecordCommandContext(ctx context.Context)
func RecordCommandFinish ¶ added in v0.0.550
func RecordCommandFinish(cmd *cobra.Command, failed bool)
func SendMetrics ¶ added in v0.1.117
func SendMetrics(ctx context.Context, json string) error
/ Spens up to 15 seconds sending all metrics collected so far to flyctl-metrics post endpoint
func SendNoData ¶
func SendNoData(ctx context.Context, metricSlug string)
func StartTiming ¶
func StartTiming(ctx context.Context, metricSlug string) func()
func WithDisableFlushMetrics ¶ added in v0.1.117
func WithDisableFlushMetrics(ctx context.Context) context.Context
WithDisableFlushMetrics returns a context with a flag that disables FlushMetrics call after a command completes.
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"`
PrimaryRegion string `json:"primary_region"`
Image string `json:"image"`
Strategy string `json:"strategy"`
FlyctlVersion string `json:"flyctlVersion"`
}
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"`
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"`
}
Click to show internal directories.
Click to hide internal directories.