Loki: Introduce $__auto range variable for metric queries (#72690)

* Loki: Add  interpolation to backend

* Loki: Replace default variable  with  in frontend

* Loki: Update docs in query builder fro __auto

* Loki: Update test for change default __auto

* Loki: Remove  and  from suggestions as  should be used

* Update docs

* Update pkg/tsdb/loki/parse_query.go

* Fix backend lint

* Fix lint and test

* Update

* Update docs/sources/datasources/loki/template-variables/index.md

Co-authored-by: lwandz13 <126723338+lwandz13@users.noreply.github.com>

* Update public/app/plugins/datasource/loki/querybuilder/operationUtils.ts

Co-authored-by: Matias Chomicki <matyax@gmail.com>

---------

Co-authored-by: lwandz13 <126723338+lwandz13@users.noreply.github.com>
Co-authored-by: Matias Chomicki <matyax@gmail.com>
This commit is contained in:
Ivana Huckova
2023-08-03 16:27:23 +02:00
committed by GitHub
parent b1fd399c10
commit 7bb0ff7055
16 changed files with 103 additions and 61 deletions

View File

@@ -42,7 +42,7 @@ describe('LokiQueryBuilderContainer', () => {
await addOperation('Range functions', 'Rate');
expect(await screen.findByText('Rate')).toBeInTheDocument();
expect(props.onChange).toBeCalledWith({
expr: 'rate({job="testjob"} [$__interval])',
expr: 'rate({job="testjob"} [$__auto])',
refId: 'A',
});
});