jaegertracing/jaeger · error

storage '%s' does not support sampling store

Error message

storage '%s' does not support sampling store

What it means

GetSamplingStoreFactory retrieves the named trace storage factory and asserts it also implements storage.SamplingStoreFactory, which is required for adaptive sampling. Only some backends implement that interface; when the retrieved factory does not, this error is thrown because the Go type assertion f.(storage.SamplingStoreFactory) fails.

Source

Thrown at cmd/jaeger/internal/extension/jaegerstorage/extension.go:82

func GetTraceStoreFactory(name string, host component.Host) (tracestore.Factory, error) {
	f, err := getStorageFactory(name, host)
	if err != nil {
		return nil, err
	}

	return f, nil
}

func GetSamplingStoreFactory(name string, host component.Host) (storage.SamplingStoreFactory, error) {
	f, err := getStorageFactory(name, host)
	if err != nil {
		return nil, err
	}

	ssf, ok := f.(storage.SamplingStoreFactory)
	if !ok {
		return nil, fmt.Errorf("storage '%s' does not support sampling store", name)
	}

	return ssf, nil
}

func GetPurger(name string, host component.Host) (storage.Purger, error) {
	f, err := getStorageFactory(name, host)
	if err != nil {
		return nil, err
	}

	purger, ok := f.(storage.Purger)
	if !ok {
		return nil, fmt.Errorf("storage '%s' does not support purging", name)
	}

	return purger, nil
}

View on GitHub (pinned to 806f444784)

Solutions

  1. Choose a storage backend whose factory implements storage.SamplingStoreFactory (e.g. Cassandra, Elasticsearch) for the entry referenced by sampling configuration
  2. Disable adaptive sampling / remote sampling storage if the chosen backend does not support it
  3. Add the sampling-store capability to a custom factory by implementing storage.SamplingStoreFactory

Example fix

// before (otelelasticsearch-only backend with adaptive sampling enabled)
// after: point sampling at a supported backend or disable it
sampling:
  adaptive_sampling:
    sampling_store: cassandra-primary   # backend that implements SamplingStoreFactory
Defensive patterns

Strategy: type-guard

Validate before calling

f, err := jaegerstorage.GetTraceStoreFactory(name, host)
if err == nil {
    if _, ok := f.(storage.SamplingStoreFactory); !ok {
        // backend cannot serve adaptive sampling
    }
}

Type guard

func supportsSampling(f tracestore.Factory) bool {
    _, ok := f.(storage.SamplingStoreFactory)
    return ok
}

Try / catch

ssf, err := jaegerstorage.GetSamplingStoreFactory(name, host)
if err != nil {
    if strings.Contains(err.Error(), "does not support sampling store") {
        // fall back to default static sampling strategy
        return defaultStrategyProvider, nil
    }
    return nil, err
}

Prevention

When it happens

Trigger: startAdaptiveStrategyProvider (or another caller) calls jaegerstorage.GetSamplingStoreFactory(name, host) for a storage backend whose factory does not implement storage.SamplingStoreFactory — e.g. a backend that supports trace storage but not remote sampling storage.

Common situations: Enabling adaptive sampling (sampling strategies served from storage) while pointing at a storage type that has no sampling-store implementation, or switching backends (e.g. to a memory/test or newer backend) without re-checking sampling support.

Related errors


AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01). Data as JSON: /api/errors/07952b7085ce840d. Report an issue: GitHub.