mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 06:29:02 +08:00
fix: use rpc method and responseStatusCode (#1971)
Co-authored-by: Palash Gupta <palashgdev@gmail.com> Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
This commit is contained in:
parent
ebbad5812f
commit
835251b342
@ -1401,18 +1401,13 @@ func (r *ClickHouseReader) GetFilteredSpans(ctx context.Context, queryParams *mo
|
|||||||
|
|
||||||
var getFilterSpansResponseItems []model.GetFilterSpansResponseItem
|
var getFilterSpansResponseItems []model.GetFilterSpansResponseItem
|
||||||
|
|
||||||
baseQuery := fmt.Sprintf("SELECT timestamp, spanID, traceID, serviceName, name, durationNano, httpCode, gRPCCode, gRPCMethod, httpMethod, rpcMethod, responseStatusCode FROM %s WHERE timestamp >= @timestampL AND timestamp <= @timestampU", queryTable)
|
baseQuery := fmt.Sprintf("SELECT timestamp, spanID, traceID, serviceName, name, durationNano, httpMethod, rpcMethod, responseStatusCode FROM %s WHERE timestamp >= @timestampL AND timestamp <= @timestampU", queryTable)
|
||||||
baseQuery += query
|
baseQuery += query
|
||||||
err := r.db.Select(ctx, &getFilterSpansResponseItems, baseQuery, args...)
|
err := r.db.Select(ctx, &getFilterSpansResponseItems, baseQuery, args...)
|
||||||
// Fill status and method
|
// Fill status and method
|
||||||
for i, e := range getFilterSpansResponseItems {
|
for i, e := range getFilterSpansResponseItems {
|
||||||
if e.GRPCode != "" {
|
if e.RPCMethod != "" {
|
||||||
getFilterSpansResponseItems[i].StatusCode = e.GRPCode
|
getFilterSpansResponseItems[i].Method = e.RPCMethod
|
||||||
} else {
|
|
||||||
getFilterSpansResponseItems[i].StatusCode = e.HttpCode
|
|
||||||
}
|
|
||||||
if e.GRPMethod != "" {
|
|
||||||
getFilterSpansResponseItems[i].Method = e.GRPMethod
|
|
||||||
} else {
|
} else {
|
||||||
getFilterSpansResponseItems[i].Method = e.HttpMethod
|
getFilterSpansResponseItems[i].Method = e.HttpMethod
|
||||||
}
|
}
|
||||||
|
@ -180,13 +180,9 @@ type GetFilterSpansResponseItem struct {
|
|||||||
ServiceName string `ch:"serviceName" json:"serviceName"`
|
ServiceName string `ch:"serviceName" json:"serviceName"`
|
||||||
Operation string `ch:"name" json:"operation"`
|
Operation string `ch:"name" json:"operation"`
|
||||||
DurationNano uint64 `ch:"durationNano" json:"durationNano"`
|
DurationNano uint64 `ch:"durationNano" json:"durationNano"`
|
||||||
HttpCode string `ch:"httpCode"`
|
|
||||||
HttpMethod string `ch:"httpMethod"`
|
HttpMethod string `ch:"httpMethod"`
|
||||||
GRPCode string `ch:"gRPCCode"`
|
|
||||||
GRPMethod string `ch:"gRPCMethod"`
|
|
||||||
StatusCode string `json:"statusCode"`
|
|
||||||
Method string `json:"method"`
|
Method string `json:"method"`
|
||||||
ResponseStatusCode string `ch:"responseStatusCode"`
|
ResponseStatusCode string `ch:"responseStatusCode" json:"statusCode"`
|
||||||
RPCMethod string `ch:"rpcMethod"`
|
RPCMethod string `ch:"rpcMethod"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user