Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
SigNoz
Commits
600edd10
Commit
600edd10
authored
2 years ago
by
makeavish
Browse files
Options
Download
Email Patches
Plain Diff
fix: create new functions for ee
parent
4b2e1572
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
ee/query-service/app/api/metrics.go
+1
-1
ee/query-service/app/api/metrics.go
ee/query-service/app/api/traces.go
+1
-1
ee/query-service/app/api/traces.go
ee/query-service/app/db/reader.go
+3
-3
ee/query-service/app/db/reader.go
pkg/query-service/app/clickhouseReader/reader.go
+11
-1
pkg/query-service/app/clickhouseReader/reader.go
pkg/query-service/app/http_handler.go
+1
-1
pkg/query-service/app/http_handler.go
pkg/query-service/interfaces/interface.go
+3
-1
pkg/query-service/interfaces/interface.go
with
20 additions
and
8 deletions
+20
-8
ee/query-service/app/api/metrics.go
+
1
-
1
View file @
600edd10
...
...
@@ -61,7 +61,7 @@ func (ah *APIHandler) queryRangeMetricsV2(w http.ResponseWriter, r *http.Request
wg
.
Add
(
1
)
go
func
(
name
,
query
string
)
{
defer
wg
.
Done
()
seriesList
,
tableName
,
err
:=
ah
.
opts
.
DataConnector
.
GetMetricResult
(
r
.
Context
(),
query
)
seriesList
,
tableName
,
err
:=
ah
.
opts
.
DataConnector
.
GetMetricResult
EE
(
r
.
Context
(),
query
)
for
_
,
series
:=
range
seriesList
{
series
.
QueryName
=
name
}
...
...
This diff is collapsed.
Click to expand it.
ee/query-service/app/api/traces.go
+
1
-
1
View file @
600edd10
...
...
@@ -39,7 +39,7 @@ func (ah *APIHandler) searchTraces(w http.ResponseWriter, r *http.Request) {
return
}
result
,
err
:=
ah
.
opts
.
DataConnector
.
SearchTraces
(
r
.
Context
(),
traceId
,
spanId
,
levelUpInt
,
levelDownInt
)
result
,
err
:=
ah
.
opts
.
DataConnector
.
SearchTraces
EE
(
r
.
Context
(),
traceId
,
spanId
,
levelUpInt
,
levelDownInt
)
if
ah
.
HandleError
(
w
,
err
,
http
.
StatusBadRequest
)
{
return
}
...
...
This diff is collapsed.
Click to expand it.
ee/query-service/app/db/reader.go
+
3
-
3
View file @
600edd10
...
...
@@ -45,7 +45,7 @@ func (r *ClickhouseReader) Start(readerReady chan bool) {
r
.
ClickHouseReader
.
Start
(
readerReady
)
}
func
(
r
*
ClickhouseReader
)
SearchTraces
(
ctx
context
.
Context
,
traceId
string
,
spanId
string
,
levelUp
int
,
levelDown
int
)
(
*
[]
basemodel
.
SearchSpansResult
,
error
)
{
func
(
r
*
ClickhouseReader
)
SearchTraces
EE
(
ctx
context
.
Context
,
traceId
string
,
spanId
string
,
levelUp
int
,
levelDown
int
)
(
*
[]
basemodel
.
SearchSpansResult
,
error
)
{
var
searchScanResponses
[]
basemodel
.
SearchSpanDBResponseItem
query
:=
fmt
.
Sprintf
(
"SELECT timestamp, traceID, model FROM %s.%s WHERE traceID=$1"
,
r
.
ClickHouseReader
.
TraceDB
,
r
.
SpansTable
)
...
...
@@ -304,8 +304,8 @@ func breadthFirstSearch(spansPtr *model.Span, targetId string) (*model.Span, err
return
nil
,
nil
}
// GetMetricResult runs the query and returns list of time series
func
(
r
*
ClickhouseReader
)
GetMetricResult
(
ctx
context
.
Context
,
query
string
)
([]
*
basemodel
.
Series
,
string
,
error
)
{
// GetMetricResult
EE
runs the query and returns list of time series
func
(
r
*
ClickhouseReader
)
GetMetricResult
EE
(
ctx
context
.
Context
,
query
string
)
([]
*
basemodel
.
Series
,
string
,
error
)
{
defer
utils
.
Elapsed
(
"GetMetricResult"
)()
zap
.
S
()
.
Infof
(
"Executing metric result query: %s"
,
query
)
...
...
This diff is collapsed.
Click to expand it.
pkg/query-service/app/clickhouseReader/reader.go
+
11
-
1
View file @
600edd10
...
...
@@ -1711,7 +1711,12 @@ func (r *ClickHouseReader) GetUsage(ctx context.Context, queryParams *model.GetU
return
&
usageItems
,
nil
}
func
(
r
*
ClickHouseReader
)
SearchTraces
(
ctx
context
.
Context
,
traceId
string
,
spanId
string
,
levelUp
int
,
levelDown
int
)
(
*
[]
model
.
SearchSpansResult
,
error
)
{
func
(
r
*
ClickHouseReader
)
SearchTracesEE
(
ctx
context
.
Context
,
traceId
string
,
spanId
string
,
levelUp
int
,
levelDown
int
)
(
*
[]
model
.
SearchSpansResult
,
error
)
{
zap
.
S
()
.
Error
(
"SearchTracesEE is not implemented for opensource version"
)
return
nil
,
fmt
.
Errorf
(
"SearchTracesEE is not implemented for opensource version"
)
}
func
(
r
*
ClickHouseReader
)
SearchTraces
(
ctx
context
.
Context
,
traceId
string
,
spanId
string
)
(
*
[]
model
.
SearchSpansResult
,
error
)
{
var
searchScanResponses
[]
model
.
SearchSpanDBResponseItem
...
...
@@ -2823,6 +2828,11 @@ func (r *ClickHouseReader) GetMetricAutocompleteMetricNames(ctx context.Context,
}
func
(
r
*
ClickHouseReader
)
GetMetricResultEE
(
ctx
context
.
Context
,
query
string
)
([]
*
model
.
Series
,
string
,
error
)
{
zap
.
S
()
.
Error
(
"GetMetricResultEE is not implemented for opensource version"
)
return
nil
,
""
,
fmt
.
Errorf
(
"GetMetricResultEE is not implemented for opensource version"
)
}
// GetMetricResult runs the query and returns list of time series
func
(
r
*
ClickHouseReader
)
GetMetricResult
(
ctx
context
.
Context
,
query
string
)
([]
*
model
.
Series
,
string
,
error
)
{
...
...
This diff is collapsed.
Click to expand it.
pkg/query-service/app/http_handler.go
+
1
-
1
View file @
600edd10
...
...
@@ -1322,7 +1322,7 @@ func (aH *APIHandler) SearchTraces(w http.ResponseWriter, r *http.Request) {
traceId
:=
vars
[
"traceId"
]
spanId
:=
r
.
URL
.
Query
()
.
Get
(
"spanId"
)
result
,
err
:=
aH
.
reader
.
SearchTraces
(
r
.
Context
(),
traceId
,
spanId
,
0
,
0
)
result
,
err
:=
aH
.
reader
.
SearchTraces
(
r
.
Context
(),
traceId
,
spanId
)
if
aH
.
HandleError
(
w
,
err
,
http
.
StatusBadRequest
)
{
return
}
...
...
This diff is collapsed.
Click to expand it.
pkg/query-service/interfaces/interface.go
+
3
-
1
View file @
600edd10
...
...
@@ -46,7 +46,8 @@ type Reader interface {
GetNextPrevErrorIDs
(
ctx
context
.
Context
,
params
*
model
.
GetErrorParams
)
(
*
model
.
NextPrevErrorIDs
,
*
model
.
ApiError
)
// Search Interfaces
SearchTraces
(
ctx
context
.
Context
,
traceID
string
,
spanId
string
,
levelUp
int
,
levelDown
int
)
(
*
[]
model
.
SearchSpansResult
,
error
)
SearchTraces
(
ctx
context
.
Context
,
traceID
string
,
spanId
string
)
(
*
[]
model
.
SearchSpansResult
,
error
)
SearchTracesEE
(
ctx
context
.
Context
,
traceID
string
,
spanId
string
,
levelUp
int
,
levelDown
int
)
(
*
[]
model
.
SearchSpansResult
,
error
)
// Setter Interfaces
SetTTL
(
ctx
context
.
Context
,
ttlParams
*
model
.
TTLParams
)
(
*
model
.
SetTTLResponseItem
,
*
model
.
ApiError
)
...
...
@@ -55,6 +56,7 @@ type Reader interface {
GetMetricAutocompleteTagKey
(
ctx
context
.
Context
,
params
*
model
.
MetricAutocompleteTagParams
)
(
*
[]
string
,
*
model
.
ApiError
)
GetMetricAutocompleteTagValue
(
ctx
context
.
Context
,
params
*
model
.
MetricAutocompleteTagParams
)
(
*
[]
string
,
*
model
.
ApiError
)
GetMetricResult
(
ctx
context
.
Context
,
query
string
)
([]
*
model
.
Series
,
string
,
error
)
GetMetricResultEE
(
ctx
context
.
Context
,
query
string
)
([]
*
model
.
Series
,
string
,
error
)
GetTotalSpans
(
ctx
context
.
Context
)
(
uint64
,
error
)
GetSpansInLastHeartBeatInterval
(
ctx
context
.
Context
)
(
uint64
,
error
)
...
...
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