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

Function attr

tempodb/encoding/vparquet4/block_traceql_test.go:1785–1806  ·  view source on GitHub ↗
(key string, val any)

Source from the content-addressed store, hash-verified

1783}
1784
1785func attr(key string, val any) Attribute {
1786 switch val := val.(type) {
1787 case string:
1788 return Attribute{Key: key, Value: []string{val}, IsArray: false}
1789 case []string:
1790 return Attribute{Key: key, Value: val, IsArray: true}
1791 case int:
1792 return Attribute{Key: key, ValueInt: []int64{int64(val)}, IsArray: false}
1793 case []int64:
1794 return Attribute{Key: key, ValueInt: val, IsArray: true}
1795 case float64:
1796 return Attribute{Key: key, ValueDouble: []float64{val}, IsArray: false}
1797 case []float64:
1798 return Attribute{Key: key, ValueDouble: val, IsArray: true}
1799 case bool:
1800 return Attribute{Key: key, ValueBool: []bool{val}, IsArray: false}
1801 case []bool:
1802 return Attribute{Key: key, ValueBool: val, IsArray: true}
1803 default:
1804 panic(fmt.Sprintf("type %T not supported for attribute '%s'", val, key))
1805 }
1806}
1807
1808func TestDescendantOf(t *testing.T) {
1809 ancestor1 := &span{nestedSetLeft: 3, nestedSetRight: 8}

Callers 9

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

Calls

no outgoing calls

Tested by

no test coverage detected