Skip to content

Commit

Permalink
Metrics Explorer - single-line graph only, no legends (opensearch-pro…
Browse files Browse the repository at this point in the history
…ject#1068) (opensearch-project#1073)

* Metrics Explorer - single-line graph only, no legends
---------

(cherry picked from commit 408d38f)

Signed-off-by: Peter Fitzgibbons <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Peter Fitzgibbons <[email protected]>
(cherry picked from commit fe565f9)
  • Loading branch information
opensearch-trigger-bot[bot] authored and A9 Swift Project User committed Oct 12, 2023
1 parent c236f33 commit 2c2f3d9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions auto_sync_commit_metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"last_github_commit": "171acde2cd2468d619cdd9bd7051144197ebd89d",
"last_gitfarm_commit": "4b5220261e4f5ecf259856ff1963e8e29dd1644b"
"last_github_commit": "fe565f96ce134996040a1bcbc19ebbeefcb16545",
"last_gitfarm_commit": "90ffcdfd909666278283a588e5770217c71865c4"
}
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

0 comments on commit 2c2f3d9

Please sign in to comment.