Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f649ea8
cleanup
Manik2708 Jan 20, 2026
97f7b48
Merge branch 'main' into cass-convert
Manik2708 Jan 29, 2026
b45b6bb
Apply suggestion from @yurishkuro
yurishkuro Feb 15, 2026
792c1e6
bug fix and ai suggestions
Manik2708 Feb 15, 2026
769b7c1
Merge branch 'main' into cass-convert
Manik2708 Feb 15, 2026
55c80b0
cleanup
Manik2708 Feb 15, 2026
04a94f4
cleanup
Manik2708 Feb 15, 2026
ff559a9
cleanup
Manik2708 Feb 16, 2026
73478ce
Revert "cleanup"
Manik2708 Feb 16, 2026
4fc799b
cleanup
Manik2708 Feb 16, 2026
60c991a
Merge branch 'main' into cass-convert
Manik2708 Feb 18, 2026
9c3896e
cleanup
Manik2708 Feb 18, 2026
4015ce1
Merge branch 'main' into cass-convert
Manik2708 Feb 20, 2026
b006619
Update internal/storage/v2/cassandra/tracestore/from_dbmodel.go
Manik2708 Feb 20, 2026
16d4f2b
bug fix
Manik2708 Feb 20, 2026
60e5edd
cleanup
Manik2708 Feb 20, 2026
ee29b58
Update internal/storage/v2/cassandra/tracestore/to_dbmodel.go
Manik2708 Feb 21, 2026
a3717a2
Update internal/storage/v2/cassandra/tracestore/from_dbmodel.go
Manik2708 Feb 21, 2026
8370193
Update internal/storage/v2/cassandra/tracestore/to_dbmodel.go
Manik2708 Feb 21, 2026
5db4cfc
Update internal/storage/v2/cassandra/tracestore/from_dbmodel.go
Manik2708 Feb 21, 2026
8a2e11c
Merge branch 'main' into cass-convert
Manik2708 Feb 21, 2026
70500d9
cleanup
Manik2708 Feb 21, 2026
bb6e982
cleanup
Manik2708 Feb 21, 2026
bffce30
cleanup
Manik2708 Feb 23, 2026
dc44dc6
Merge branch 'main' into cass-convert
Manik2708 Feb 23, 2026
999b334
cleanup
Manik2708 Feb 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions internal/storage/v1/cassandra/spanstore/dbmodel/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ const (

var (
dbToDomainRefMap = map[string]model.SpanRefType{
childOf: model.SpanRefType_CHILD_OF,
followsFrom: model.SpanRefType_FOLLOWS_FROM,
ChildOf: model.SpanRefType_CHILD_OF,
FollowsFrom: model.SpanRefType_FOLLOWS_FROM,
}

domainToDBRefMap = map[model.SpanRefType]string{
model.SpanRefType_CHILD_OF: childOf,
model.SpanRefType_FOLLOWS_FROM: followsFrom,
model.SpanRefType_CHILD_OF: ChildOf,
model.SpanRefType_FOLLOWS_FROM: FollowsFrom,
}

domainToDBValueTypeMap = map[model.ValueType]string{
model.StringType: stringType,
model.BoolType: boolType,
model.Int64Type: int64Type,
model.Float64Type: float64Type,
model.BinaryType: binaryType,
model.StringType: StringType,
model.BoolType: BoolType,
model.Int64Type: Int64Type,
model.Float64Type: Float64Type,
model.BinaryType: BinaryType,
}
)

Expand Down Expand Up @@ -152,15 +152,15 @@ func (c converter) fromDBWarnings(tags []KeyValue) ([]string, error) {

func (converter) fromDBTag(tag *KeyValue) (model.KeyValue, error) {
switch tag.ValueType {
case stringType:
case StringType:
return model.String(tag.Key, tag.ValueString), nil
case boolType:
case BoolType:
return model.Bool(tag.Key, tag.ValueBool), nil
case int64Type:
case Int64Type:
return model.Int64(tag.Key, tag.ValueInt64), nil
case float64Type:
case Float64Type:
return model.Float64(tag.Key, tag.ValueFloat64), nil
case binaryType:
case BinaryType:
return model.Binary(tag.Key, tag.ValueBinary), nil
default:
return model.KeyValue{}, fmt.Errorf("invalid ValueType in %+v", tag)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,27 @@ var (
someDBTags = []KeyValue{
{
Key: someStringTagKey,
ValueType: stringType,
ValueType: StringType,
ValueString: someStringTagValue,
},
{
Key: someBoolTagKey,
ValueType: boolType,
ValueType: BoolType,
ValueBool: someBoolTagValue,
},
{
Key: someLongTagKey,
ValueType: int64Type,
ValueType: Int64Type,
ValueInt64: someLongTagValue,
},
{
Key: someDoubleTagKey,
ValueType: float64Type,
ValueType: Float64Type,
ValueFloat64: someDoubleTagValue,
},
{
Key: someBinaryTagKey,
ValueType: binaryType,
ValueType: BinaryType,
ValueBinary: someBinaryTagValue,
},
}
Expand Down
36 changes: 18 additions & 18 deletions internal/storage/v1/cassandra/spanstore/dbmodel/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import (
)

const (
childOf = "child-of"
followsFrom = "follows-from"

stringType = "string"
boolType = "bool"
int64Type = "int64"
float64Type = "float64"
binaryType = "binary"
ChildOf = "child-of"
FollowsFrom = "follows-from"

StringType = "string"
BoolType = "bool"
Int64Type = "int64"
Float64Type = "float64"
BinaryType = "binary"
)

// Span is the database representation of a span.
Expand Down Expand Up @@ -56,25 +56,25 @@ type KeyValue struct {

func (t *KeyValue) compareValues(that *KeyValue) int {
switch t.ValueType {
case stringType:
case StringType:
return strings.Compare(t.ValueString, that.ValueString)
case boolType:
case BoolType:
if t.ValueBool != that.ValueBool {
if !t.ValueBool {
return -1
}
return 1
}
case int64Type:
case Int64Type:
return int(t.ValueInt64 - that.ValueInt64)
case float64Type:
case Float64Type:
if t.ValueFloat64 != that.ValueFloat64 {
if t.ValueFloat64 < that.ValueFloat64 {
return -1
}
return 1
}
case binaryType:
case BinaryType:
return bytes.Compare(t.ValueBinary, that.ValueBinary)
default:
return -1 // theoretical case, not stating them equal but placing the base pointer before other
Expand Down Expand Up @@ -120,18 +120,18 @@ func (t *KeyValue) Equal(that any) bool {

func (t *KeyValue) AsString() string {
switch t.ValueType {
case stringType:
case StringType:
return t.ValueString
case boolType:
case BoolType:
if t.ValueBool {
return "true"
}
return "false"
case int64Type:
case Int64Type:
return strconv.FormatInt(t.ValueInt64, 10)
case float64Type:
case Float64Type:
return strconv.FormatFloat(t.ValueFloat64, 'g', 10, 64)
case binaryType:
case BinaryType:
return hex.EncodeToString(t.ValueBinary)
default:
return "unknown type " + t.ValueType
Expand Down
12 changes: 6 additions & 6 deletions internal/storage/v1/cassandra/spanstore/dbmodel/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func TestKeyValueAsString(t *testing.T) {
name: "StringType",
kv: KeyValue{
Key: "k",
ValueType: stringType,
ValueType: StringType,
ValueString: "hello",
},
expect: "hello",
Expand All @@ -298,7 +298,7 @@ func TestKeyValueAsString(t *testing.T) {
name: "BoolTrue",
kv: KeyValue{
Key: "k",
ValueType: boolType,
ValueType: BoolType,
ValueBool: true,
},
expect: "true",
Expand All @@ -307,7 +307,7 @@ func TestKeyValueAsString(t *testing.T) {
name: "BoolFalse",
kv: KeyValue{
Key: "k",
ValueType: boolType,
ValueType: BoolType,
ValueBool: false,
},
expect: "false",
Expand All @@ -316,7 +316,7 @@ func TestKeyValueAsString(t *testing.T) {
name: "Int64Type",
kv: KeyValue{
Key: "k",
ValueType: int64Type,
ValueType: Int64Type,
ValueInt64: 12345,
},
expect: "12345",
Expand All @@ -325,7 +325,7 @@ func TestKeyValueAsString(t *testing.T) {
name: "Float64Type",
kv: KeyValue{
Key: "k",
ValueType: float64Type,
ValueType: Float64Type,
ValueFloat64: 12.34,
},
expect: "12.34",
Expand All @@ -334,7 +334,7 @@ func TestKeyValueAsString(t *testing.T) {
name: "BinaryType",
kv: KeyValue{
Key: "k",
ValueType: binaryType,
ValueType: BinaryType,
ValueBinary: []byte{0xAB, 0xCD, 0xEF},
},
expect: "abcdef",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ func TestBlacklistFilter(t *testing.T) {
for _, test := range tt {
var inputKVs []KeyValue
for _, i := range test.input {
inputKVs = append(inputKVs, KeyValue{Key: i, ValueType: stringType, ValueString: ""})
inputKVs = append(inputKVs, KeyValue{Key: i, ValueType: StringType, ValueString: ""})
}
var expectedKVs []KeyValue
for _, e := range test.expected {
expectedKVs = append(expectedKVs, KeyValue{Key: e, ValueType: stringType, ValueString: ""})
expectedKVs = append(expectedKVs, KeyValue{Key: e, ValueType: StringType, ValueString: ""})
}
SortKVs(expectedKVs)

Expand Down Expand Up @@ -78,11 +78,11 @@ func TestWhitelistFilter(t *testing.T) {
for _, test := range tt {
var inputKVs []KeyValue
for _, i := range test.input {
inputKVs = append(inputKVs, KeyValue{Key: i, ValueType: stringType, ValueString: ""})
inputKVs = append(inputKVs, KeyValue{Key: i, ValueType: StringType, ValueString: ""})
}
var expectedKVs []KeyValue
for _, e := range test.expected {
expectedKVs = append(expectedKVs, KeyValue{Key: e, ValueType: stringType, ValueString: ""})
expectedKVs = append(expectedKVs, KeyValue{Key: e, ValueType: StringType, ValueString: ""})
}
SortKVs(expectedKVs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type onlyStringsFilter struct{}
func (onlyStringsFilter) filterStringTags(tags []KeyValue) []KeyValue {
var ret []KeyValue
for _, tag := range tags {
if tag.ValueType == stringType {
if tag.ValueType == StringType {
ret = append(ret, tag)
}
}
Expand All @@ -47,7 +47,7 @@ func (f onlyStringsFilter) FilterLogFields(_ *Span, logFields []KeyValue) []KeyV
}

func TestChainedTagFilter(t *testing.T) {
expectedTags := []KeyValue{{Key: someStringTagKey, ValueType: stringType, ValueString: someStringTagValue}}
expectedTags := []KeyValue{{Key: someStringTagKey, ValueType: StringType, ValueString: someStringTagValue}}
filter := NewChainedTagFilter(DefaultTagFilter, onlyStringsFilter{})
filteredTags := filter.FilterProcessTags(nil, someDBTags)
compareTags(t, expectedTags, filteredTags)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func GetAllUniqueTags(span *Span, tagFilter TagFilter) []TagInsertion {
SortKVs(allTags)
uniqueTags := make([]TagInsertion, 0, len(allTags))
for i := range allTags {
if allTags[i].ValueType == binaryType {
if allTags[i].ValueType == BinaryType {
continue // do not index binary tags
}
if i > 0 && allTags[i-1].Equal(&allTags[i]) {
Expand Down
Loading
Loading