Documentation
¶
Index ¶
- Constants
- func ConfiguredCloudExporters(ctx context.Context) (sdktrace.SpanExporter, sdklog.Exporter, sdkmetric.Exporter, bool)
- func MeasuringStreamClientInterceptor() grpc.StreamClientInterceptor
- func MeasuringUnaryClientInterceptor() grpc.UnaryClientInterceptor
- func MeasuringUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func NewLargeQueueLiveSpanProcessor(exp sdktrace.SpanExporter) *telemetry.LiveSpanProcessor
- func ReexportMetricsFromPB(ctx context.Context, exps []sdkmetric.Exporter, ...) error
- func URLForTrace(ctx context.Context) (url string, msg string, ok bool)
- type EnvGetter
- type LabelFlag
- type Labels
- func (labels Labels) AsMap() map[string]string
- func (labels Labels) Get(key string) (string, bool)
- func (labels *Labels) UnmarshalJSON(dt []byte) error
- func (labels Labels) UserAgent() string
- func (labels Labels) WithCILabels() Labels
- func (labels Labels) WithCircleCILabels() Labels
- func (labels Labels) WithClientLabels(engineVersion string) Labels
- func (labels Labels) WithEngineLabel(engineName string) Labels
- func (labels Labels) WithGitHubLabels() Labels
- func (labels Labels) WithGitLabLabels() Labels
- func (labels Labels) WithGitLabels(workdir string) Labels
- func (labels Labels) WithHarnessLabels() Labels
- func (labels Labels) WithJenkinsLabels() Labels
- func (labels Labels) WithServerLabels(engineVersion, os, arch string, cacheEnabled bool) Labels
- func (labels Labels) WithVCSLabels(workdir string) Labels
- type OSEnvGetter
- type SpanHeartbeater
Constants ¶
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.
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
Types ¶
type Labels ¶
type Labels struct {
// contains filtered or unexported fields
}
func LoadDefaultLabels ¶
func (Labels) AsMap ¶ added in v0.19.7
AsMap returns a reference to the internal labels map. It's not intended to be moodified by the caller.
func (*Labels) UnmarshalJSON ¶
func (Labels) WithCILabels ¶
func (Labels) WithCircleCILabels ¶
func (Labels) WithClientLabels ¶
func (Labels) WithEngineLabel ¶
func (Labels) WithGitHubLabels ¶
func (Labels) WithGitLabLabels ¶
func (Labels) WithGitLabels ¶
func (Labels) WithHarnessLabels ¶ added in v0.14.0
func (Labels) WithJenkinsLabels ¶ added in v0.12.0
func (Labels) WithServerLabels ¶
func (Labels) WithVCSLabels ¶
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