Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 docs/victoriatraces/changelog/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The following `tip` changes can be tested by building VictoriaTraces components
* FEATURE: [vmui](https://docs.victoriametrics.com/victoriatraces/querying/#web-ui): add the `Volume by service` chart to the Trace Explorer page. It shows the number of spans over time for the top 20 services, so ingestion spikes and the traffic split across services are visible. See [this issue #263](https://github.com/VictoriaMetrics/VictoriaTraces/issues/263).

* 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).

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

Expand Down
10 changes: 5 additions & 5 deletions lib/traceql/filter_general.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ func (fc *filterCommon) String() string {
} else if fieldName == "kind" {
// map span kind (server, client, producer, consumer...) to numeric OpenTelemetry SpanKind values.
fieldValue = rewriteSpanKindInRegex(fieldValue)
}

// translate duration to nanosecond.
if duration, ok := tryParseDuration(fieldValue); ok {
fieldValue = strconv.FormatInt(duration, 10)
} else if fieldName == otelpb.DurationField {
// translate duration to nanosecond.
if duration, ok := tryParseDuration(fieldValue); ok {
fieldValue = strconv.FormatInt(duration, 10)
}
}

// for stream filter, just use the source op (=, !=, =~, !~), as they're identical in LogsQL.
Expand Down
3 changes: 3 additions & 0 deletions lib/traceql/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ func TestParseQuery(t *testing.T) {
f(`{ span.http.request_content_length > 10} | select(span.http.request_content_length) | by(span.http.request_content_length, span.http.request_content_length2) | sum(other_field) > 2m`, `"span_attr:http.request_content_length":>10 | select(span.http.request_content_length) | by(span.http.request_content_length, span.http.request_content_length2) | sum(other_field) > 2m`)
f(`{(a=b && c=d && c=d)}`, `a:=b and c:=d and c:=d`)
f(`{span.http.status_code = "200"}`, `"span_attr:http.status_code":=200`)
f(`{span.cache.ttl = "30s"}`, `"span_attr:cache.ttl":=30s`)
f(`{span.cache.ttl = 30s}`, `"span_attr:cache.ttl":=30s`)
f(`{duration > 100ms}`, `duration:>100000000`)
f(`{status = "error"}`, `status_code:=2`)
f(`{status = "unset"}`, `status_code:=0`)
f(`{resource.service.name = "my_service"}`, `{"resource_attr:service.name"=my_service}`)
Expand Down