Skip to content
Open
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
3 changes: 3 additions & 0 deletions app/vtselect/traces/tempo/tempo.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ func RequestHandler(ctx context.Context, w http.ResponseWriter, r *http.Request)
processQueryRequest(ctx, w, r)
tempoQueryDuration.UpdateDuration(startTime)
return true
} else if path == "/select/tempo/api/v2/traces/diff" {
http.Error(w, "trace diff support is unavailable as this feature is experimental", http.StatusNotFound)
return true
} else if strings.HasPrefix(path, "/select/tempo/api/v2/traces/") && len(path) > len("/select/tempo/api/v2/traces/") {
tempoQueryV2Requests.Inc()
processQueryV2Request(ctx, w, r)
Expand Down
21 changes: 21 additions & 0 deletions app/vtselect/traces/tempo/tempo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,33 @@ import (
"bytes"
"context"
"encoding/json"
"net/http"
"net/http/httptest"
"slices"
"testing"

otelpb "github.com/VictoriaMetrics/VictoriaTraces/lib/protoparser/opentelemetry/pb"
)

func TestRequestHandlerTraceDiffNotSupported(t *testing.T) {
f := func(method, rawURL string) {
t.Helper()
r := httptest.NewRequest(method, rawURL, nil)
w := httptest.NewRecorder()
if !RequestHandler(context.Background(), w, r) {
t.Fatalf("%s %s must be handled", method, rawURL)
}
if w.Code != http.StatusNotFound {
t.Fatalf("unexpected status code for %s %s; got %d; want %d",
method, rawURL, w.Code, http.StatusNotFound)
}
}

f(http.MethodGet, "/select/tempo/api/v2/traces/diff")
f(http.MethodPost, "/select/tempo/api/v2/traces/diff")
f(http.MethodPost, "/select/tempo/api/v2/traces/diff?start=1&end=2")
}

// Intrinsic span fields have no attribute prefix, so they are not discovered by
// the field_names scan. They must be advertised explicitly under the "intrinsic"
// scope of /api/v2/search/tags, otherwise they never appear in the Grafana
Expand Down
1 change: 1 addition & 0 deletions docs/victoriatraces/changelog/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The following `tip` changes can be tested by building VictoriaTraces components

* BUGFIX: [Single-node VictoriaTraces](https://docs.victoriametrics.com/victoriatraces/) and vtselect in [VictoriaTraces cluster](https://docs.victoriametrics.com/victoriatraces/cluster/): return correct results for TraceQL filters with `||` in the Tempo API, such as `{ status = error || duration > 5s }`. Previously, such a filter could count extra spans, or the search failed with `cannot parse in()`, depending on the order of the conditions. Thank @ZeXi0308 for [the issue #319](https://github.com/VictoriaMetrics/VictoriaTraces/issues/319) and [the pull request #320](https://github.com/VictoriaMetrics/VictoriaTraces/pull/320).
* BUGFIX: [Single-node VictoriaTraces](https://docs.victoriametrics.com/victoriatraces/) and vtselect in [VictoriaTraces cluster](https://docs.victoriametrics.com/victoriatraces/cluster/): match attribute values that look like durations in TraceQL filters of the Tempo API, such as `{ span.cache.ttl = "30s" }`. Previously, such a value was converted to nanoseconds and the filter matched nothing. The conversion now applies to `duration` and `traceDuration` filters only. Thank @ZeXi0308 for [the issue #321](https://github.com/VictoriaMetrics/VictoriaTraces/issues/321) and [the pull request #322](https://github.com/VictoriaMetrics/VictoriaTraces/pull/322).
* BUGFIX: [Single-node VictoriaTraces](https://docs.victoriametrics.com/victoriatraces/) and vtselect in [VictoriaTraces cluster](https://docs.victoriametrics.com/victoriatraces/cluster/): return status code `404` for requests to `/select/tempo/api/v2/traces/diff` without searching storage. Previously the `/select/tempo/api/v2/traces/` handler treated `diff` as a trace ID and performed an unnecessary scan, and returned status code `200` with an empty trace. Thank @mastersans for [the pull request #315](https://github.com/VictoriaMetrics/VictoriaTraces/pull/315).

## [v0.13.0](https://github.com/VictoriaMetrics/VictoriaTraces/releases/tag/v0.13.0)

Expand Down