Skip to content

Commit

Permalink
language_provider: fix query time params names (#73)
Browse files Browse the repository at this point in the history
The correct query param names for /field_values are `start` `end`.
See https://docs.victoriametrics.com/victorialogs/querying/#querying-field-values

Sending `from` and `to` params meant time range filter wasn't applied at all.
This made VictoriaLogs make the full data scan.
Which probably caused the following issues:
* #71
* #72
  • Loading branch information
hagen1778 authored Sep 10, 2024
1 parent edd3259 commit 9916a93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* FEATURE: add support of the `$__interval` variable in queries. See [this issue](https://github.com/VictoriaMetrics/victorialogs-datasource/issues/61).
Thanks to @yincongcyincong for [the pull request](https://github.com/VictoriaMetrics/victorialogs-datasource/pull/69).

* BUGFIX: correctly pass time range filter when querying variable values. Before, time filter wasn't applied for `/field_values` and `/field_names` API calls. See [this](https://github.com/VictoriaMetrics/victorialogs-datasource/issues/71) and [this](https://github.com/VictoriaMetrics/victorialogs-datasource/issues/72) issues.

## v0.4.0

* FEATURE: make retry attempt for datasource requests if returned error is a temporary network error. See [this issue](https://github.com/VictoriaMetrics/victoriametrics-datasource/issues/193)
Expand Down
4 changes: 2 additions & 2 deletions src/language_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export default class LogsQlLanguageProvider extends LanguageProvider {
getTimeRangeParams(timeRange?: TimeRange) {
const range = timeRange ?? getDefaultTimeRange();
return {
from: range.from.startOf('day').valueOf(),
to: range.to.endOf('day').valueOf(),
start: range.from.startOf('day').valueOf(),
end: range.to.endOf('day').valueOf()
}
}
}

0 comments on commit 9916a93

Please sign in to comment.