mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 04:59:02 +08:00
feat: ✨ support gRPC status, method in trace table (#987)
This commit is contained in:
parent
182adc551c
commit
6064840dd1
@ -1553,7 +1553,7 @@ func getStatusFilters(query string, statusParams []string, excludeMap map[string
|
||||
|
||||
func (r *ClickHouseReader) GetFilteredSpans(ctx context.Context, queryParams *model.GetFilteredSpansParams) (*model.GetFilterSpansResponse, *model.ApiError) {
|
||||
|
||||
baseQuery := fmt.Sprintf("SELECT timestamp, spanID, traceID, serviceName, name, durationNano, httpCode, httpMethod FROM %s WHERE timestamp >= ? AND timestamp <= ?", r.indexTable)
|
||||
baseQuery := fmt.Sprintf("SELECT timestamp, spanID, traceID, serviceName, name, durationNano, httpCode, gRPCCode, gRPCMethod, httpMethod FROM %s WHERE timestamp >= ? AND timestamp <= ?", r.indexTable)
|
||||
|
||||
excludeMap := make(map[string]struct{})
|
||||
for _, e := range queryParams.Exclude {
|
||||
@ -1688,6 +1688,19 @@ func (r *ClickHouseReader) GetFilteredSpans(ctx context.Context, queryParams *mo
|
||||
|
||||
baseQuery += query
|
||||
err = r.db.Select(&getFilterSpansResponseItems, baseQuery, args...)
|
||||
// Fill status and method
|
||||
for i, e := range getFilterSpansResponseItems {
|
||||
if e.HttpCode == "" {
|
||||
getFilterSpansResponseItems[i].StatusCode = e.GRPCode
|
||||
} else {
|
||||
getFilterSpansResponseItems[i].StatusCode = e.HttpCode
|
||||
}
|
||||
if e.HttpMethod == "" {
|
||||
getFilterSpansResponseItems[i].Method = e.GRPMethod
|
||||
} else {
|
||||
getFilterSpansResponseItems[i].Method = e.HttpMethod
|
||||
}
|
||||
}
|
||||
|
||||
zap.S().Info(baseQuery)
|
||||
|
||||
|
@ -115,8 +115,12 @@ type GetFilterSpansResponseItem struct {
|
||||
ServiceName string `db:"serviceName" json:"serviceName"`
|
||||
Operation string `db:"name" json:"operation"`
|
||||
DurationNano int64 `db:"durationNano" json:"durationNano"`
|
||||
HttpCode string `db:"httpCode" json:"httpCode"`
|
||||
HttpMethod string `db:"httpMethod" json:"httpMethod"`
|
||||
HttpCode string `db:"httpCode"`
|
||||
HttpMethod string `db:"httpMethod"`
|
||||
GRPCode string `db:"gRPCCode"`
|
||||
GRPMethod string `db:"gRPCMethod"`
|
||||
StatusCode string `json:"statusCode"`
|
||||
Method string `json:"method"`
|
||||
}
|
||||
|
||||
type GetFilterSpansResponse struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user