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.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
fix: disable removing a selected field (#5457)
Nityananda Gohain83455e614e15
diff --git a/pkg/query-service/app/clickhouseReader/reader.go b/pkg/query-service/app/clickhouseReader/reader.goindex ae8fb64c94..ccdffd88bd 100644--- a/pkg/query-service/app/clickhouseReader/reader.go+++ b/pkg/query-service/app/clickhouseReader/reader.go@@ -3575,38 +3575,42 @@ func (r *ClickHouseReader) UpdateLogField(ctx context.Context, field *model.Upda}} else {- // Delete the index first- query := fmt.Sprintf("ALTER TABLE %s.%s ON CLUSTER %s DROP INDEX IF EXISTS %s_idx`", r.logsDB, r.logsLocalTable, r.cluster, strings.TrimSuffix(colname, "`"))- err := r.db.Exec(ctx, query)- if err != nil {- return &model.ApiError{Err: err, Typ: model.ErrorInternal}- }+ // We are not allowing to delete a materialized column+ // For more details please check https://github.com/SigNoz/signoz/issues/4566+ return model.ForbiddenError(errors.New("Removing a selected field is not allowed, please reach out to support."))- for _, table := range []string{r.logsTable, r.logsLocalTable} {- // drop materialized column from logs table- query := "ALTER TABLE %s.%s ON CLUSTER %s DROP COLUMN IF EXISTS %s "- err := r.db.Exec(ctx, fmt.Sprintf(query,- r.logsDB, table,- r.cluster,- colname,- ),- )- if err != nil {- return &model.ApiError{Err: err, Typ: model.ErrorInternal}- }-- // drop exists column on logs table- query = "ALTER TABLE %s.%s ON CLUSTER %s DROP COLUMN IF EXISTS %s_exists` "- err = r.db.Exec(ctx, fmt.Sprintf(query,- r.logsDB, table,- r.cluster,- strings.TrimSuffix(colname, "`"),- ),- )- if err != nil {- return &model.ApiError{Err: err, Typ: model.ErrorInternal}- }- }+ // Delete the index first+ // query := fmt.Sprintf("ALTER TABLE %s.%s ON CLUSTER %s DROP INDEX IF EXISTS %s_idx`", r.logsDB, r.logsLocalTable, r.cluster, strings.TrimSuffix(colname, "`"))+ // err := r.db.Exec(ctx, query)+ // if err != nil {+ // return &model.ApiError{Err: err, Typ: model.ErrorInternal}+ // }++ // for _, table := range []string{r.logsTable, r.logsLocalTable} {+ // // drop materialized column from logs table+ // query := "ALTER TABLE %s.%s ON CLUSTER %s DROP COLUMN IF EXISTS %s "+ // err := r.db.Exec(ctx, fmt.Sprintf(query,+ // r.logsDB, table,+ // r.cluster,+ // colname,+ // ),+ // )+ // if err != nil {+ // return &model.ApiError{Err: err, Typ: model.ErrorInternal}+ // }++ // // drop exists column on logs table+ // query = "ALTER TABLE %s.%s ON CLUSTER %s DROP COLUMN IF EXISTS %s_exists` "+ // err = r.db.Exec(ctx, fmt.Sprintf(query,+ // r.logsDB, table,+ // r.cluster,+ // strings.TrimSuffix(colname, "`"),+ // ),+ // )+ // if err != nil {+ // return &model.ApiError{Err: err, Typ: model.ErrorInternal}+ // }+ // }}return nil}