jaegertracing/jaeger · error

unsupported attribute type %v for key %q

Error message

unsupported attribute type %v for key %q

What it means

This is the default branch of parseStringToTypedValue: the attribute's pcommon.ValueType is one the query builder does not know how to translate into a typed ClickHouse condition (it handles Bool, Double, Int, Str, Bytes, Map and Slice). Any other value type makes it impossible to construct the query, so the builder fails fast instead of silently emitting a wrong condition.

Source

Thrown at internal/storage/v2/clickhouse/tracestore/query_builder.go:287

			return typedAttributeValue{}, fmt.Errorf("failed to parse double attribute %q: %w", key, parseErr)
		}
		return typedAttributeValue{key: key, value: f, valueType: t}, nil
	case pcommon.ValueTypeInt:
		i, parseErr := strconv.ParseInt(attr.Str(), 10, 64)
		if parseErr != nil {
			return typedAttributeValue{}, fmt.Errorf("failed to parse int attribute %q: %w", key, parseErr)
		}
		return typedAttributeValue{key: key, value: i, valueType: t}, nil
	case pcommon.ValueTypeStr:
		return typedAttributeValue{key: key, value: attr.Str(), valueType: t}, nil
	case pcommon.ValueTypeBytes:
		return typedAttributeValue{key: "@bytes@" + key, value: attr.Str(), valueType: t}, nil
	case pcommon.ValueTypeMap:
		return typedAttributeValue{key: "@map@" + key, value: attr.Str(), valueType: t}, nil
	case pcommon.ValueTypeSlice:
		return typedAttributeValue{key: "@slice@" + key, value: attr.Str(), valueType: t}, nil
	default:
		return typedAttributeValue{}, fmt.Errorf("unsupported attribute type %v for key %q", t, key)
	}
}

// buildStringAttributeCondition adds a condition for string attributes by looking up their
// actual stored type(s) and level(s) from the attribute_metadata table.
//
// String attributes require special handling because the query service passes all
// attributes as strings (via AsString()), regardless of their actual stored type.
// We must look up the attribute_metadata to determine the actual type(s) and
// level(s) where this attribute is stored, then convert the string back to the
// appropriate type for querying.
//
// If metadata exists but the value cannot be parsed as any of the metadata types,
// we fall back to treating it as a string attribute.
func buildStringAttributeCondition(
	q *strings.Builder,
	args []any,
	key string,

View on GitHub (pinned to 806f444784)

Solutions

  1. Upgrade the jaeger ClickHouse storage module to a version that supports the attribute type
  2. Inspect attribute_metadata for the key and correct its recorded type to a supported one (string/int/double/bool/bytes/map/slice)
  3. Re-emit the attribute with a supported value type at the instrumentation layer
  4. If caused by ValueTypeEmpty, fix the caller to pass the attribute's actual type

Example fix

// before (metadata row with unhandled type)
{"key": "span.kind", "type": "empty"}
// after
{"key": "span.kind", "type": "string"}
Defensive patterns

Strategy: type-guard

Validate before calling

// check the attribute type is supported before building a query
var supportedTypes = map[pcommon.ValueType]bool{
	pcommon.ValueTypeBool: true, pcommon.ValueTypeDouble: true,
	pcommon.ValueTypeInt: true, pcommon.ValueTypeStr: true,
	pcommon.ValueTypeBytes: true, pcommon.ValueTypeMap: true,
	pcommon.ValueTypeSlice: true,
}
if !supportedTypes[attrType] {
	return fmt.Errorf("attribute type %v is not supported for querying", attrType)
}

Type guard

func isSupportedAttrType(t pcommon.ValueType) bool {
	switch t {
	case pcommon.ValueTypeBool, pcommon.ValueTypeDouble, pcommon.ValueTypeInt,
		pcommon.ValueTypeStr, pcommon.ValueTypeBytes, pcommon.ValueTypeMap,
		pcommon.ValueTypeSlice:
		return true
	}
	return false
}

Try / catch

if err != nil {
	if strings.Contains(err.Error(), "unsupported attribute type") {
		// degrade: query without the unsupported attribute condition
		return reader.GetTraces(ctx, baseIDs)
	}
	return err
}

Prevention

When it happens

Trigger: A trace query condition references an attribute whose metadata type resolves to an unsupported pcommon.ValueType (e.g. ValueTypeEmpty or a newly added pcommon value type this storage version predates).

Common situations: Running an older jaeger storage module against data written by a newer OTel collector that introduced new attribute types; corrupted or bogus rows in attribute_metadata carrying an unhandled type; code paths that pass pcommon.ValueTypeEmpty instead of a real type.

Related errors


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