MCPcopy
hub / github.com/grafana/tempo / attr

Function attr

tempodb/encoding/vparquet5/block_traceql_test.go:2035–2056  ·  view source on GitHub ↗
(key string, val any)

Source from the content-addressed store, hash-verified

2033}
2034
2035func attr(key string, val any) Attribute {
2036 switch val := val.(type) {
2037 case string:
2038 return Attribute{Key: key, Value: []string{val}, IsArray: false}
2039 case []string:
2040 return Attribute{Key: key, Value: val, IsArray: true}
2041 case int:
2042 return Attribute{Key: key, ValueInt: []int64{int64(val)}, IsArray: false}
2043 case []int64:
2044 return Attribute{Key: key, ValueInt: val, IsArray: true}
2045 case float64:
2046 return Attribute{Key: key, ValueDouble: []float64{val}, IsArray: false}
2047 case []float64:
2048 return Attribute{Key: key, ValueDouble: val, IsArray: true}
2049 case bool:
2050 return Attribute{Key: key, ValueBool: []bool{val}, IsArray: false}
2051 case []bool:
2052 return Attribute{Key: key, ValueBool: val, IsArray: true}
2053 default:
2054 panic(fmt.Sprintf("type %T not supported for attribute '%s'", val, key))
2055 }
2056}
2057
2058func TestDescendantOf(t *testing.T) {
2059 ancestor1 := &span{nestedSetLeft: 3, nestedSetRight: 8}

Callers 11

TestBackendBlockSearchFunction · 0.70
makeTracesFunction · 0.70
TestFetchTagNamesFunction · 0.70
TestFieldsAreClearedFunction · 0.70
TestTraceToParquetFunction · 0.70
mixedArrayTestTraceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected