@@ -1075,9 +1075,6 @@ func (r *ClickHouseReader) GetSpanFilters(ctx context.Context, queryParams *mode
1075
1075
if len (queryParams .HttpRoute ) > 0 {
1076
1076
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpRoute , constants .HttpRoute , & query , args )
1077
1077
}
1078
- if len (queryParams .HttpCode ) > 0 {
1079
- args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpCode , constants .HttpCode , & query , args )
1080
- }
1081
1078
if len (queryParams .HttpHost ) > 0 {
1082
1079
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpHost , constants .HttpHost , & query , args )
1083
1080
}
@@ -1087,9 +1084,6 @@ func (r *ClickHouseReader) GetSpanFilters(ctx context.Context, queryParams *mode
1087
1084
if len (queryParams .HttpUrl ) > 0 {
1088
1085
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpUrl , constants .HttpUrl , & query , args )
1089
1086
}
1090
- if len (queryParams .Component ) > 0 {
1091
- args = buildFilterArrayQuery (ctx , excludeMap , queryParams .Component , constants .Component , & query , args )
1092
- }
1093
1087
if len (queryParams .Operation ) > 0 {
1094
1088
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .Operation , constants .OperationDB , & query , args )
1095
1089
}
@@ -1123,12 +1117,10 @@ func (r *ClickHouseReader) GetSpanFilters(ctx context.Context, queryParams *mode
1123
1117
Operation : map [string ]uint64 {},
1124
1118
ResponseStatusCode : map [string ]uint64 {},
1125
1119
RPCMethod : map [string ]uint64 {},
1126
- HttpCode : map [string ]uint64 {},
1127
1120
HttpMethod : map [string ]uint64 {},
1128
1121
HttpUrl : map [string ]uint64 {},
1129
1122
HttpRoute : map [string ]uint64 {},
1130
1123
HttpHost : map [string ]uint64 {},
1131
- Component : map [string ]uint64 {},
1132
1124
}
1133
1125
1134
1126
for _ , e := range queryParams .GetFilters {
@@ -1152,23 +1144,6 @@ func (r *ClickHouseReader) GetSpanFilters(ctx context.Context, queryParams *mode
1152
1144
traceFilterReponse .ServiceName [service .ServiceName ] = service .Count
1153
1145
}
1154
1146
}
1155
- case constants .HttpCode :
1156
- finalQuery := fmt .Sprintf ("SELECT httpCode, count() as count FROM %s.%s WHERE timestamp >= @timestampL AND timestamp <= @timestampU" , r .TraceDB , r .indexTable )
1157
- finalQuery += query
1158
- finalQuery += " GROUP BY httpCode"
1159
- var dBResponse []model.DBResponseHttpCode
1160
- err := r .db .Select (ctx , & dBResponse , finalQuery , args ... )
1161
- zap .L ().Info (finalQuery )
1162
-
1163
- if err != nil {
1164
- zap .L ().Error ("Error in processing sql query" , zap .Error (err ))
1165
- return nil , & model.ApiError {Typ : model .ErrorExec , Err : fmt .Errorf ("Error in processing sql query: %s" , err )}
1166
- }
1167
- for _ , service := range dBResponse {
1168
- if service .HttpCode != "" {
1169
- traceFilterReponse .HttpCode [service .HttpCode ] = service .Count
1170
- }
1171
- }
1172
1147
case constants .HttpRoute :
1173
1148
finalQuery := fmt .Sprintf ("SELECT httpRoute, count() as count FROM %s.%s WHERE timestamp >= @timestampL AND timestamp <= @timestampU" , r .TraceDB , r .indexTable )
1174
1149
finalQuery += query
@@ -1254,23 +1229,6 @@ func (r *ClickHouseReader) GetSpanFilters(ctx context.Context, queryParams *mode
1254
1229
traceFilterReponse .Operation [service .Operation ] = service .Count
1255
1230
}
1256
1231
}
1257
- case constants .Component :
1258
- finalQuery := fmt .Sprintf ("SELECT component, count() as count FROM %s.%s WHERE timestamp >= @timestampL AND timestamp <= @timestampU" , r .TraceDB , r .indexTable )
1259
- finalQuery += query
1260
- finalQuery += " GROUP BY component"
1261
- var dBResponse []model.DBResponseComponent
1262
- err := r .db .Select (ctx , & dBResponse , finalQuery , args ... )
1263
- zap .L ().Info (finalQuery )
1264
-
1265
- if err != nil {
1266
- zap .L ().Error ("Error in processing sql query" , zap .Error (err ))
1267
- return nil , & model.ApiError {Typ : model .ErrorExec , Err : fmt .Errorf ("Error in processing sql query: %s" , err )}
1268
- }
1269
- for _ , service := range dBResponse {
1270
- if service .Component != "" {
1271
- traceFilterReponse .Component [service .Component ] = service .Count
1272
- }
1273
- }
1274
1232
case constants .Status :
1275
1233
finalQuery := fmt .Sprintf ("SELECT COUNT(*) as numTotal FROM %s.%s WHERE timestamp >= @timestampL AND timestamp <= @timestampU AND hasError = true" , r .TraceDB , r .indexTable )
1276
1234
finalQuery += query
@@ -1441,9 +1399,6 @@ func (r *ClickHouseReader) GetFilteredSpans(ctx context.Context, queryParams *mo
1441
1399
if len (queryParams .HttpRoute ) > 0 {
1442
1400
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpRoute , constants .HttpRoute , & query , args )
1443
1401
}
1444
- if len (queryParams .HttpCode ) > 0 {
1445
- args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpCode , constants .HttpCode , & query , args )
1446
- }
1447
1402
if len (queryParams .HttpHost ) > 0 {
1448
1403
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpHost , constants .HttpHost , & query , args )
1449
1404
}
@@ -1453,9 +1408,6 @@ func (r *ClickHouseReader) GetFilteredSpans(ctx context.Context, queryParams *mo
1453
1408
if len (queryParams .HttpUrl ) > 0 {
1454
1409
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpUrl , constants .HttpUrl , & query , args )
1455
1410
}
1456
- if len (queryParams .Component ) > 0 {
1457
- args = buildFilterArrayQuery (ctx , excludeMap , queryParams .Component , constants .Component , & query , args )
1458
- }
1459
1411
if len (queryParams .Operation ) > 0 {
1460
1412
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .Operation , constants .OperationDB , & query , args )
1461
1413
}
@@ -1736,9 +1688,6 @@ func (r *ClickHouseReader) GetTagFilters(ctx context.Context, queryParams *model
1736
1688
if len (queryParams .HttpRoute ) > 0 {
1737
1689
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpRoute , constants .HttpRoute , & query , args )
1738
1690
}
1739
- if len (queryParams .HttpCode ) > 0 {
1740
- args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpCode , constants .HttpCode , & query , args )
1741
- }
1742
1691
if len (queryParams .HttpHost ) > 0 {
1743
1692
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpHost , constants .HttpHost , & query , args )
1744
1693
}
@@ -1748,9 +1697,6 @@ func (r *ClickHouseReader) GetTagFilters(ctx context.Context, queryParams *model
1748
1697
if len (queryParams .HttpUrl ) > 0 {
1749
1698
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpUrl , constants .HttpUrl , & query , args )
1750
1699
}
1751
- if len (queryParams .Component ) > 0 {
1752
- args = buildFilterArrayQuery (ctx , excludeMap , queryParams .Component , constants .Component , & query , args )
1753
- }
1754
1700
if len (queryParams .Operation ) > 0 {
1755
1701
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .Operation , constants .OperationDB , & query , args )
1756
1702
}
@@ -1811,7 +1757,6 @@ func excludeTags(ctx context.Context, tags []string) []string {
1811
1757
"http.host" : true ,
1812
1758
"messaging.system" : true ,
1813
1759
"messaging.operation" : true ,
1814
- "component" : true ,
1815
1760
"error" : true ,
1816
1761
"service.name" : true ,
1817
1762
}
@@ -1861,9 +1806,6 @@ func (r *ClickHouseReader) GetTagValues(ctx context.Context, queryParams *model.
1861
1806
if len (queryParams .HttpRoute ) > 0 {
1862
1807
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpRoute , constants .HttpRoute , & query , args )
1863
1808
}
1864
- if len (queryParams .HttpCode ) > 0 {
1865
- args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpCode , constants .HttpCode , & query , args )
1866
- }
1867
1809
if len (queryParams .HttpHost ) > 0 {
1868
1810
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpHost , constants .HttpHost , & query , args )
1869
1811
}
@@ -1873,9 +1815,6 @@ func (r *ClickHouseReader) GetTagValues(ctx context.Context, queryParams *model.
1873
1815
if len (queryParams .HttpUrl ) > 0 {
1874
1816
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpUrl , constants .HttpUrl , & query , args )
1875
1817
}
1876
- if len (queryParams .Component ) > 0 {
1877
- args = buildFilterArrayQuery (ctx , excludeMap , queryParams .Component , constants .Component , & query , args )
1878
- }
1879
1818
if len (queryParams .Operation ) > 0 {
1880
1819
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .Operation , constants .OperationDB , & query , args )
1881
1820
}
@@ -2194,9 +2133,6 @@ func (r *ClickHouseReader) GetFilteredSpansAggregates(ctx context.Context, query
2194
2133
if len (queryParams .HttpRoute ) > 0 {
2195
2134
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpRoute , constants .HttpRoute , & query , args )
2196
2135
}
2197
- if len (queryParams .HttpCode ) > 0 {
2198
- args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpCode , constants .HttpCode , & query , args )
2199
- }
2200
2136
if len (queryParams .HttpHost ) > 0 {
2201
2137
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpHost , constants .HttpHost , & query , args )
2202
2138
}
@@ -2206,9 +2142,6 @@ func (r *ClickHouseReader) GetFilteredSpansAggregates(ctx context.Context, query
2206
2142
if len (queryParams .HttpUrl ) > 0 {
2207
2143
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .HttpUrl , constants .HttpUrl , & query , args )
2208
2144
}
2209
- if len (queryParams .Component ) > 0 {
2210
- args = buildFilterArrayQuery (ctx , excludeMap , queryParams .Component , constants .Component , & query , args )
2211
- }
2212
2145
if len (queryParams .Operation ) > 0 {
2213
2146
args = buildFilterArrayQuery (ctx , excludeMap , queryParams .Operation , constants .OperationDB , & query , args )
2214
2147
}
0 commit comments