{"record":{"id":"e9211011d606d3f8","repo":"jaegertracing/jaeger","slug":"unsupported-attribute-type-v-for-key-q","errorCode":null,"errorMessage":"unsupported attribute type %v for key %q","messagePattern":"unsupported attribute type (.+?) for key %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/v2/clickhouse/tracestore/query_builder.go","lineNumber":287,"sourceCode":"\t\t\treturn typedAttributeValue{}, fmt.Errorf(\"failed to parse double attribute %q: %w\", key, parseErr)\n\t\t}\n\t\treturn typedAttributeValue{key: key, value: f, valueType: t}, nil\n\tcase pcommon.ValueTypeInt:\n\t\ti, parseErr := strconv.ParseInt(attr.Str(), 10, 64)\n\t\tif parseErr != nil {\n\t\t\treturn typedAttributeValue{}, fmt.Errorf(\"failed to parse int attribute %q: %w\", key, parseErr)\n\t\t}\n\t\treturn typedAttributeValue{key: key, value: i, valueType: t}, nil\n\tcase pcommon.ValueTypeStr:\n\t\treturn typedAttributeValue{key: key, value: attr.Str(), valueType: t}, nil\n\tcase pcommon.ValueTypeBytes:\n\t\treturn typedAttributeValue{key: \"@bytes@\" + key, value: attr.Str(), valueType: t}, nil\n\tcase pcommon.ValueTypeMap:\n\t\treturn typedAttributeValue{key: \"@map@\" + key, value: attr.Str(), valueType: t}, nil\n\tcase pcommon.ValueTypeSlice:\n\t\treturn typedAttributeValue{key: \"@slice@\" + key, value: attr.Str(), valueType: t}, nil\n\tdefault:\n\t\treturn typedAttributeValue{}, fmt.Errorf(\"unsupported attribute type %v for key %q\", t, key)\n\t}\n}\n\n// buildStringAttributeCondition adds a condition for string attributes by looking up their\n// actual stored type(s) and level(s) from the attribute_metadata table.\n//\n// String attributes require special handling because the query service passes all\n// attributes as strings (via AsString()), regardless of their actual stored type.\n// We must look up the attribute_metadata to determine the actual type(s) and\n// level(s) where this attribute is stored, then convert the string back to the\n// appropriate type for querying.\n//\n// If metadata exists but the value cannot be parsed as any of the metadata types,\n// we fall back to treating it as a string attribute.\nfunc buildStringAttributeCondition(\n\tq *strings.Builder,\n\targs []any,\n\tkey string,","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/v2/clickhouse/tracestore/query_builder.go#L269-L305","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Upgrade the jaeger ClickHouse storage module to a version that supports the attribute type","Inspect attribute_metadata for the key and correct its recorded type to a supported one (string/int/double/bool/bytes/map/slice)","Re-emit the attribute with a supported value type at the instrumentation layer","If caused by ValueTypeEmpty, fix the caller to pass the attribute's actual type"],"exampleFix":"// before (metadata row with unhandled type)\n{\"key\": \"span.kind\", \"type\": \"empty\"}\n// after\n{\"key\": \"span.kind\", \"type\": \"string\"}","handlingStrategy":"type-guard","validationCode":"// check the attribute type is supported before building a query\nvar supportedTypes = map[pcommon.ValueType]bool{\n\tpcommon.ValueTypeBool: true, pcommon.ValueTypeDouble: true,\n\tpcommon.ValueTypeInt: true, pcommon.ValueTypeStr: true,\n\tpcommon.ValueTypeBytes: true, pcommon.ValueTypeMap: true,\n\tpcommon.ValueTypeSlice: true,\n}\nif !supportedTypes[attrType] {\n\treturn fmt.Errorf(\"attribute type %v is not supported for querying\", attrType)\n}","typeGuard":"func isSupportedAttrType(t pcommon.ValueType) bool {\n\tswitch t {\n\tcase pcommon.ValueTypeBool, pcommon.ValueTypeDouble, pcommon.ValueTypeInt,\n\t\tpcommon.ValueTypeStr, pcommon.ValueTypeBytes, pcommon.ValueTypeMap,\n\t\tpcommon.ValueTypeSlice:\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":"if err != nil {\n\tif strings.Contains(err.Error(), \"unsupported attribute type\") {\n\t\t// degrade: query without the unsupported attribute condition\n\t\treturn reader.GetTraces(ctx, baseIDs)\n\t}\n\treturn err\n}","preventionTips":["Pin jaeger and OTel collector versions so pcommon value types are mutually supported","Upgrade the storage module when upgrading collectors that add new attribute types","Scrub unsupported attribute types in a collector processor before storage","Avoid writing ValueTypeEmpty attributes in custom pipelines"],"tags":["clickhouse","attributes","unsupported-type","query-builder"],"backgroundTag":"unsupported-attribute-type","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}