mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-17 00:45:55 +08:00
Merge branch 'develop' into issue-3400-ui-horizontal-scroll-logs-context
This commit is contained in:
commit
f89f3c0b14
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/jmoiron/sqlx"
|
||||||
"go.signoz.io/signoz/pkg/query-service/model"
|
"go.signoz.io/signoz/pkg/query-service/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -11,19 +12,16 @@ const defaultApdexThreshold = 0.5
|
|||||||
|
|
||||||
func (mds *ModelDaoSqlite) GetApdexSettings(ctx context.Context, services []string) ([]model.ApdexSettings, *model.ApiError) {
|
func (mds *ModelDaoSqlite) GetApdexSettings(ctx context.Context, services []string) ([]model.ApdexSettings, *model.ApiError) {
|
||||||
var apdexSettings []model.ApdexSettings
|
var apdexSettings []model.ApdexSettings
|
||||||
var serviceName string
|
|
||||||
|
|
||||||
for i, service := range services {
|
query, args, err := sqlx.In("SELECT * FROM apdex_settings WHERE service_name IN (?)", services)
|
||||||
if i == 0 {
|
if err != nil {
|
||||||
serviceName = fmt.Sprintf("'%s'", service)
|
return nil, &model.ApiError{
|
||||||
} else {
|
Err: err,
|
||||||
serviceName = fmt.Sprintf("%s, '%s'", serviceName, service)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
query = mds.db.Rebind(query)
|
||||||
|
|
||||||
query := fmt.Sprintf("SELECT * FROM apdex_settings WHERE service_name IN (%s)", serviceName)
|
err = mds.db.Select(&apdexSettings, query, args...)
|
||||||
|
|
||||||
err := mds.db.Select(&apdexSettings, query)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, &model.ApiError{
|
return nil, &model.ApiError{
|
||||||
Err: err,
|
Err: err,
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.signoz.io/signoz/ee/query-service/model"
|
|
||||||
"go.signoz.io/signoz/pkg/query-service/constants"
|
"go.signoz.io/signoz/pkg/query-service/constants"
|
||||||
|
"go.signoz.io/signoz/pkg/query-service/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
var C *Client
|
var C *Client
|
||||||
|
Loading…
x
Reference in New Issue
Block a user