mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 00:25:53 +08:00
added statusCode filtering with error:true tag in searchSpans API
This commit is contained in:
commit
eb39850f63
@ -79,6 +79,13 @@ func buildFilters(queryParams *model.SpanSearchParams) (*godruid.Filter, error)
|
|||||||
return nil, fmt.Errorf("Tag Operator %s not supported", item.Operator)
|
return nil, fmt.Errorf("Tag Operator %s not supported", item.Operator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if item.Key == "error" && item.Value == "true" {
|
||||||
|
statusCodeFilter := godruid.FilterBound("StatusCode", "500", "600", false, true, "numeric")
|
||||||
|
filterError := godruid.FilterOr(statusCodeFilter, newFilter)
|
||||||
|
filter = godruid.FilterAnd(filter, filterError)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
filter = godruid.FilterAnd(filter, newFilter)
|
filter = godruid.FilterAnd(filter, newFilter)
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -137,6 +144,13 @@ func buildFiltersForSpansAggregates(queryParams *model.SpanSearchAggregatesParam
|
|||||||
return nil, fmt.Errorf("Tag Operator %s not supported", item.Operator)
|
return nil, fmt.Errorf("Tag Operator %s not supported", item.Operator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if item.Key == "error" && item.Value == "true" {
|
||||||
|
statusCodeFilter := godruid.FilterBound("StatusCode", "500", "600", false, true, "numeric")
|
||||||
|
filterError := godruid.FilterOr(statusCodeFilter, newFilter)
|
||||||
|
filter = godruid.FilterAnd(filter, filterError)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
filter = godruid.FilterAnd(filter, newFilter)
|
filter = godruid.FilterAnd(filter, newFilter)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user