Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

chore(ff): remove unused SMART_TRACE_DETAIL feature flag (#7527)

Vibhu Pandey68f874e433e3
diff --git a/ee/query-service/app/api/api.go b/ee/query-service/app/api/api.go
index debb780425..35020a87d5 100644
--- a/ee/query-service/app/api/api.go
+++ b/ee/query-service/app/api/api.go
@@ -162,7 +162,6 @@ func (ah *APIHandler) RegisterRoutes(router *mux.Router, am *baseapp.AuthMiddlew
router.HandleFunc("/api/v1/invite/{token}", am.OpenAccess(ah.getInvite)).Methods(http.MethodGet)
router.HandleFunc("/api/v1/register", am.OpenAccess(ah.registerUser)).Methods(http.MethodPost)
router.HandleFunc("/api/v1/login", am.OpenAccess(ah.loginUser)).Methods(http.MethodPost)
- router.HandleFunc("/api/v1/traces/{traceId}", am.ViewAccess(ah.searchTraces)).Methods(http.MethodGet)
// PAT APIs
router.HandleFunc("/api/v1/pats", am.AdminAccess(ah.createPAT)).Methods(http.MethodPost)
diff --git a/ee/query-service/app/api/traces.go b/ee/query-service/app/api/traces.go
deleted file mode 100644
index 965c8128c6..0000000000
--- a/ee/query-service/app/api/traces.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package api
-
-import (
- "net/http"
-
- "github.com/SigNoz/signoz/ee/query-service/app/db"
- "github.com/SigNoz/signoz/ee/query-service/model"
- baseapp "github.com/SigNoz/signoz/pkg/query-service/app"
- basemodel "github.com/SigNoz/signoz/pkg/query-service/model"
- "go.uber.org/zap"
-)
-
-func (ah *APIHandler) searchTraces(w http.ResponseWriter, r *http.Request) {
-
- if !ah.CheckFeature(basemodel.SmartTraceDetail) {
- zap.L().Info("SmartTraceDetail feature is not enabled in this plan")
- ah.APIHandler.SearchTraces(w, r)
- return
- }
- searchTracesParams, err := baseapp.ParseSearchTracesParams(r)
- if err != nil {
- RespondError(w, &model.ApiError{Typ: model.ErrorBadData, Err: err}, "Error reading params")
- return
- }
-
- result, err := ah.opts.DataConnector.SearchTraces(r.Context(), searchTracesParams, db.SmartTraceAlgorithm)
- if ah.HandleError(w, err, http.StatusBadRequest) {
- return
- }
-
- ah.WriteJSON(w, r, result)
-
-}
diff --git a/ee/query-service/app/db/reader.go b/ee/query-service/app/db/reader.go
index 7775908d48..a77f1a13d2 100644
--- a/ee/query-service/app/db/reader.go
+++ b/ee/query-service/app/db/reader.go
@@ -8,7 +8,6 @@ import (
"github.com/SigNoz/signoz/pkg/cache"
"github.com/SigNoz/signoz/pkg/prometheus"
basechr "github.com/SigNoz/signoz/pkg/query-service/app/clickhouseReader"
- "github.com/SigNoz/signoz/pkg/query-service/interfaces"
"github.com/SigNoz/signoz/pkg/sqlstore"
"github.com/SigNoz/signoz/pkg/telemetrystore"
)
@@ -23,14 +22,13 @@ func NewDataConnector(
sqlDB sqlstore.SQLStore,
telemetryStore telemetrystore.TelemetryStore,
prometheus prometheus.Prometheus,
- lm interfaces.FeatureLookup,
cluster string,
useLogsNewSchema bool,
useTraceNewSchema bool,
fluxIntervalForTraceDetail time.Duration,
cache cache.Cache,
) *ClickhouseReader {
- chReader := basechr.NewReader(sqlDB, telemetryStore, prometheus, lm, cluster, useLogsNewSchema, useTraceNewSchema, fluxIntervalForTraceDetail, cache)
+ chReader := basechr.NewReader(sqlDB, telemetryStore, prometheus, cluster, useLogsNewSchema, useTraceNewSchema, fluxIntervalForTraceDetail, cache)
return &ClickhouseReader{
conn: telemetryStore.ClickhouseDB(),
appdb: sqlDB,
diff --git a/ee/query-service/app/server.go b/ee/query-service/app/server.go
index 79d07aa65d..e4daf18a16 100644
--- a/ee/query-service/app/server.go
+++ b/ee/query-service/app/server.go
@@ -142,7 +142,6 @@ func NewServer(serverOptions *ServerOptions) (*Server, error) {
serverOptions.SigNoz.SQLStore,
serverOptions.SigNoz.TelemetryStore,
serverOptions.SigNoz.Prometheus,
- lm,
serverOptions.Cluster,
serverOptions.UseLogsNewSchema,
serverOptions.UseTraceNewSchema,
diff --git a/ee/query-service/model/plans.go b/ee/query-service/model/plans.go
index 7c8db533df..f0e85cf1bd 100644
--- a/ee/query-service/model/plans.go
+++ b/ee/query-service/model/plans.go
@@ -52,13 +52,6 @@ var BasicPlan = basemodel.FeatureSet{
UsageLimit: -1,
Route: "",
},
- basemodel.Feature{
- Name: basemodel.SmartTraceDetail,
- Active: false,
- Usage: 0,
- UsageLimit: -1,
- Route: "",
- },
basemodel.Feature{
Name: basemodel.CustomMetricsFunction,
Active: false,
@@ -181,13 +174,6 @@ var ProPlan = basemodel.FeatureSet{
UsageLimit: -1,
Route: "",
},
- basemodel.Feature{
- Name: basemodel.SmartTraceDetail,
- Active: true,
- Usage: 0,
- UsageLimit: -1,
- Route: "",
- },
basemodel.Feature{
Name: basemodel.CustomMetricsFunction,
Active: true,
@@ -310,13 +296,6 @@ var EnterprisePlan = basemodel.FeatureSet{
UsageLimit: -1,
Route: "",
},
- basemodel.Feature{
- Name: basemodel.SmartTraceDetail,
- Active: true,
- Usage: 0,
- UsageLimit: -1,
- Route: "",
- },
basemodel.Feature{
Name: basemodel.CustomMetricsFunction,
Active: true,
diff --git a/frontend/src/constants/features.ts b/frontend/src/constants/features.ts
index 50ba72d034..f12c505d1f 100644
--- a/frontend/src/constants/features.ts
+++ b/frontend/src/constants/features.ts
@@ -10,7 +10,6 @@ export enum FeatureKeys {
ALERT_CHANNEL_MSTEAMS = 'ALERT_CHANNEL_MSTEAMS',
DurationSort = 'DurationSort',
TimestampSort = 'TimestampSort',
- SMART_TRACE_DETAIL = 'SMART_TRACE_DETAIL',
CUSTOM_METRICS_FUNCTION = 'CUSTOM_METRICS_FUNCTION',
QUERY_BUILDER_PANELS = 'QUERY_BUILDER_PANELS',
QUERY_BUILDER_ALERTS = 'QUERY_BUILDER_ALERTS',
diff --git a/frontend/src/tests/test-utils.tsx b/frontend/src/tests/test-utils.tsx
index f809bd41ad..4b556b756c 100644
--- a/frontend/src/tests/test-utils.tsx
+++ b/frontend/src/tests/test-utils.tsx
@@ -200,13 +200,6 @@ export function getAppContextMock(
usage_limit: -1,
route: '',
},
- {
- name: FeatureKeys.SMART_TRACE_DETAIL,
- active: true,
- usage: 0,
- usage_limit: -1,
- route: '',
- },
{
name: FeatureKeys.CUSTOM_METRICS_FUNCTION,
active: true,
diff --git a/go.mod b/go.mod
index 1cd7054590..29877e4f05 100644
--- a/go.mod
+++ b/go.mod
@@ -77,7 +77,6 @@ require (
gopkg.in/segmentio/analytics-go.v3 v3.1.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
- honnef.co/go/tools v0.0.1-2020.1.4
k8s.io/apimachinery v0.31.3
)
@@ -89,7 +88,6 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
- github.com/BurntSushi/toml v0.3.1 // indirect
github.com/ClickHouse/ch-go v0.61.5 // indirect
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect
github.com/andybalholm/brotli v1.1.1 // indirect
diff --git a/go.sum b/go.sum
index fa11606a67..9a8ac0c422 100644
--- a/go.sum
+++ b/go.sum
@@ -83,7 +83,6 @@ github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJ
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
-github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ClickHouse/ch-go v0.61.5 h1:zwR8QbYI0tsMiEcze/uIMK+Tz1D3XZXLdNrlaOpeEI4=
@@ -1653,7 +1652,6 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8=
k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE=
diff --git a/pkg/query-service/app/clickhouseReader/reader.go b/pkg/query-service/app/clickhouseReader/reader.go
index 5bad4d2165..67d5328416 100644
--- a/pkg/query-service/app/clickhouseReader/reader.go
+++ b/pkg/query-service/app/clickhouseReader/reader.go
@@ -22,10 +22,8 @@ import (
"github.com/SigNoz/signoz/pkg/types"
"github.com/SigNoz/signoz/pkg/valuer"
"github.com/uptrace/bun"
- "honnef.co/go/tools/config"
"github.com/google/uuid"
- "github.com/mailru/easyjson"
"github.com/pkg/errors"
"github.com/prometheus/prometheus/promql"
@@ -46,7 +44,6 @@ import (
"github.com/SigNoz/signoz/pkg/query-service/common"
"github.com/SigNoz/signoz/pkg/query-service/constants"
chErrors "github.com/SigNoz/signoz/pkg/query-service/errors"
- "github.com/SigNoz/signoz/pkg/query-service/interfaces"
"github.com/SigNoz/signoz/pkg/query-service/metrics"
"github.com/SigNoz/signoz/pkg/query-service/model"
v3 "github.com/SigNoz/signoz/pkg/query-service/model/v3"
@@ -143,10 +140,6 @@ type ClickHouseReader struct {
logsResourceTableV2 string
logsResourceLocalTableV2 string
- promConfigFile string
- promConfig *config.Config
- featureFlags interfaces.FeatureLookup
-
liveTailRefreshSeconds int
cluster string
@@ -172,7 +165,6 @@ func NewReader(
sqlDB sqlstore.SQLStore,
telemetryStore telemetrystore.TelemetryStore,
prometheus prometheus.Prometheus,
- featureFlag interfaces.FeatureLookup,
cluster string,
useLogsNewSchema bool,
useTraceNewSchema bool,
@@ -180,7 +172,7 @@ func NewReader(
cache cache.Cache,
) *ClickHouseReader {
options := NewOptions(primaryNamespace, archiveNamespace)
- return NewReaderFromClickhouseConnection(options, sqlDB, telemetryStore, prometheus, featureFlag, cluster, useLogsNewSchema, useTraceNewSchema, fluxIntervalForTraceDetail, cache)
+ return NewReaderFromClickhouseConnection(options, sqlDB, telemetryStore, prometheus, cluster, useLogsNewSchema, useTraceNewSchema, fluxIntervalForTraceDetail, cache)
}
func NewReaderFromClickhouseConnection(
@@ -188,7 +180,6 @@ func NewReaderFromClickhouseConnection(
sqlDB sqlstore.SQLStore,
telemetryStore telemetrystore.TelemetryStore,
prometheus prometheus.Prometheus,
- featureFlag interfaces.FeatureLookup,
cluster string,
useLogsNewSchema bool,
useTraceNewSchema bool,
@@ -231,7 +222,6 @@ func NewReaderFromClickhouseConnection(
logsResourceKeys: options.primary.LogsResourceKeysTable,
logsTagAttributeTableV2: options.primary.LogsTagAttributeTableV2,
liveTailRefreshSeconds: options.primary.LiveTailRefreshSeconds,
- featureFlags: featureFlag,
cluster: cluster,
queryProgressTracker: queryprogress.NewQueryProgressTracker(),
@@ -990,267 +980,6 @@ func (r *ClickHouseReader) GetUsage(ctx context.Context, queryParams *model.GetU
return &usageItems, nil
}
-func (r *ClickHouseReader) SearchTracesV2(ctx context.Context, params *model.SearchTracesParams,
- smartTraceAlgorithm func(payload []model.SearchSpanResponseItem, targetSpanId string,
- levelUp int, levelDown int, spanLimit int) ([]model.SearchSpansResult, error)) (*[]model.SearchSpansResult, error) {
- searchSpansResult := []model.SearchSpansResult{
- {
- Columns: []string{"__time", "SpanId", "TraceId", "ServiceName", "Name", "Kind", "DurationNano", "TagsKeys", "TagsValues", "References", "Events", "HasError", "StatusMessage", "StatusCodeString", "SpanKind"},
- IsSubTree: false,
- Events: make([][]interface{}, 0),
- },
- }
-
- var traceSummary model.TraceSummary
- summaryQuery := fmt.Sprintf("SELECT * from %s.%s WHERE trace_id=$1", r.TraceDB, r.traceSummaryTable)
- err := r.db.QueryRow(ctx, summaryQuery, params.TraceID).Scan(&traceSummary.TraceID, &traceSummary.Start, &traceSummary.End, &traceSummary.NumSpans)
- if err != nil {
- if err == sql.ErrNoRows {
- return &searchSpansResult, nil
- }
- zap.L().Error("Error in processing sql query", zap.Error(err))
- return nil, fmt.Errorf("error in processing sql query")
- }
-
- if traceSummary.NumSpans > uint64(params.MaxSpansInTrace) {
- zap.L().Error("Max spans allowed in a trace limit reached", zap.Int("MaxSpansInTrace", params.MaxSpansInTrace),
- zap.Uint64("Count", traceSummary.NumSpans))
- claims, ok := authtypes.ClaimsFromContext(ctx)
- if ok {
- data := map[string]interface{}{
- "traceSize": traceSummary.NumSpans,
- "maxSpansInTraceLimit": params.MaxSpansInTrace,
- }
- telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_MAX_SPANS_ALLOWED_LIMIT_REACHED, data, claims.Email, true, false)
- }
- return nil, fmt.Errorf("max spans allowed in trace limit reached, please contact support for more details")
- }
-
- claims, ok := authtypes.ClaimsFromContext(ctx)
- if ok {
- data := map[string]interface{}{
- "traceSize": traceSummary.NumSpans,
- }
- telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_TRACE_DETAIL_API, data, claims.Email, true, false)
- }
-
- var startTime, endTime, durationNano uint64
- var searchScanResponses []model.SpanItemV2
-
- query := fmt.Sprintf("SELECT timestamp, duration_nano, span_id, trace_id, has_error, kind, resource_string_service$$name, name, references, attributes_string, attributes_number, attributes_bool, resources_string, events, status_message, status_code_string, kind_string FROM %s.%s WHERE trace_id=$1 and ts_bucket_start>=$2 and ts_bucket_start<=$3", r.TraceDB, r.traceTableName)
-
- start := time.Now()
-
- err = r.db.Select(ctx, &searchScanResponses, query, params.TraceID, strconv.FormatInt(traceSummary.Start.Unix()-1800, 10), strconv.FormatInt(traceSummary.End.Unix(), 10))
-
- zap.L().Info(query)
-
- if err != nil {
- zap.L().Error("Error in processing sql query", zap.Error(err))
- return nil, fmt.Errorf("error in processing sql query")
- }
- end := time.Now()
- zap.L().Debug("getTraceSQLQuery took: ", zap.Duration("duration", end.Sub(start)))
-
- searchSpansResult[0].Events = make([][]interface{}, len(searchScanResponses))
-
- searchSpanResponses := []model.SearchSpanResponseItem{}
- start = time.Now()
- for _, item := range searchScanResponses {
- ref := []model.OtelSpanRef{}
- err := json.Unmarshal([]byte(item.References), &ref)
- if err != nil {
- zap.L().Error("Error unmarshalling references", zap.Error(err))
- return nil, err
- }
-
- // merge attributes_number and attributes_bool to attributes_string
- for k, v := range item.Attributes_bool {
- item.Attributes_string[k] = fmt.Sprintf("%v", v)
- }
- for k, v := range item.Attributes_number {
- item.Attributes_string[k] = fmt.Sprintf("%v", v)
- }
- for k, v := range item.Resources_string {
- item.Attributes_string[k] = v
- }
-
- jsonItem := model.SearchSpanResponseItem{
- SpanID: item.SpanID,
- TraceID: item.TraceID,
- ServiceName: item.ServiceName,
- Name: item.Name,
- Kind: int32(item.Kind),
- DurationNano: int64(item.DurationNano),
- HasError: item.HasError,
- StatusMessage: item.StatusMessage,
- StatusCodeString: item.StatusCodeString,
- SpanKind: item.SpanKind,
- References: ref,
- Events: item.Events,
- TagMap: item.Attributes_string,
- }
-
- jsonItem.TimeUnixNano = uint64(item.TimeUnixNano.UnixNano() / 1000000)
-
- searchSpanResponses = append(searchSpanResponses, jsonItem)
- if startTime == 0 || jsonItem.TimeUnixNano < startTime {
- startTime = jsonItem.TimeUnixNano
- }
- if endTime == 0 || jsonItem.TimeUnixNano > endTime {
- endTime = jsonItem.TimeUnixNano
- }
- if durationNano == 0 || uint64(jsonItem.DurationNano) > durationNano {
- durationNano = uint64(jsonItem.DurationNano)
- }
- }
- end = time.Now()
- zap.L().Debug("getTraceSQLQuery unmarshal took: ", zap.Duration("duration", end.Sub(start)))
-
- err = r.featureFlags.CheckFeature(model.SmartTraceDetail)
- smartAlgoEnabled := err == nil
- if len(searchScanResponses) > params.SpansRenderLimit && smartAlgoEnabled {
- start = time.Now()
- searchSpansResult, err = smartTraceAlgorithm(searchSpanResponses, params.SpanID, params.LevelUp, params.LevelDown, params.SpansRenderLimit)
- if err != nil {
- return nil, err
- }
- end = time.Now()
- zap.L().Debug("smartTraceAlgo took: ", zap.Duration("duration", end.Sub(start)))
- claims, ok := authtypes.ClaimsFromContext(ctx)
- if ok {
- data := map[string]interface{}{
- "traceSize": len(searchScanResponses),
- "spansRenderLimit": params.SpansRenderLimit,
- }
- telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_LARGE_TRACE_OPENED, data, claims.Email, true, false)
- }
- } else {
- for i, item := range searchSpanResponses {
- spanEvents := item.GetValues()
- searchSpansResult[0].Events[i] = spanEvents
- }
- }
-
- searchSpansResult[0].StartTimestampMillis = startTime - (durationNano / 1000000)
- searchSpansResult[0].EndTimestampMillis = endTime + (durationNano / 1000000)
-
- return &searchSpansResult, nil
-}
-
-func (r *ClickHouseReader) SearchTraces(ctx context.Context, params *model.SearchTracesParams,
- smartTraceAlgorithm func(payload []model.SearchSpanResponseItem, targetSpanId string,
- levelUp int, levelDown int, spanLimit int) ([]model.SearchSpansResult, error)) (*[]model.SearchSpansResult, error) {
-
- if r.useTraceNewSchema {
- return r.SearchTracesV2(ctx, params, smartTraceAlgorithm)
- }
-
- var countSpans uint64
- countQuery := fmt.Sprintf("SELECT count() as count from %s.%s WHERE traceID=$1", r.TraceDB, r.SpansTable)
- err := r.db.QueryRow(ctx, countQuery, params.TraceID).Scan(&countSpans)
- if err != nil {
- zap.L().Error("Error in processing sql query", zap.Error(err))
- return nil, fmt.Errorf("error in processing sql query")
- }
-
- if countSpans > uint64(params.MaxSpansInTrace) {
- zap.L().Error("Max spans allowed in a trace limit reached", zap.Int("MaxSpansInTrace", params.MaxSpansInTrace),
- zap.Uint64("Count", countSpans))
- claims, ok := authtypes.ClaimsFromContext(ctx)
- if ok {
- data := map[string]interface{}{
- "traceSize": countSpans,
- "maxSpansInTraceLimit": params.MaxSpansInTrace,
- }
- telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_MAX_SPANS_ALLOWED_LIMIT_REACHED, data, claims.Email, true, false)
- }
- return nil, fmt.Errorf("max spans allowed in trace limit reached, please contact support for more details")
- }
-
- claims, ok := authtypes.ClaimsFromContext(ctx)
- if ok {
- data := map[string]interface{}{
- "traceSize": countSpans,
- }
- telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_TRACE_DETAIL_API, data, claims.Email, true, false)
- }
-
- var startTime, endTime, durationNano uint64
- var searchScanResponses []model.SearchSpanDBResponseItem
-
- query := fmt.Sprintf("SELECT timestamp, traceID, model FROM %s.%s WHERE traceID=$1", r.TraceDB, r.SpansTable)
-
- start := time.Now()
-
- err = r.db.Select(ctx, &searchScanResponses, query, params.TraceID)
-
- zap.L().Info(query)
-
- if err != nil {
- zap.L().Error("Error in processing sql query", zap.Error(err))
- return nil, fmt.Errorf("error in processing sql query")
- }
- end := time.Now()
- zap.L().Debug("getTraceSQLQuery took: ", zap.Duration("duration", end.Sub(start)))
- searchSpansResult := []model.SearchSpansResult{{
- Columns: []string{"__time", "SpanId", "TraceId", "ServiceName", "Name", "Kind", "DurationNano", "TagsKeys", "TagsValues", "References", "Events", "HasError", "StatusMessage", "StatusCodeString", "SpanKind"},
- Events: make([][]interface{}, len(searchScanResponses)),
- IsSubTree: false,
- },
- }
-
- searchSpanResponses := []model.SearchSpanResponseItem{}
- start = time.Now()
- for _, item := range searchScanResponses {
- var jsonItem model.SearchSpanResponseItem
- easyjson.Unmarshal([]byte(item.Model), &jsonItem)
- jsonItem.TimeUnixNano = uint64(item.Timestamp.UnixNano() / 1000000)
- searchSpanResponses = append(searchSpanResponses, jsonItem)
- if startTime == 0 || jsonItem.TimeUnixNano < startTime {
- startTime = jsonItem.TimeUnixNano
- }
- if endTime == 0 || jsonItem.TimeUnixNano > endTime {
- endTime = jsonItem.TimeUnixNano
- }
- if durationNano == 0 || uint64(jsonItem.DurationNano) > durationNano {
- durationNano = uint64(jsonItem.DurationNano)
- }
- }
- end = time.Now()
- zap.L().Debug("getTraceSQLQuery unmarshal took: ", zap.Duration("duration", end.Sub(start)))
-
- err = r.featureFlags.CheckFeature(model.SmartTraceDetail)
- smartAlgoEnabled := err == nil
- if len(searchScanResponses) > params.SpansRenderLimit && smartAlgoEnabled {
- start = time.Now()
- searchSpansResult, err = smartTraceAlgorithm(searchSpanResponses, params.SpanID, params.LevelUp, params.LevelDown, params.SpansRenderLimit)
- if err != nil {
- return nil, err
- }
- end = time.Now()
- zap.L().Debug("smartTraceAlgo took: ", zap.Duration("duration", end.Sub(start)))
- claims, ok := authtypes.ClaimsFromContext(ctx)
- if ok {
- data := map[string]interface{}{
- "traceSize": len(searchScanResponses),
- "spansRenderLimit": params.SpansRenderLimit,
- }
- telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_LARGE_TRACE_OPENED, data, claims.Email, true, false)
- }
- } else {
- for i, item := range searchSpanResponses {
- spanEvents := item.GetValues()
- searchSpansResult[0].Events[i] = spanEvents
- }
- }
-
- searchSpansResult[0].StartTimestampMillis = startTime - (durationNano / 1000000)
- searchSpansResult[0].EndTimestampMillis = endTime + (durationNano / 1000000)
-
- return &searchSpansResult, nil
-}
-
func (r *ClickHouseReader) GetSpansForTrace(ctx context.Context, traceID string, traceDetailsQuery string) ([]model.SpanItemV2, *model.ApiError) {
var traceSummary model.TraceSummary
summaryQuery := fmt.Sprintf("SELECT * from %s.%s WHERE trace_id=$1", r.TraceDB, r.traceSummaryTable)
diff --git a/pkg/query-service/app/http_handler.go b/pkg/query-service/app/http_handler.go
index 255be26499..c11be21c77 100644
--- a/pkg/query-service/app/http_handler.go
+++ b/pkg/query-service/app/http_handler.go
@@ -551,7 +551,6 @@ func (aH *APIHandler) RegisterRoutes(router *mux.Router, am *AuthMiddleware) {
router.HandleFunc("/api/v1/services/list", am.ViewAccess(aH.getServicesList)).Methods(http.MethodGet)
router.HandleFunc("/api/v1/service/top_operations", am.ViewAccess(aH.getTopOperations)).Methods(http.MethodPost)
router.HandleFunc("/api/v1/service/top_level_operations", am.ViewAccess(aH.getServicesTopLevelOps)).Methods(http.MethodPost)
- router.HandleFunc("/api/v1/traces/{traceId}", am.ViewAccess(aH.SearchTraces)).Methods(http.MethodGet)
router.HandleFunc("/api/v1/usage", am.ViewAccess(aH.getUsage)).Methods(http.MethodGet)
router.HandleFunc("/api/v1/dependency_graph", am.ViewAccess(aH.dependencyGraph)).Methods(http.MethodPost)
router.HandleFunc("/api/v1/settings/ttl", am.AdminAccess(aH.setTTL)).Methods(http.MethodPost)
@@ -1727,23 +1726,6 @@ func (aH *APIHandler) getServicesList(w http.ResponseWriter, r *http.Request) {
}
-func (aH *APIHandler) SearchTraces(w http.ResponseWriter, r *http.Request) {
-
- params, err := ParseSearchTracesParams(r)
- if err != nil {
- RespondError(w, &model.ApiError{Typ: model.ErrorBadData, Err: err}, "Error reading params")
- return
- }
-
- result, err := aH.reader.SearchTraces(r.Context(), params, nil)
- if aH.HandleError(w, err, http.StatusBadRequest) {
- return
- }
-
- aH.WriteJSON(w, r, result)
-
-}
-
func (aH *APIHandler) GetWaterfallSpansForTraceWithMetadata(w http.ResponseWriter, r *http.Request) {
traceID := mux.Vars(r)["traceId"]
if traceID == "" {
diff --git a/pkg/query-service/app/querier/querier_test.go b/pkg/query-service/app/querier/querier_test.go
index a0e4fcc8f3..57f627837a 100644
--- a/pkg/query-service/app/querier/querier_test.go
+++ b/pkg/query-service/app/querier/querier_test.go
@@ -1370,7 +1370,6 @@ func Test_querier_runWindowBasedListQuery(t *testing.T) {
nil,
telemetryStore,
prometheustest.New(instrumentationtest.New().Logger(), prometheus.Config{}),
- featureManager.StartManager(),
"",
true,
true,
diff --git a/pkg/query-service/app/querier/v2/querier_test.go b/pkg/query-service/app/querier/v2/querier_test.go
index 7f7b858d5c..b5149cca36 100644
--- a/pkg/query-service/app/querier/v2/querier_test.go
+++ b/pkg/query-service/app/querier/v2/querier_test.go
@@ -1424,7 +1424,6 @@ func Test_querier_runWindowBasedListQuery(t *testing.T) {
nil,
telemetryStore,
prometheustest.New(instrumentationtest.New().Logger(), prometheus.Config{}),
- featureManager.StartManager(),
"",
true,
true,
diff --git a/pkg/query-service/app/server.go b/pkg/query-service/app/server.go
index ff7ec2eba6..37ebbc710d 100644
--- a/pkg/query-service/app/server.go
+++ b/pkg/query-service/app/server.go
@@ -120,7 +120,6 @@ func NewServer(serverOptions *ServerOptions) (*Server, error) {
serverOptions.SigNoz.SQLStore,
serverOptions.SigNoz.TelemetryStore,
serverOptions.SigNoz.Prometheus,
- fm,
serverOptions.Cluster,
serverOptions.UseLogsNewSchema,
serverOptions.UseTraceNewSchema,
diff --git a/pkg/query-service/interfaces/interface.go b/pkg/query-service/interfaces/interface.go
index 4b7b288b1b..4d0af440e1 100644
--- a/pkg/query-service/interfaces/interface.go
+++ b/pkg/query-service/interfaces/interface.go
@@ -39,7 +39,6 @@ type Reader interface {
GetNextPrevErrorIDs(ctx context.Context, params *model.GetErrorParams) (*model.NextPrevErrorIDs, *model.ApiError)
// Search Interfaces
- SearchTraces(ctx context.Context, params *model.SearchTracesParams, smartTraceAlgorithm func(payload []model.SearchSpanResponseItem, targetSpanId string, levelUp int, levelDown int, spanLimit int) ([]model.SearchSpansResult, error)) (*[]model.SearchSpansResult, error)
GetWaterfallSpansForTraceWithMetadata(ctx context.Context, traceID string, req *model.GetWaterfallSpansForTraceWithMetadataParams) (*model.GetWaterfallSpansForTraceWithMetadataResponse, *model.ApiError)
GetFlamegraphSpansForTrace(ctx context.Context, traceID string, req *model.GetFlamegraphSpansForTraceParams) (*model.GetFlamegraphSpansForTraceResponse, *model.ApiError)
diff --git a/pkg/query-service/model/featureSet.go b/pkg/query-service/model/featureSet.go
index 5187f84426..f2ced73f64 100644
--- a/pkg/query-service/model/featureSet.go
+++ b/pkg/query-service/model/featureSet.go
@@ -9,7 +9,6 @@ type Feature struct {
Route string `db:"route" json:"route"`
}
-const SmartTraceDetail = "SMART_TRACE_DETAIL"
const CustomMetricsFunction = "CUSTOM_METRICS_FUNCTION"
const DisableUpsell = "DISABLE_UPSELL"
const OSS = "OSS"
@@ -41,13 +40,6 @@ var BasicPlan = FeatureSet{
UsageLimit: -1,
Route: "",
},
- Feature{
- Name: SmartTraceDetail,
- Active: false,
- Usage: 0,
- UsageLimit: -1,
- Route: "",
- },
Feature{
Name: CustomMetricsFunction,
Active: false,
diff --git a/pkg/query-service/rules/threshold_rule_test.go b/pkg/query-service/rules/threshold_rule_test.go
index 095abf09d2..a46149607f 100644
--- a/pkg/query-service/rules/threshold_rule_test.go
+++ b/pkg/query-service/rules/threshold_rule_test.go
@@ -1251,7 +1251,7 @@ func TestThresholdRuleUnitCombinations(t *testing.T) {
options := clickhouseReader.NewOptions("", "", "archiveNamespace")
readerCache, err := memorycache.New(context.Background(), factorytest.NewSettings(), cache.Config{Provider: "memory", Memory: cache.Memory{TTL: DefaultFrequency}})
require.NoError(t, err)
- reader := clickhouseReader.NewReaderFromClickhouseConnection(options, nil, telemetryStore, prometheustest.New(instrumentationtest.New().Logger(), prometheus.Config{}), fm, "", true, true, time.Duration(time.Second), readerCache)
+ reader := clickhouseReader.NewReaderFromClickhouseConnection(options, nil, telemetryStore, prometheustest.New(instrumentationtest.New().Logger(), prometheus.Config{}), "", true, true, time.Duration(time.Second), readerCache)
rule, err := NewThresholdRule("69", &postableRule, fm, reader, true, true)
rule.TemporalityMap = map[string]map[v3.Temporality]bool{
"signoz_calls_total": {
@@ -1348,7 +1348,7 @@ func TestThresholdRuleNoData(t *testing.T) {
}
readerCache, err := memorycache.New(context.Background(), factorytest.NewSettings(), cache.Config{Provider: "memory", Memory: cache.Memory{TTL: DefaultFrequency}})
options := clickhouseReader.NewOptions("", "", "archiveNamespace")
- reader := clickhouseReader.NewReaderFromClickhouseConnection(options, nil, telemetryStore, prometheustest.New(instrumentationtest.New().Logger(), prometheus.Config{}), fm, "", true, true, time.Duration(time.Second), readerCache)
+ reader := clickhouseReader.NewReaderFromClickhouseConnection(options, nil, telemetryStore, prometheustest.New(instrumentationtest.New().Logger(), prometheus.Config{}), "", true, true, time.Duration(time.Second), readerCache)
rule, err := NewThresholdRule("69", &postableRule, fm, reader, true, true)
rule.TemporalityMap = map[string]map[v3.Temporality]bool{
@@ -1453,7 +1453,7 @@ func TestThresholdRuleTracesLink(t *testing.T) {
}
options := clickhouseReader.NewOptions("", "", "archiveNamespace")
- reader := clickhouseReader.NewReaderFromClickhouseConnection(options, nil, telemetryStore, prometheustest.New(instrumentationtest.New().Logger(), prometheus.Config{}), fm, "", true, true, time.Duration(time.Second), nil)
+ reader := clickhouseReader.NewReaderFromClickhouseConnection(options, nil, telemetryStore, prometheustest.New(instrumentationtest.New().Logger(), prometheus.Config{}), "", true, true, time.Duration(time.Second), nil)
rule, err := NewThresholdRule("69", &postableRule, fm, reader, true, true)
rule.TemporalityMap = map[string]map[v3.Temporality]bool{
@@ -1575,7 +1575,7 @@ func TestThresholdRuleLogsLink(t *testing.T) {
}
options := clickhouseReader.NewOptions("", "", "archiveNamespace")
- reader := clickhouseReader.NewReaderFromClickhouseConnection(options, nil, telemetryStore, prometheustest.New(instrumentationtest.New().Logger(), prometheus.Config{}), fm, "", true, true, time.Duration(time.Second), nil)
+ reader := clickhouseReader.NewReaderFromClickhouseConnection(options, nil, telemetryStore, prometheustest.New(instrumentationtest.New().Logger(), prometheus.Config{}), "", true, true, time.Duration(time.Second), nil)
rule, err := NewThresholdRule("69", &postableRule, fm, reader, true, true)
rule.TemporalityMap = map[string]map[v3.Temporality]bool{
diff --git a/pkg/query-service/tests/integration/filter_suggestions_test.go b/pkg/query-service/tests/integration/filter_suggestions_test.go
index 981a20a1f9..58532e892f 100644
--- a/pkg/query-service/tests/integration/filter_suggestions_test.go
+++ b/pkg/query-service/tests/integration/filter_suggestions_test.go
@@ -293,7 +293,7 @@ func NewFilterSuggestionsTestBed(t *testing.T) *FilterSuggestionsTestBed {
testDB := utils.NewQueryServiceDBForTests(t)
fm := featureManager.StartManager()
- reader, mockClickhouse := NewMockClickhouseReader(t, testDB, fm)
+ reader, mockClickhouse := NewMockClickhouseReader(t, testDB)
mockClickhouse.MatchExpectationsInOrder(false)
apiHandler, err := app.NewAPIHandler(app.APIHandlerOpts{
diff --git a/pkg/query-service/tests/integration/signoz_cloud_integrations_test.go b/pkg/query-service/tests/integration/signoz_cloud_integrations_test.go
index e7bf435293..b5932de8cd 100644
--- a/pkg/query-service/tests/integration/signoz_cloud_integrations_test.go
+++ b/pkg/query-service/tests/integration/signoz_cloud_integrations_test.go
@@ -355,7 +355,7 @@ func NewCloudIntegrationsTestBed(t *testing.T, testDB sqlstore.SQLStore) *CloudI
}
fm := featureManager.StartManager()
- reader, mockClickhouse := NewMockClickhouseReader(t, testDB, fm)
+ reader, mockClickhouse := NewMockClickhouseReader(t, testDB)
mockClickhouse.MatchExpectationsInOrder(false)
apiHandler, err := app.NewAPIHandler(app.APIHandlerOpts{
diff --git a/pkg/query-service/tests/integration/signoz_integrations_test.go b/pkg/query-service/tests/integration/signoz_integrations_test.go
index 1413f80147..df79f532f7 100644
--- a/pkg/query-service/tests/integration/signoz_integrations_test.go
+++ b/pkg/query-service/tests/integration/signoz_integrations_test.go
@@ -557,7 +557,7 @@ func NewIntegrationsTestBed(t *testing.T, testDB sqlstore.SQLStore) *Integration
}
fm := featureManager.StartManager()
- reader, mockClickhouse := NewMockClickhouseReader(t, testDB, fm)
+ reader, mockClickhouse := NewMockClickhouseReader(t, testDB)
mockClickhouse.MatchExpectationsInOrder(false)
cloudIntegrationsController, err := cloudintegrations.NewController(testDB)
diff --git a/pkg/query-service/tests/integration/test_utils.go b/pkg/query-service/tests/integration/test_utils.go
index b245e13d7d..61b549848c 100644
--- a/pkg/query-service/tests/integration/test_utils.go
+++ b/pkg/query-service/tests/integration/test_utils.go
@@ -21,7 +21,6 @@ import (
"github.com/SigNoz/signoz/pkg/query-service/auth"
"github.com/SigNoz/signoz/pkg/query-service/constants"
"github.com/SigNoz/signoz/pkg/query-service/dao"
- "github.com/SigNoz/signoz/pkg/query-service/interfaces"
"github.com/SigNoz/signoz/pkg/query-service/model"
"github.com/SigNoz/signoz/pkg/sqlstore"
"github.com/SigNoz/signoz/pkg/telemetrystore"
@@ -37,11 +36,7 @@ import (
var jwt = authtypes.NewJWT("secret", 1*time.Hour, 2*time.Hour)
-func NewMockClickhouseReader(
- t *testing.T, testDB sqlstore.SQLStore, featureFlags interfaces.FeatureLookup,
-) (
- *clickhouseReader.ClickHouseReader, mockhouse.ClickConnMockCommon,
-) {
+func NewMockClickhouseReader(t *testing.T, testDB sqlstore.SQLStore) (*clickhouseReader.ClickHouseReader, mockhouse.ClickConnMockCommon) {
require.NotNil(t, testDB)
telemetryStore := telemetrystoretest.New(telemetrystore.Config{Provider: "clickhouse"}, sqlmock.QueryMatcherRegexp)
@@ -50,7 +45,6 @@ func NewMockClickhouseReader(
testDB,
telemetryStore,
prometheustest.New(instrumentationtest.New().Logger(), prometheus.Config{}),
- featureFlags,
"",
true,
true,