Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
SigNoz
Commits
70e0f7d2
Commit
70e0f7d2
authored
3 years ago
by
makeavish
Browse files
Options
Download
Email Patches
Plain Diff
feat:
support gRPC status, method in trace table
parent
d454482f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/query-service/app/clickhouseReader/reader.go
+14
-1
pkg/query-service/app/clickhouseReader/reader.go
pkg/query-service/model/response.go
+6
-2
pkg/query-service/model/response.go
with
20 additions
and
3 deletions
+20
-3
pkg/query-service/app/clickhouseReader/reader.go
+
14
-
1
View file @
70e0f7d2
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
pkg/query-service/model/response.go
+
6
-
2
View file @
70e0f7d2
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help