mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 00:05:53 +08:00
chore: fix error rate (#7701)
Signed-off-by: Shivanshu Raj Shrivastava <shivanshu1333@gmail.com>
This commit is contained in:
parent
f3a1f3cc20
commit
365a3e250f
@ -5600,7 +5600,12 @@ func (aH *APIHandler) getDomainList(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
result = postprocess.TransformToTableForBuilderQueries(result, queryRangeParams)
|
result, err = postprocess.PostProcessResult(result, queryRangeParams)
|
||||||
|
if err != nil {
|
||||||
|
apiErrObj := &model.ApiError{Typ: model.ErrorBadData, Err: err}
|
||||||
|
RespondError(w, apiErrObj, errQuriesByName)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if !thirdPartyQueryRequest.ShowIp {
|
if !thirdPartyQueryRequest.ShowIp {
|
||||||
result = thirdPartyApi.FilterResponse(result)
|
result = thirdPartyApi.FilterResponse(result)
|
||||||
|
@ -58,6 +58,7 @@ func BuildDomainList(thirdPartyApis *ThirdPartyApis) (*v3.QueryRangeParamsV3, er
|
|||||||
|
|
||||||
builderQueries["endpoints"] = &v3.BuilderQuery{
|
builderQueries["endpoints"] = &v3.BuilderQuery{
|
||||||
QueryName: "endpoints",
|
QueryName: "endpoints",
|
||||||
|
Legend: "endpoints",
|
||||||
DataSource: v3.DataSourceTraces,
|
DataSource: v3.DataSourceTraces,
|
||||||
StepInterval: defaultStepInterval,
|
StepInterval: defaultStepInterval,
|
||||||
AggregateOperator: v3.AggregateOperatorCountDistinct,
|
AggregateOperator: v3.AggregateOperatorCountDistinct,
|
||||||
@ -91,11 +92,14 @@ func BuildDomainList(thirdPartyApis *ThirdPartyApis) (*v3.QueryRangeParamsV3, er
|
|||||||
Type: v3.AttributeKeyTypeTag,
|
Type: v3.AttributeKeyTypeTag,
|
||||||
},
|
},
|
||||||
}, thirdPartyApis.GroupBy),
|
}, thirdPartyApis.GroupBy),
|
||||||
ReduceTo: v3.ReduceToOperatorAvg,
|
ReduceTo: v3.ReduceToOperatorAvg,
|
||||||
|
ShiftBy: 0,
|
||||||
|
IsAnomaly: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
builderQueries["lastseen"] = &v3.BuilderQuery{
|
builderQueries["lastseen"] = &v3.BuilderQuery{
|
||||||
QueryName: "lastseen",
|
QueryName: "lastseen",
|
||||||
|
Legend: "lastseen",
|
||||||
DataSource: v3.DataSourceTraces,
|
DataSource: v3.DataSourceTraces,
|
||||||
StepInterval: defaultStepInterval,
|
StepInterval: defaultStepInterval,
|
||||||
AggregateOperator: v3.AggregateOperatorMax,
|
AggregateOperator: v3.AggregateOperatorMax,
|
||||||
@ -127,11 +131,14 @@ func BuildDomainList(thirdPartyApis *ThirdPartyApis) (*v3.QueryRangeParamsV3, er
|
|||||||
Type: v3.AttributeKeyTypeTag,
|
Type: v3.AttributeKeyTypeTag,
|
||||||
},
|
},
|
||||||
}, thirdPartyApis.GroupBy),
|
}, thirdPartyApis.GroupBy),
|
||||||
ReduceTo: v3.ReduceToOperatorAvg,
|
ReduceTo: v3.ReduceToOperatorAvg,
|
||||||
|
ShiftBy: 0,
|
||||||
|
IsAnomaly: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
builderQueries["rps"] = &v3.BuilderQuery{
|
builderQueries["rps"] = &v3.BuilderQuery{
|
||||||
QueryName: "rps",
|
QueryName: "rps",
|
||||||
|
Legend: "rps",
|
||||||
DataSource: v3.DataSourceTraces,
|
DataSource: v3.DataSourceTraces,
|
||||||
StepInterval: defaultStepInterval,
|
StepInterval: defaultStepInterval,
|
||||||
AggregateOperator: v3.AggregateOperatorRate,
|
AggregateOperator: v3.AggregateOperatorRate,
|
||||||
@ -163,18 +170,22 @@ func BuildDomainList(thirdPartyApis *ThirdPartyApis) (*v3.QueryRangeParamsV3, er
|
|||||||
Type: v3.AttributeKeyTypeTag,
|
Type: v3.AttributeKeyTypeTag,
|
||||||
},
|
},
|
||||||
}, thirdPartyApis.GroupBy),
|
}, thirdPartyApis.GroupBy),
|
||||||
ReduceTo: v3.ReduceToOperatorAvg,
|
ReduceTo: v3.ReduceToOperatorAvg,
|
||||||
|
ShiftBy: 0,
|
||||||
|
IsAnomaly: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
builderQueries["error_rate"] = &v3.BuilderQuery{
|
builderQueries["error"] = &v3.BuilderQuery{
|
||||||
QueryName: "error_rate",
|
QueryName: "error",
|
||||||
DataSource: v3.DataSourceTraces,
|
DataSource: v3.DataSourceTraces,
|
||||||
StepInterval: defaultStepInterval,
|
StepInterval: defaultStepInterval,
|
||||||
AggregateOperator: v3.AggregateOperatorRate,
|
AggregateOperator: v3.AggregateOperatorCountDistinct,
|
||||||
AggregateAttribute: v3.AttributeKey{
|
AggregateAttribute: v3.AttributeKey{
|
||||||
Key: "",
|
Key: "span_id",
|
||||||
|
DataType: v3.AttributeKeyDataTypeString,
|
||||||
|
IsColumn: true,
|
||||||
},
|
},
|
||||||
TimeAggregation: v3.TimeAggregationRate,
|
TimeAggregation: v3.TimeAggregationCountDistinct,
|
||||||
SpaceAggregation: v3.SpaceAggregationSum,
|
SpaceAggregation: v3.SpaceAggregationSum,
|
||||||
Filters: &v3.FilterSet{
|
Filters: &v3.FilterSet{
|
||||||
Operator: "AND",
|
Operator: "AND",
|
||||||
@ -200,7 +211,7 @@ func BuildDomainList(thirdPartyApis *ThirdPartyApis) (*v3.QueryRangeParamsV3, er
|
|||||||
},
|
},
|
||||||
}, thirdPartyApis.Filters),
|
}, thirdPartyApis.Filters),
|
||||||
},
|
},
|
||||||
Expression: "error_rate",
|
Expression: "error",
|
||||||
GroupBy: getGroupBy([]v3.AttributeKey{
|
GroupBy: getGroupBy([]v3.AttributeKey{
|
||||||
{
|
{
|
||||||
Key: "net.peer.name",
|
Key: "net.peer.name",
|
||||||
@ -208,11 +219,56 @@ func BuildDomainList(thirdPartyApis *ThirdPartyApis) (*v3.QueryRangeParamsV3, er
|
|||||||
Type: v3.AttributeKeyTypeTag,
|
Type: v3.AttributeKeyTypeTag,
|
||||||
},
|
},
|
||||||
}, thirdPartyApis.GroupBy),
|
}, thirdPartyApis.GroupBy),
|
||||||
ReduceTo: v3.ReduceToOperatorAvg,
|
ReduceTo: v3.ReduceToOperatorAvg,
|
||||||
|
Disabled: true,
|
||||||
|
ShiftBy: 0,
|
||||||
|
IsAnomaly: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
builderQueries["total_span"] = &v3.BuilderQuery{
|
||||||
|
QueryName: "total_span",
|
||||||
|
DataSource: v3.DataSourceTraces,
|
||||||
|
StepInterval: defaultStepInterval,
|
||||||
|
AggregateOperator: v3.AggregateOperatorCountDistinct,
|
||||||
|
AggregateAttribute: v3.AttributeKey{
|
||||||
|
Key: "span_id",
|
||||||
|
DataType: v3.AttributeKeyDataTypeString,
|
||||||
|
IsColumn: true,
|
||||||
|
},
|
||||||
|
TimeAggregation: v3.TimeAggregationCountDistinct,
|
||||||
|
SpaceAggregation: v3.SpaceAggregationSum,
|
||||||
|
Filters: &v3.FilterSet{
|
||||||
|
Operator: "AND",
|
||||||
|
Items: getFilterSet([]v3.FilterItem{
|
||||||
|
{
|
||||||
|
Key: v3.AttributeKey{
|
||||||
|
Key: "http.url",
|
||||||
|
DataType: v3.AttributeKeyDataTypeString,
|
||||||
|
IsColumn: false,
|
||||||
|
Type: v3.AttributeKeyTypeTag,
|
||||||
|
},
|
||||||
|
Operator: v3.FilterOperatorExists,
|
||||||
|
Value: "",
|
||||||
|
},
|
||||||
|
}, thirdPartyApis.Filters),
|
||||||
|
},
|
||||||
|
Expression: "total_span",
|
||||||
|
GroupBy: getGroupBy([]v3.AttributeKey{
|
||||||
|
{
|
||||||
|
Key: "net.peer.name",
|
||||||
|
DataType: v3.AttributeKeyDataTypeString,
|
||||||
|
Type: v3.AttributeKeyTypeTag,
|
||||||
|
},
|
||||||
|
}, thirdPartyApis.GroupBy),
|
||||||
|
ReduceTo: v3.ReduceToOperatorAvg,
|
||||||
|
Disabled: true,
|
||||||
|
ShiftBy: 0,
|
||||||
|
IsAnomaly: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
builderQueries["p99"] = &v3.BuilderQuery{
|
builderQueries["p99"] = &v3.BuilderQuery{
|
||||||
QueryName: "p99",
|
QueryName: "p99",
|
||||||
|
Legend: "p99",
|
||||||
DataSource: v3.DataSourceTraces,
|
DataSource: v3.DataSourceTraces,
|
||||||
StepInterval: defaultStepInterval,
|
StepInterval: defaultStepInterval,
|
||||||
AggregateOperator: v3.AggregateOperatorP99,
|
AggregateOperator: v3.AggregateOperatorP99,
|
||||||
@ -246,7 +302,18 @@ func BuildDomainList(thirdPartyApis *ThirdPartyApis) (*v3.QueryRangeParamsV3, er
|
|||||||
Type: v3.AttributeKeyTypeTag,
|
Type: v3.AttributeKeyTypeTag,
|
||||||
},
|
},
|
||||||
}, thirdPartyApis.GroupBy),
|
}, thirdPartyApis.GroupBy),
|
||||||
ReduceTo: v3.ReduceToOperatorAvg,
|
ReduceTo: v3.ReduceToOperatorAvg,
|
||||||
|
ShiftBy: 0,
|
||||||
|
IsAnomaly: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
builderQueries["error_rate"] = &v3.BuilderQuery{
|
||||||
|
QueryName: "error_rate",
|
||||||
|
Expression: "(error/total_span)*100",
|
||||||
|
Legend: "error_rate",
|
||||||
|
Disabled: false,
|
||||||
|
ShiftBy: 0,
|
||||||
|
IsAnomaly: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
compositeQuery := &v3.CompositeQuery{
|
compositeQuery := &v3.CompositeQuery{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user