jaegertracing/jaeger · error
no sampling strategy provider specified, expecting 'adaptive
Error message
no sampling strategy provider specified, expecting 'adaptive' or 'file'
What it means
errNoProvider is returned by Config.Validate in the remote sampling extension when neither the 'adaptive' nor the 'file' sampling strategy provider is configured. The extension must know which strategy source to serve to clients, so an empty provider section is a configuration error.
Source
Thrown at cmd/jaeger/internal/extension/remotesampling/config.go:21
package remotesampling
import (
"errors"
"time"
"github.com/asaskevich/govalidator"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configgrpc"
"go.opentelemetry.io/collector/config/confighttp"
"go.opentelemetry.io/collector/config/configoptional"
"go.opentelemetry.io/collector/confmap"
"github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy/adaptive"
)
var (
errNoProvider = errors.New("no sampling strategy provider specified, expecting 'adaptive' or 'file'")
errMultipleProviders = errors.New("only one sampling strategy provider can be specified, 'adaptive' or 'file'")
errNegativeInterval = errors.New("reload interval must be a positive value, or zero to disable automatic reloading")
)
var (
_ component.Config = (*Config)(nil)
_ confmap.Validator = (*Config)(nil)
)
type Config struct {
File configoptional.Optional[FileConfig] `mapstructure:"file"`
Adaptive configoptional.Optional[AdaptiveConfig] `mapstructure:"adaptive"`
HTTP configoptional.Optional[confighttp.ServerConfig] `mapstructure:"http"`
GRPC configoptional.Optional[configgrpc.ServerConfig] `mapstructure:"grpc"`
}
type FileConfig struct {
// File specifies a local file as the source of sampling strategies.View on GitHub (pinned to 806f444784)
Solutions
- Add either a 'file:' block (with the strategy file path) or an 'adaptive:' block to the remotesampling extension config
- If you don't need remote sampling, remove the remotesampling extension from the service extensions list and its reference from the pipelines extensions
- Run `jaeger validate` or your collector config validator before deploying to catch this at startup config time
Example fix
// before
extensions:
remote_sampling:
http:
endpoint: 0.0.0.0:5778
// after
extensions:
remote_sampling:
file:
path: /etc/jaeger/sampling.json
http:
endpoint: 0.0.0.0:5778 Defensive patterns
Strategy: validation
Validate before calling
// validate config before starting the extension
cfg := &remotesampling.Config{}
if cfg.Adaptive == nil && cfg.File == nil {
return fmt.Errorf("remotesampling requires either 'adaptive' or 'file' provider")
}
if err := cfg.Validate(); err != nil {
return err
} Type guard
func hasProvider(cfg *remotesampling.Config) bool {
return cfg.Adaptive != nil || cfg.File != nil
} Try / catch
if err := ext.Start(ctx, host); err != nil {
if strings.Contains(err.Error(), "no sampling strategy provider specified") {
return fmt.Errorf("fix remotesampling config: %w", err)
}
return err
} Prevention
- Always define exactly one of adaptive/file in the remotesampling extension config
- Validate collector configs in CI before deployment
- Use config templates that default to the file provider
When it happens
Trigger: Starting the jaeger collector extension with remotesampling config where both 'adaptive' and 'file' blocks are absent or empty; Validate() checks exactly one provider is set and fails if zero are.
Common situations: Deploying the OTLP-based jaeger binary with a remotesampling extension stanza that only sets http/server config but omits the provider; copying an example config and deleting the file block; upgrading from an older config format that put the provider elsewhere.
Understand the failure class
Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.
Related errors
- only one sampling strategy provider can be specified, 'adapt
- reload interval must be a positive value, or zero to disable
- CalculationInterval and AggregationBuckets must be greater t
- BucketsForCalculation cannot be less than 1
- invalid configuration for trace storage '%s': %w
AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01).
Data as JSON: /api/errors/f035a99a9fe1d3a2.
Report an issue: GitHub.