Documentation
¶
Index ¶
- Constants
- func CMDSpan(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, trace.Span)
- func CreateLinkSpan(ctx context.Context, res *http.Response)
- func ExtractProcessContext(ctx context.Context) (context.Context, bool)
- func FinishWorkflow(ctx context.Context)
- func GetTracer() trace.Tracer
- func InitTraceProvider(ctx context.Context, appName string) (*sdktrace.TracerProvider, error)
- func InitTraceProviderWithoutApp(ctx context.Context) (*sdktrace.TracerProvider, error)
- func NewTransport(inner http.RoundTripper) http.RoundTripper
- func ProcessEnvironment(ctx context.Context) []string
- func RecordCancellation(ctx context.Context, span trace.Span) []attribute.KeyValue
- func RecordError(ctx context.Context, span trace.Span, err error, description string)
- func RecordErrorEvent(ctx context.Context, span trace.Span, err error, opts ...trace.EventOption)
- func RunWorkflow(ctx context.Context, name, app string, run func(context.Context) error) error
- func SpanContextFromHeaders(res *http.Response) trace.SpanContext
- func StartWorkflowPhase(ctx context.Context, name string) (context.Context, func(error))
- func WithDeployTrace(ctx context.Context) context.Context
- func WithWorkflowErrorCode(err error, code WorkflowErrorCode) error
- func WorkflowPhase(ctx context.Context, name string, run func(context.Context) error) error
- func WorkflowStep[T any](ctx context.Context, name string, run func(context.Context) (T, error)) (T, error)
- type InstrumentedTransport
- type WorkflowErrorCode
Constants ¶
const ( HeaderFlyTraceId = "fly-trace-id" HeaderFlySpanId = "fly-span-id" )
Variables ¶
This section is empty.
Functions ¶
func CreateLinkSpan ¶ added in v0.1.148
func ExtractProcessContext ¶ added in v0.5.12
ExtractProcessContext reads the remote parent supplied by a supervising process.
func FinishWorkflow ¶ added in v0.5.12
FinishWorkflow ends the observation when an interactive session starts.
func InitTraceProvider ¶
func InitTraceProviderWithoutApp ¶ added in v0.2.37
func InitTraceProviderWithoutApp(ctx context.Context) (*sdktrace.TracerProvider, error)
func NewTransport ¶
func NewTransport(inner http.RoundTripper) http.RoundTripper
func ProcessEnvironment ¶ added in v0.5.12
ProcessEnvironment returns environment overrides for a child process.
func RecordCancellation ¶ added in v0.4.108
RecordCancellation annotates a span without changing its status. Call before cleanup, using the operation's context (which may be a child of the span's).
func RecordError ¶
func RecordErrorEvent ¶ added in v0.4.108
RecordErrorEvent records the original error along with the cancellation cause at the point the error is observed. Causes are metadata, not additional errors: expected cleanup must not turn a successful operation into a failed span.
func RunWorkflow ¶ added in v0.5.11
RunWorkflow traces a single command with the existing flyctl trace exporter. An unavailable exporter does not prevent the command from running.
func SpanContextFromHeaders ¶ added in v0.1.148
func SpanContextFromHeaders(res *http.Response) trace.SpanContext
func StartWorkflowPhase ¶ added in v0.5.12
StartWorkflowPhase returns a completion function for a phase that finishes asynchronously.
func WithDeployTrace ¶ added in v0.4.122
WithDeployTrace marks this deploy and downstream requests for unconditional retention.
func WithWorkflowErrorCode ¶ added in v0.5.14
func WithWorkflowErrorCode(err error, code WorkflowErrorCode) error
WithWorkflowErrorCode preserves the error's text and chain for the caller, while allowing workflow spans to record a code instead of the error text.
func WorkflowPhase ¶ added in v0.5.11
func WorkflowStep ¶ added in v0.5.11
func WorkflowStep[T any](ctx context.Context, name string, run func(context.Context) (T, error)) (T, error)
WorkflowStep records a phase of a traced workflow. Its error is conveyed as a status and a fixed error code because command errors can contain secrets or connection strings.
Types ¶
type InstrumentedTransport ¶
type InstrumentedTransport struct {
// contains filtered or unexported fields
}
type WorkflowErrorCode ¶ added in v0.5.14
type WorkflowErrorCode int
WorkflowErrorCode identifies a failure without exporting error text or caller input. Values are converted to a fixed vocabulary before entering telemetry.
const ( WorkflowErrorUnknown WorkflowErrorCode = iota WorkflowErrorCanceled WorkflowErrorDeadlineExceeded WorkflowErrorInterrupted WorkflowErrorPromptNonInteractive WorkflowErrorSSHMachineList WorkflowErrorSSHMachineLookup WorkflowErrorSSHMachineNotFound WorkflowErrorSSHMachineNotStarted WorkflowErrorSSHMachineAppMismatch WorkflowErrorSSHNoStartedMachines WorkflowErrorSSHNoMachinesInRegion WorkflowErrorSSHMachineRegionMismatch WorkflowErrorSSHNoMachinesInProcessGroup WorkflowErrorSSHMachineProcessGroupMismatch WorkflowErrorSSHSelectionFlags WorkflowErrorSSHMachinePrompt WorkflowErrorSSHContainerFlags WorkflowErrorSSHContainerNotFound WorkflowErrorSSHContainerPrompt WorkflowErrorSSHDNS WorkflowErrorSSHMachineStart WorkflowErrorSSHMachineStartWait )
func WorkflowErrorCodeFor ¶ added in v0.5.14
func WorkflowErrorCodeFor(err error) WorkflowErrorCode
WorkflowErrorCodeFor recovers a source-assigned code through error wrappers. Mixed joined failures remain unknown rather than borrowing one cause's code. Context cancellation is recorded without assuming the user caused it.
func (WorkflowErrorCode) String ¶ added in v0.5.14
func (code WorkflowErrorCode) String() string