mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-03 11:20:39 +08:00
returning spans which are atleast 30s stale
This commit is contained in:
parent
ea93b65ab7
commit
3b3ca64296
@ -267,7 +267,7 @@ func parseSpanSearchRequest(r *http.Request) (*model.SpanSearchParams, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
endTime, err := parseTime("end", r)
|
endTime, err := parseTimeMinusBuffer("end", r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -409,6 +409,26 @@ func parseTime(param string, r *http.Request) (*time.Time, error) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func parseTimeMinusBuffer(param string, r *http.Request) (*time.Time, error) {
|
||||||
|
|
||||||
|
timeStr := r.URL.Query().Get(param)
|
||||||
|
if len(timeStr) == 0 {
|
||||||
|
return nil, fmt.Errorf("%s param missing in query", param)
|
||||||
|
}
|
||||||
|
|
||||||
|
timeUnix, err := strconv.ParseInt(timeStr, 10, 64)
|
||||||
|
if err != nil || len(timeStr) == 0 {
|
||||||
|
return nil, fmt.Errorf("%s param is not in correct timestamp format", param)
|
||||||
|
}
|
||||||
|
|
||||||
|
timeUnix = timeUnix - 30000000000
|
||||||
|
|
||||||
|
timeFmt := time.Unix(0, timeUnix)
|
||||||
|
|
||||||
|
return &timeFmt, nil
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func parseTimestamp(param string, r *http.Request) (*string, error) {
|
func parseTimestamp(param string, r *http.Request) (*string, error) {
|
||||||
timeStr := r.URL.Query().Get(param)
|
timeStr := r.URL.Query().Get(param)
|
||||||
if len(timeStr) == 0 {
|
if len(timeStr) == 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user