Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
* [BUGFIX] Fix panic when trying to compact block with unsupported encodings such as vParquet previews. [#6209
](https://github.com/grafana/tempo/pull/6209
) (@carles-grafana)
* [BUGFIX] querier: allow external trace by id queries in validation [#6217](https://github.com/grafana/tempo/pull/6217) (@Logiraptor)


### vParquet5
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const (
QueryModeKey = "mode"
QueryModeIngesters = "ingesters"
QueryModeBlocks = "blocks"
QueryModeExternal = "external"
QueryModeAll = "all"
BlockStartKey = "blockStart"
BlockEndKey = "blockEnd"
Expand Down Expand Up @@ -860,6 +861,8 @@ func ValidateAndSanitizeRequest(r *http.Request) (string, string, string, int64,
queryMode = QueryModeIngesters
case q == QueryModeBlocks:
queryMode = QueryModeBlocks
case q == QueryModeExternal:
queryMode = QueryModeExternal
default:
return "", "", "", 0, 0, time.Time{}, fmt.Errorf("invalid value for mode %s", q)
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/api/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,14 @@ func TestValidateAndSanitizeRequest(t *testing.T) {
blockEnd: "ffffffffffffffffffffffffffffffff",
expectedError: "http parameter start must be before end. received start=1 end=1",
},
{
httpReq: httptest.NewRequest("GET", "/api/traces/1234?mode=external&start=1&end=2", nil),
queryMode: "external",
startTime: 1,
endTime: 2,
blockStart: "00000000-0000-0000-0000-000000000000",
blockEnd: "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF",
},
}

for _, tc := range tests {
Expand Down