telemetry

package
v1.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LargeSpanQueueSize       = 262144 // 256Ki — ~8x a cold engine build's ~30k live records
	LargeSpanExportBatchSize = 16384  // drain the burst in a few large batches, not hundreds
)

Large, BOUNDED BatchSpanProcessor sizes for the span hops that carry a trace toward Dagger Cloud. The OTel BSP queue is non-blocking and silently DROPS spans on overflow, and the default 2048 slots are far too small for a burst like a cold engine build: that is ~15k spans, and live export double-emits each span (a start snapshot plus the end) for ~30k records arriving in a tight burst. Sizing the queue to 256Ki slots with a large export batch absorbs that burst with generous headroom so nothing is dropped (e.g. the wcprof.session_complete completeness carrier, which rides at the very tail and was the first thing to drop).

Kept BOUNDED — never BlockOnQueueFull — so telemetry can NEVER stall the build; if something still overflows, the wcprof completeness checksum catches it (received < declared, hard-fail) rather than silently ranking on partial data. The queue holds span POINTERS, so 256Ki slots is only a ~2MiB ring buffer, not 256Ki span copies.

View Source
const HeartbeatInterval = 30 * time.Second

Variables

This section is empty.

Functions

func MeasuringStreamClientInterceptor

func MeasuringStreamClientInterceptor() grpc.StreamClientInterceptor

func MeasuringUnaryClientInterceptor

func MeasuringUnaryClientInterceptor() grpc.UnaryClientInterceptor

func MeasuringUnaryServerInterceptor

func MeasuringUnaryServerInterceptor() grpc.UnaryServerInterceptor

func NewLargeQueueLiveSpanProcessor

func NewLargeQueueLiveSpanProcessor(exp sdktrace.SpanExporter) *telemetry.LiveSpanProcessor

NewLargeQueueLiveSpanProcessor is otel.NewLiveSpanProcessor with the large bounded queue above in place of the default 2048-slot one. Use it on every span hop that feeds a Cloud trace — the engine's per-client DB processors (engine/server) and the CLI→Cloud exporter (internal/cmd/dagger) — so a big-burst trace arrives complete.

func ReexportMetricsFromPB added in v0.13.6

func ReexportMetricsFromPB(ctx context.Context, exps []sdkmetric.Exporter, req *colmetricspb.ExportMetricsServiceRequest) error

func URLForTrace

func URLForTrace(ctx context.Context) (url string, msg string, ok bool)

Types

type EnvGetter added in v0.19.7

type EnvGetter interface {
	Getenv(key string) string
}

type LabelFlag

type LabelFlag struct {
	Labels
}

func NewLabelFlag

func NewLabelFlag() LabelFlag

func (LabelFlag) Set

func (flag LabelFlag) Set(s string) error

func (LabelFlag) String

func (flag LabelFlag) String() string

func (LabelFlag) Type

func (flag LabelFlag) Type() string

type Labels

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

func LoadDefaultLabels

func LoadDefaultLabels(workdir, clientEngineVersion string) Labels

func NewLabels added in v0.19.7

func NewLabels(labels map[string]string, eg EnvGetter, ghEventPayload []byte) Labels

func (Labels) AsMap added in v0.19.7

func (labels Labels) AsMap() map[string]string

AsMap returns a reference to the internal labels map. It's not intended to be moodified by the caller.

func (Labels) Get added in v0.19.7

func (labels Labels) Get(key string) (string, bool)

func (*Labels) UnmarshalJSON

func (labels *Labels) UnmarshalJSON(dt []byte) error

func (Labels) UserAgent

func (labels Labels) UserAgent() string

func (Labels) WithCILabels

func (labels Labels) WithCILabels() Labels

func (Labels) WithCircleCILabels

func (labels Labels) WithCircleCILabels() Labels

func (Labels) WithClientLabels

func (labels Labels) WithClientLabels(engineVersion string) Labels

func (Labels) WithEngineLabel

func (labels Labels) WithEngineLabel(engineName string) Labels

func (Labels) WithGitHubLabels

func (labels Labels) WithGitHubLabels() Labels

func (Labels) WithGitLabLabels

func (labels Labels) WithGitLabLabels() Labels

func (Labels) WithGitLabels

func (labels Labels) WithGitLabels(workdir string) Labels

func (Labels) WithHarnessLabels added in v0.14.0

func (labels Labels) WithHarnessLabels() Labels

func (Labels) WithJenkinsLabels added in v0.12.0

func (labels Labels) WithJenkinsLabels() Labels

func (Labels) WithServerLabels

func (labels Labels) WithServerLabels(engineVersion, os, arch string, cacheEnabled bool) Labels

func (Labels) WithVCSLabels

func (labels Labels) WithVCSLabels(workdir string) Labels

type OSEnvGetter added in v0.19.7

type OSEnvGetter struct{}

func (OSEnvGetter) Getenv added in v0.19.7

func (e OSEnvGetter) Getenv(key string) string

type SpanHeartbeater

type SpanHeartbeater struct {
	sdktrace.SpanExporter
	// contains filtered or unexported fields
}

SpanHeartbeater is a SpanExporter that keeps track of live spans and re-exports them periodically to the underlying SpanExporter to indicate that they are indeed still live.

func NewSpanHeartbeater

func NewSpanHeartbeater(exp sdktrace.SpanExporter) *SpanHeartbeater

func (*SpanHeartbeater) ExportSpans

func (p *SpanHeartbeater) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error

func (*SpanHeartbeater) Shutdown

func (p *SpanHeartbeater) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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