mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Elasticsearch: Enable full range log volume histogram (#41202)
* Rename "Logs volume" labels to "Log volume" Code references are kept intact as there's a lot of them, it could be renamed in a separate PR just with renaming * Add log level docs * Remove feature flag to enable log volume by default * Update error message * Update docs * Fix unit test * Fix unit test Queries are now run automatically * Add extra param for Loki API * Remove "Load volume" button * Update documentation about log volume * Move comment * Make reload button more accessible * Update docs/sources/explore/logs-integration.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Hide full range log volume for Loki behind the feature toggle Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
This commit is contained in:
@@ -5,7 +5,6 @@ import {
|
||||
cancelQueriesAction,
|
||||
clearCache,
|
||||
importQueries,
|
||||
loadLogsVolumeData,
|
||||
queryReducer,
|
||||
runQueries,
|
||||
scanStartAction,
|
||||
@@ -33,18 +32,6 @@ import { reducerTester } from '../../../../test/core/redux/reducerTester';
|
||||
import { configureStore } from '../../../store/configureStore';
|
||||
import { setTimeSrv } from '../../dashboard/services/TimeSrv';
|
||||
import Mock = jest.Mock;
|
||||
import { config } from '@grafana/runtime';
|
||||
|
||||
jest.mock('@grafana/runtime', () => ({
|
||||
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||
config: {
|
||||
...((jest.requireActual('@grafana/runtime') as unknown) as any).config,
|
||||
featureToggles: {
|
||||
fullRangeLogsVolume: true,
|
||||
autoLoadFullRangeLogsVolume: false,
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
const t = toUtc();
|
||||
const testRange = {
|
||||
@@ -376,29 +363,21 @@ describe('reducer', () => {
|
||||
|
||||
it('should cancel any unfinished logs volume queries', async () => {
|
||||
await dispatch(runQueries(ExploreId.left));
|
||||
// no subscriptions created yet
|
||||
expect(unsubscribes).toHaveLength(0);
|
||||
|
||||
await dispatch(loadLogsVolumeData(ExploreId.left));
|
||||
// first query is run automatically
|
||||
// loading in progress - one subscription created, not cleaned up yet
|
||||
expect(unsubscribes).toHaveLength(1);
|
||||
expect(unsubscribes[0]).not.toBeCalled();
|
||||
|
||||
setupQueryResponse(getState());
|
||||
await dispatch(runQueries(ExploreId.left));
|
||||
// new query was run - first subscription is cleaned up, no new subscriptions yet
|
||||
expect(unsubscribes).toHaveLength(1);
|
||||
// a new query is run while log volume query is not resolve yet...
|
||||
expect(unsubscribes[0]).toBeCalled();
|
||||
|
||||
await dispatch(loadLogsVolumeData(ExploreId.left));
|
||||
// new subscription is created, only the old was was cleaned up
|
||||
// first subscription is cleaned up, a new subscription is created automatically
|
||||
expect(unsubscribes).toHaveLength(2);
|
||||
expect(unsubscribes[0]).toBeCalled();
|
||||
expect(unsubscribes[1]).not.toBeCalled();
|
||||
});
|
||||
|
||||
it('should load logs volume after running the query', async () => {
|
||||
config.featureToggles.autoLoadFullRangeLogsVolume = true;
|
||||
await dispatch(runQueries(ExploreId.left));
|
||||
expect(unsubscribes).toHaveLength(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user