mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 12:25:58 +08:00
fix: trace column attributes (#3000)
This commit is contained in:
parent
20687d5184
commit
709bfda0cc
@ -4299,6 +4299,8 @@ func (r *ClickHouseReader) GetTraceAggregateAttributes(ctx context.Context, req
|
|||||||
if err := rows.Scan(&tagKey, &tagType, &dataType, &isColumn); err != nil {
|
if err := rows.Scan(&tagKey, &tagType, &dataType, &isColumn); err != nil {
|
||||||
return nil, fmt.Errorf("error while scanning rows: %s", err.Error())
|
return nil, fmt.Errorf("error while scanning rows: %s", err.Error())
|
||||||
}
|
}
|
||||||
|
// TODO: Remove this once the column name are updated in the table
|
||||||
|
tagKey = tempHandleFixedColumns(tagKey)
|
||||||
key := v3.AttributeKey{
|
key := v3.AttributeKey{
|
||||||
Key: tagKey,
|
Key: tagKey,
|
||||||
DataType: v3.AttributeKeyDataType(dataType),
|
DataType: v3.AttributeKeyDataType(dataType),
|
||||||
@ -4338,6 +4340,8 @@ func (r *ClickHouseReader) GetTraceAttributeKeys(ctx context.Context, req *v3.Fi
|
|||||||
if err := rows.Scan(&tagKey, &tagType, &dataType, &isColumn); err != nil {
|
if err := rows.Scan(&tagKey, &tagType, &dataType, &isColumn); err != nil {
|
||||||
return nil, fmt.Errorf("error while scanning rows: %s", err.Error())
|
return nil, fmt.Errorf("error while scanning rows: %s", err.Error())
|
||||||
}
|
}
|
||||||
|
// TODO: Remove this once the column name are updated in the table
|
||||||
|
tagKey = tempHandleFixedColumns(tagKey)
|
||||||
key := v3.AttributeKey{
|
key := v3.AttributeKey{
|
||||||
Key: tagKey,
|
Key: tagKey,
|
||||||
DataType: v3.AttributeKeyDataType(dataType),
|
DataType: v3.AttributeKeyDataType(dataType),
|
||||||
@ -4349,6 +4353,19 @@ func (r *ClickHouseReader) GetTraceAttributeKeys(ctx context.Context, req *v3.Fi
|
|||||||
return &response, nil
|
return &response, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// tempHandleFixedColumns is a temporary function to handle the fixed columns whose name has been changed in AttributeKeys Table
|
||||||
|
func tempHandleFixedColumns(tagKey string) string {
|
||||||
|
switch {
|
||||||
|
case tagKey == "traceId":
|
||||||
|
tagKey = "traceID"
|
||||||
|
case tagKey == "spanId":
|
||||||
|
tagKey = "spanID"
|
||||||
|
case tagKey == "parentSpanId":
|
||||||
|
tagKey = "parentSpanID"
|
||||||
|
}
|
||||||
|
return tagKey
|
||||||
|
}
|
||||||
|
|
||||||
func (r *ClickHouseReader) GetTraceAttributeValues(ctx context.Context, req *v3.FilterAttributeValueRequest) (*v3.FilterAttributeValueResponse, error) {
|
func (r *ClickHouseReader) GetTraceAttributeValues(ctx context.Context, req *v3.FilterAttributeValueRequest) (*v3.FilterAttributeValueResponse, error) {
|
||||||
|
|
||||||
var query string
|
var query string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user