{"record":{"id":"8346fb0fcf412878","repo":"jaegertracing/jaeger","slug":"failed-to-create-the-adaptive-sampling-aggregator","errorCode":null,"errorMessage":"failed to create the adaptive sampling aggregator: %w","messagePattern":"failed to create the adaptive sampling aggregator: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/jaeger/internal/processors/adaptivesampling/processor.go","lineNumber":50,"sourceCode":"\nfunc (tp *traceProcessor) start(_ context.Context, host component.Host) error {\n\tparts, err := remotesampling.GetAdaptiveSamplingComponents(host)\n\tif err != nil {\n\t\treturn fmt.Errorf(\n\t\t\t\"cannot load adaptive sampling components from `%s` extension: %w\",\n\t\t\tremotesampling.ComponentType, err,\n\t\t)\n\t}\n\n\tagg, err := adaptive.NewAggregator(\n\t\t*parts.Options,\n\t\ttp.telset.Logger,\n\t\totelmetrics.NewFactory(tp.telset.MeterProvider),\n\t\tparts.DistLock,\n\t\tparts.SamplingStore,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create the adaptive sampling aggregator: %w\", err)\n\t}\n\n\tagg.Start()\n\ttp.aggregator = agg\n\n\treturn nil\n}\n\nfunc (tp *traceProcessor) close(context.Context) error {\n\tif tp.aggregator != nil {\n\t\tif err := tp.aggregator.Close(); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to stop the adaptive sampling aggregator : %w\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (tp *traceProcessor) processTraces(_ context.Context, td ptrace.Traces) (ptrace.Traces, error) {","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/jaeger/internal/processors/adaptivesampling/processor.go#L32-L68","documentation":"This error wraps failures from adaptive.NewAggregator when the Jaeger OpenTelemetry collector tries to build the adaptive sampling aggregator during the trace processor's Start lifecycle phase. The aggregator coordinates probabilistic sampling calculations across Jaeger instances and needs a working distributed lock and sampling store; if its constructor cannot initialize these parts it returns an error, which this wrap decorates with context before failing processor startup.","triggerScenarios":"Calling start (via the OTel collector component lifecycle) when adaptive.NewAggregator returns an error — e.g. the remotesampling extension's DistLock or SamplingStore components are nil/misconfigured, or the aggregator options are invalid.","commonSituations":"Running `jaeger` binary with the adaptive sampling processor but without the remote sampling extension properly configured; sampling storage backend failing to initialize; misconfigured distributed lock (e.g. missing etcd/oteld connection settings); unit/integration tests exercising the error path.","solutions":["Check that the jaeger_remote_sampling extension is configured and started before the processor, since start pulls DistLock and SamplingStore from it via remotesampling.GetAdaptiveSamplingComponents","Inspect the wrapped inner error (%w) in the log — it names the actual root cause from adaptive.NewAggregator","Verify the sampling storage backend (e.g. Cassandra/opensearch/memory) is reachable and its configuration is valid","Confirm aggregator options from the extension config are sane (e.g. no negative/zero intervals)"],"exampleFix":"// before (extension missing -> aggregator cannot build)\nservice:\n  extensions: []\n  processors: [adaptivesampling]\n// after\nservice:\n  extensions: [jaeger_remote_sampling]\n  processors: [adaptivesampling]","handlingStrategy":"validation","validationCode":"parts, err := remotesampling.GetAdaptiveSamplingComponents(host)\nif err != nil { return err }\nif parts.DistLock == nil || parts.SamplingStore == nil {\n    return fmt.Errorf(\"adaptive sampling components not ready: distLock=%v samplingStore=%v\", parts.DistLock != nil, parts.SamplingStore != nil)\n}","typeGuard":"if tp.aggregator == nil {\n    return fmt.Errorf(\"adaptive sampling aggregator was not initialized\")\n}","tryCatchPattern":"if err := tp.start(ctx, host); err != nil {\n    var inner error\n    if errors.As(err, &inner) || true {\n        logger.Error(\"adaptive sampling aggregator creation failed\", log.Error(err))\n    }\n    return err // startup failure is not retryable in-place\n}","preventionTips":["Always configure the jaeger_remote_sampling extension before enabling the adaptivesampling processor","Log and inspect the wrapped cause (%w) rather than the outer message","Verify the sampling storage backend connectivity before startup","Pin Jaeger versions and check changelogs for aggregator option changes"],"tags":["go","otel-collector","adaptive-sampling","startup"],"backgroundTag":"component-initialization-failed","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}