mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 13:18:59 +08:00
chore: deprecate old columns in traces (#5016)
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
This commit is contained in:
parent
1d86e5eb50
commit
c1c5c4dfa8
@ -7,10 +7,8 @@ export const AllTraceFilterEnum: TraceFilterEnum[] = [
|
||||
'status',
|
||||
'serviceName',
|
||||
'operation',
|
||||
'component',
|
||||
'rpcMethod',
|
||||
'responseStatusCode',
|
||||
// 'httpCode',
|
||||
'httpHost',
|
||||
'httpMethod',
|
||||
'httpRoute',
|
||||
|
@ -63,10 +63,6 @@ export const groupBy: DefaultOptionType[] = [
|
||||
label: 'Messaging Operation',
|
||||
value: 'msgOperation',
|
||||
},
|
||||
{
|
||||
label: 'Component',
|
||||
value: 'component',
|
||||
},
|
||||
];
|
||||
|
||||
export const functions: Dropdown[] = [
|
||||
|
@ -57,9 +57,7 @@ const initialValue: TraceReducer = {
|
||||
payload: { items: {} },
|
||||
},
|
||||
filterDisplayValue: new Map<TraceFilterEnum, number>([
|
||||
['component', INITIAL_FILTER_VALUE],
|
||||
['duration', INITIAL_FILTER_VALUE],
|
||||
['httpCode', INITIAL_FILTER_VALUE],
|
||||
['httpHost', INITIAL_FILTER_VALUE],
|
||||
['httpMethod', INITIAL_FILTER_VALUE],
|
||||
['httpUrl', INITIAL_FILTER_VALUE],
|
||||
|
@ -72,9 +72,7 @@ export type OperatorValues =
|
||||
| 'NotStartsWith';
|
||||
|
||||
export type TraceFilterEnum =
|
||||
| 'component'
|
||||
| 'duration'
|
||||
| 'httpCode'
|
||||
| 'httpHost'
|
||||
| 'httpMethod'
|
||||
| 'httpRoute'
|
||||
@ -90,18 +88,10 @@ export const AllPanelHeading: {
|
||||
key: TraceFilterEnum;
|
||||
displayValue: string;
|
||||
}[] = [
|
||||
{
|
||||
displayValue: 'Component',
|
||||
key: 'component',
|
||||
},
|
||||
{
|
||||
key: 'duration',
|
||||
displayValue: 'Duration',
|
||||
},
|
||||
{
|
||||
displayValue: 'HTTP Code',
|
||||
key: 'httpCode',
|
||||
},
|
||||
{
|
||||
key: 'httpHost',
|
||||
displayValue: 'HTTP Host',
|
||||
|
@ -1075,9 +1075,6 @@ func (r *ClickHouseReader) GetSpanFilters(ctx context.Context, queryParams *mode
|
||||
if len(queryParams.HttpRoute) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpRoute, constants.HttpRoute, &query, args)
|
||||
}
|
||||
if len(queryParams.HttpCode) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpCode, constants.HttpCode, &query, args)
|
||||
}
|
||||
if len(queryParams.HttpHost) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpHost, constants.HttpHost, &query, args)
|
||||
}
|
||||
@ -1087,9 +1084,6 @@ func (r *ClickHouseReader) GetSpanFilters(ctx context.Context, queryParams *mode
|
||||
if len(queryParams.HttpUrl) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpUrl, constants.HttpUrl, &query, args)
|
||||
}
|
||||
if len(queryParams.Component) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.Component, constants.Component, &query, args)
|
||||
}
|
||||
if len(queryParams.Operation) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.Operation, constants.OperationDB, &query, args)
|
||||
}
|
||||
@ -1123,12 +1117,10 @@ func (r *ClickHouseReader) GetSpanFilters(ctx context.Context, queryParams *mode
|
||||
Operation: map[string]uint64{},
|
||||
ResponseStatusCode: map[string]uint64{},
|
||||
RPCMethod: map[string]uint64{},
|
||||
HttpCode: map[string]uint64{},
|
||||
HttpMethod: map[string]uint64{},
|
||||
HttpUrl: map[string]uint64{},
|
||||
HttpRoute: map[string]uint64{},
|
||||
HttpHost: map[string]uint64{},
|
||||
Component: map[string]uint64{},
|
||||
}
|
||||
|
||||
for _, e := range queryParams.GetFilters {
|
||||
@ -1152,23 +1144,6 @@ func (r *ClickHouseReader) GetSpanFilters(ctx context.Context, queryParams *mode
|
||||
traceFilterReponse.ServiceName[service.ServiceName] = service.Count
|
||||
}
|
||||
}
|
||||
case constants.HttpCode:
|
||||
finalQuery := fmt.Sprintf("SELECT httpCode, count() as count FROM %s.%s WHERE timestamp >= @timestampL AND timestamp <= @timestampU", r.TraceDB, r.indexTable)
|
||||
finalQuery += query
|
||||
finalQuery += " GROUP BY httpCode"
|
||||
var dBResponse []model.DBResponseHttpCode
|
||||
err := r.db.Select(ctx, &dBResponse, finalQuery, args...)
|
||||
zap.L().Info(finalQuery)
|
||||
|
||||
if err != nil {
|
||||
zap.L().Error("Error in processing sql query", zap.Error(err))
|
||||
return nil, &model.ApiError{Typ: model.ErrorExec, Err: fmt.Errorf("Error in processing sql query: %s", err)}
|
||||
}
|
||||
for _, service := range dBResponse {
|
||||
if service.HttpCode != "" {
|
||||
traceFilterReponse.HttpCode[service.HttpCode] = service.Count
|
||||
}
|
||||
}
|
||||
case constants.HttpRoute:
|
||||
finalQuery := fmt.Sprintf("SELECT httpRoute, count() as count FROM %s.%s WHERE timestamp >= @timestampL AND timestamp <= @timestampU", r.TraceDB, r.indexTable)
|
||||
finalQuery += query
|
||||
@ -1254,23 +1229,6 @@ func (r *ClickHouseReader) GetSpanFilters(ctx context.Context, queryParams *mode
|
||||
traceFilterReponse.Operation[service.Operation] = service.Count
|
||||
}
|
||||
}
|
||||
case constants.Component:
|
||||
finalQuery := fmt.Sprintf("SELECT component, count() as count FROM %s.%s WHERE timestamp >= @timestampL AND timestamp <= @timestampU", r.TraceDB, r.indexTable)
|
||||
finalQuery += query
|
||||
finalQuery += " GROUP BY component"
|
||||
var dBResponse []model.DBResponseComponent
|
||||
err := r.db.Select(ctx, &dBResponse, finalQuery, args...)
|
||||
zap.L().Info(finalQuery)
|
||||
|
||||
if err != nil {
|
||||
zap.L().Error("Error in processing sql query", zap.Error(err))
|
||||
return nil, &model.ApiError{Typ: model.ErrorExec, Err: fmt.Errorf("Error in processing sql query: %s", err)}
|
||||
}
|
||||
for _, service := range dBResponse {
|
||||
if service.Component != "" {
|
||||
traceFilterReponse.Component[service.Component] = service.Count
|
||||
}
|
||||
}
|
||||
case constants.Status:
|
||||
finalQuery := fmt.Sprintf("SELECT COUNT(*) as numTotal FROM %s.%s WHERE timestamp >= @timestampL AND timestamp <= @timestampU AND hasError = true", r.TraceDB, r.indexTable)
|
||||
finalQuery += query
|
||||
@ -1441,9 +1399,6 @@ func (r *ClickHouseReader) GetFilteredSpans(ctx context.Context, queryParams *mo
|
||||
if len(queryParams.HttpRoute) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpRoute, constants.HttpRoute, &query, args)
|
||||
}
|
||||
if len(queryParams.HttpCode) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpCode, constants.HttpCode, &query, args)
|
||||
}
|
||||
if len(queryParams.HttpHost) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpHost, constants.HttpHost, &query, args)
|
||||
}
|
||||
@ -1453,9 +1408,6 @@ func (r *ClickHouseReader) GetFilteredSpans(ctx context.Context, queryParams *mo
|
||||
if len(queryParams.HttpUrl) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpUrl, constants.HttpUrl, &query, args)
|
||||
}
|
||||
if len(queryParams.Component) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.Component, constants.Component, &query, args)
|
||||
}
|
||||
if len(queryParams.Operation) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.Operation, constants.OperationDB, &query, args)
|
||||
}
|
||||
@ -1736,9 +1688,6 @@ func (r *ClickHouseReader) GetTagFilters(ctx context.Context, queryParams *model
|
||||
if len(queryParams.HttpRoute) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpRoute, constants.HttpRoute, &query, args)
|
||||
}
|
||||
if len(queryParams.HttpCode) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpCode, constants.HttpCode, &query, args)
|
||||
}
|
||||
if len(queryParams.HttpHost) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpHost, constants.HttpHost, &query, args)
|
||||
}
|
||||
@ -1748,9 +1697,6 @@ func (r *ClickHouseReader) GetTagFilters(ctx context.Context, queryParams *model
|
||||
if len(queryParams.HttpUrl) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpUrl, constants.HttpUrl, &query, args)
|
||||
}
|
||||
if len(queryParams.Component) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.Component, constants.Component, &query, args)
|
||||
}
|
||||
if len(queryParams.Operation) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.Operation, constants.OperationDB, &query, args)
|
||||
}
|
||||
@ -1811,7 +1757,6 @@ func excludeTags(ctx context.Context, tags []string) []string {
|
||||
"http.host": true,
|
||||
"messaging.system": true,
|
||||
"messaging.operation": true,
|
||||
"component": true,
|
||||
"error": true,
|
||||
"service.name": true,
|
||||
}
|
||||
@ -1861,9 +1806,6 @@ func (r *ClickHouseReader) GetTagValues(ctx context.Context, queryParams *model.
|
||||
if len(queryParams.HttpRoute) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpRoute, constants.HttpRoute, &query, args)
|
||||
}
|
||||
if len(queryParams.HttpCode) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpCode, constants.HttpCode, &query, args)
|
||||
}
|
||||
if len(queryParams.HttpHost) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpHost, constants.HttpHost, &query, args)
|
||||
}
|
||||
@ -1873,9 +1815,6 @@ func (r *ClickHouseReader) GetTagValues(ctx context.Context, queryParams *model.
|
||||
if len(queryParams.HttpUrl) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpUrl, constants.HttpUrl, &query, args)
|
||||
}
|
||||
if len(queryParams.Component) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.Component, constants.Component, &query, args)
|
||||
}
|
||||
if len(queryParams.Operation) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.Operation, constants.OperationDB, &query, args)
|
||||
}
|
||||
@ -2194,9 +2133,6 @@ func (r *ClickHouseReader) GetFilteredSpansAggregates(ctx context.Context, query
|
||||
if len(queryParams.HttpRoute) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpRoute, constants.HttpRoute, &query, args)
|
||||
}
|
||||
if len(queryParams.HttpCode) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpCode, constants.HttpCode, &query, args)
|
||||
}
|
||||
if len(queryParams.HttpHost) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpHost, constants.HttpHost, &query, args)
|
||||
}
|
||||
@ -2206,9 +2142,6 @@ func (r *ClickHouseReader) GetFilteredSpansAggregates(ctx context.Context, query
|
||||
if len(queryParams.HttpUrl) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.HttpUrl, constants.HttpUrl, &query, args)
|
||||
}
|
||||
if len(queryParams.Component) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.Component, constants.Component, &query, args)
|
||||
}
|
||||
if len(queryParams.Operation) > 0 {
|
||||
args = buildFilterArrayQuery(ctx, excludeMap, queryParams.Operation, constants.OperationDB, &query, args)
|
||||
}
|
||||
|
@ -154,11 +154,9 @@ const (
|
||||
TraceID = "traceID"
|
||||
ServiceName = "serviceName"
|
||||
HttpRoute = "httpRoute"
|
||||
HttpCode = "httpCode"
|
||||
HttpHost = "httpHost"
|
||||
HttpUrl = "httpUrl"
|
||||
HttpMethod = "httpMethod"
|
||||
Component = "component"
|
||||
OperationDB = "name"
|
||||
OperationRequest = "operation"
|
||||
Status = "status"
|
||||
@ -193,7 +191,6 @@ var GroupByColMap = map[string]struct{}{
|
||||
HttpRoute: {},
|
||||
HttpUrl: {},
|
||||
HttpMethod: {},
|
||||
Component: {},
|
||||
OperationDB: {},
|
||||
DBName: {},
|
||||
DBOperation: {},
|
||||
|
@ -374,11 +374,9 @@ type GetFilteredSpansParams struct {
|
||||
SpanKind string `json:"spanKind"`
|
||||
Status []string `json:"status"`
|
||||
HttpRoute []string `json:"httpRoute"`
|
||||
HttpCode []string `json:"httpCode"`
|
||||
HttpUrl []string `json:"httpUrl"`
|
||||
HttpHost []string `json:"httpHost"`
|
||||
HttpMethod []string `json:"httpMethod"`
|
||||
Component []string `json:"component"`
|
||||
RPCMethod []string `json:"rpcMethod"`
|
||||
ResponseStatusCode []string `json:"responseStatusCode"`
|
||||
StartStr string `json:"start"`
|
||||
@ -402,11 +400,9 @@ type GetFilteredSpanAggregatesParams struct {
|
||||
SpanKind string `json:"spanKind"`
|
||||
Status []string `json:"status"`
|
||||
HttpRoute []string `json:"httpRoute"`
|
||||
HttpCode []string `json:"httpCode"`
|
||||
HttpUrl []string `json:"httpUrl"`
|
||||
HttpHost []string `json:"httpHost"`
|
||||
HttpMethod []string `json:"httpMethod"`
|
||||
Component []string `json:"component"`
|
||||
RPCMethod []string `json:"rpcMethod"`
|
||||
ResponseStatusCode []string `json:"responseStatusCode"`
|
||||
MinDuration string `json:"minDuration"`
|
||||
@ -430,11 +426,9 @@ type SpanFilterParams struct {
|
||||
ServiceName []string `json:"serviceName"`
|
||||
SpanKind string `json:"spanKind"`
|
||||
HttpRoute []string `json:"httpRoute"`
|
||||
HttpCode []string `json:"httpCode"`
|
||||
HttpUrl []string `json:"httpUrl"`
|
||||
HttpHost []string `json:"httpHost"`
|
||||
HttpMethod []string `json:"httpMethod"`
|
||||
Component []string `json:"component"`
|
||||
Operation []string `json:"operation"`
|
||||
RPCMethod []string `json:"rpcMethod"`
|
||||
ResponseStatusCode []string `json:"responseStatusCode"`
|
||||
@ -453,12 +447,10 @@ type TagFilterParams struct {
|
||||
Status []string `json:"status"`
|
||||
ServiceName []string `json:"serviceName"`
|
||||
HttpRoute []string `json:"httpRoute"`
|
||||
HttpCode []string `json:"httpCode"`
|
||||
SpanKind string `json:"spanKind"`
|
||||
HttpUrl []string `json:"httpUrl"`
|
||||
HttpHost []string `json:"httpHost"`
|
||||
HttpMethod []string `json:"httpMethod"`
|
||||
Component []string `json:"component"`
|
||||
Operation []string `json:"operation"`
|
||||
RPCMethod []string `json:"rpcMethod"`
|
||||
ResponseStatusCode []string `json:"responseStatusCode"`
|
||||
|
@ -394,11 +394,6 @@ type DBResponseServiceName struct {
|
||||
Count uint64 `ch:"count"`
|
||||
}
|
||||
|
||||
type DBResponseHttpCode struct {
|
||||
HttpCode string `ch:"httpCode"`
|
||||
Count uint64 `ch:"count"`
|
||||
}
|
||||
|
||||
type DBResponseHttpRoute struct {
|
||||
HttpRoute string `ch:"httpRoute"`
|
||||
Count uint64 `ch:"count"`
|
||||
@ -453,14 +448,12 @@ type SpanFiltersResponse struct {
|
||||
Status map[string]uint64 `json:"status"`
|
||||
Duration map[string]uint64 `json:"duration"`
|
||||
Operation map[string]uint64 `json:"operation"`
|
||||
HttpCode map[string]uint64 `json:"httpCode"`
|
||||
ResponseStatusCode map[string]uint64 `json:"responseStatusCode"`
|
||||
RPCMethod map[string]uint64 `json:"rpcMethod"`
|
||||
HttpUrl map[string]uint64 `json:"httpUrl"`
|
||||
HttpMethod map[string]uint64 `json:"httpMethod"`
|
||||
HttpRoute map[string]uint64 `json:"httpRoute"`
|
||||
HttpHost map[string]uint64 `json:"httpHost"`
|
||||
Component map[string]uint64 `json:"component"`
|
||||
}
|
||||
type Error struct {
|
||||
ExceptionType string `json:"exceptionType" ch:"exceptionType"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user