jaegertracing/jaeger · error

extension '%s' is not of expected type '%s'

Error message

extension '%s' is not of expected type '%s'

What it means

After findExtension locates a component whose type matches the jaegerstorage componentType, it type-asserts it to the package's Extension interface. If the registered component has the right type name but does not implement Extension (TraceStorageFactory/MetricStorageFactory/Start/Shutdown), this error is thrown.

Source

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

func findExtension(host component.Host) (Extension, error) {
	var id component.ID
	var comp component.Component
	for i, ext := range host.GetExtensions() {
		if i.Type() == componentType {
			id, comp = i, ext
			break
		}
	}
	if comp == nil {
		return nil, fmt.Errorf(
			"cannot find extension '%s' (make sure it's defined earlier in the config)",
			componentType,
		)
	}
	ext, ok := comp.(Extension)
	if !ok {
		return nil, fmt.Errorf("extension '%s' is not of expected type '%s'", id, componentType)
	}
	return ext, nil
}

func newStorageExt(cfg *Config, telset component.TelemetrySettings) *storageExt {
	// Initialize telemetry.Settings with host=nil, will be set in Start()
	tset := telemetry.Settings{
		Logger:         telset.Logger,
		MeterProvider:  telset.MeterProvider,
		TracerProvider: telset.TracerProvider,
	}
	return &storageExt{
		config:           cfg,
		telset:           tset,
		factories:        make(map[string]tracestore.Factory),
		metricsFactories: make(map[string]storage.MetricStoreFactory),
	}
}

View on GitHub (pinned to 806f444784)

Solutions

  1. Ensure the jaegerstorage extension from the same jaeger version is the one registered (rebuild binary with matching imports)
  2. If a custom extension reuses the component type, make it implement the full Extension interface (extension.Extension + TraceStorageFactory + MetricStorageFactory)
  3. Check for duplicate/conflicting extension registrations in the collector build

Example fix

// before: custom component missing interface methods
func (e *myExt) Start(ctx context.Context, h component.Host) error { ... }
// after: also satisfy Extension
var _ Extension = (*myExt)(nil)
func (e *myExt) TraceStorageFactory(name string) (tracestore.Factory, error) { ... }
func (e *myExt) MetricStorageFactory(name string) (storage.MetricStoreFactory, error) { ... }
Defensive patterns

Strategy: type-guard

Type guard

func asStorageExtension(c component.Component) (jaegerstorage.Extension, bool) {
    ext, ok := c.(jaegerstorage.Extension)
    return ext, ok
}

Try / catch

ext, err := findExtension(host)
if err != nil {
    if strings.Contains(err.Error(), "is not of expected type") {
        return fmt.Errorf("build mismatch: registered jaegerstorage extension lacks current interface; rebuild with matching jaeger version: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: findExtension (reached via getStorageFactory or GetMetricStorageFactory) iterating host.GetExtensions() finds a component with matching component.ID type whose concrete value does not satisfy the Extension interface.

Common situations: A custom or vendored extension registered under the same component type string but with an incompatible implementation, or a version mismatch where an older jaegerstorage build lacking the current interface is registered.

Related errors


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