Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Metrics Explorer - single-line graph only, no legends #1073

Merged
merged 2 commits into from
Oct 5, 2023
Merged
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
14 changes: 8 additions & 6 deletions public/components/custom_panels/helpers/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { ShortDate } from '@elastic/eui';
import { DurationRange } from '@elastic/eui/src/components/date_picker/types';
import _, { castArray, forEach, isEmpty } from 'lodash';
import _, { forEach, isEmpty } from 'lodash';
import { Moment } from 'moment-timezone';
import React from 'react';
import { Layout } from 'react-grid-layout';
Expand Down Expand Up @@ -345,10 +345,12 @@ const updateCatalogVisualizationQuery = ({
const attributesGroupString = attributesGroupBy.toString();
const startEpochTime = convertDateTime(startTime, true, false, true);
const endEpochTime = convertDateTime(endTime, false, false, true);
const promQuery =
attributesGroupBy.length === 0
? catalogTableName
: `${aggregation} by(${attributesGroupString}) (${catalogTableName})`;
// const promQuery =
// attributesGroupBy.length === 0
// ? `${aggregation} (${catalogTableName})`
// : `${aggregation} by(${attributesGroupString}) (${catalogTableName})`;

const promQuery = `${aggregation} (${catalogTableName})`;

return `source = ${catalogSourceName}.query_range('${promQuery}', ${startEpochTime}, ${endEpochTime}, '${spanParam}')`;
};
Expand Down Expand Up @@ -420,7 +422,7 @@ export const renderCatalogVisualization = async ({
layoutConfig: {
height: 390,
margin: { t: 5 },
legend: { orientation: 'h', yanchor: 'top', x: 0.0, y: -0.4 },
legend: { visible: false },
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import { SavedObjectsActions } from '../../../../services/saved_objects/saved_ob
import { ObservabilitySavedVisualization } from '../../../../services/saved_objects/saved_object_client/types';
import { FlyoutContainers } from '../../../common/flyout_containers';
import {
convertDateTime,
displayVisualization,
getQueryResponse,
isDateValid,
Expand All @@ -59,6 +58,7 @@ import {
import { replaceVizInPanel, selectPanel } from '../../redux/panel_slice';
import './visualization_flyout.scss';
import { useToast } from '../../../common/toast';
import { convertDateTime } from '../../../common/query_utils';

/*
* VisaulizationFlyoutSO - This module create a flyout to add visualization for SavedObjects custom Panels
Expand Down
Loading