Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into ml-aiops-group-leve…
Browse files Browse the repository at this point in the history
…l-chart-sync
  • Loading branch information
alvarezmelissa87 committed Sep 20, 2022
2 parents 9556098 + f4dd515 commit ed4b26f
Show file tree
Hide file tree
Showing 125 changed files with 3,419 additions and 511 deletions.
3 changes: 3 additions & 0 deletions docs/settings/apm-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ Maximum number of child items displayed when viewing trace details. Defaults to
`xpack.observability.annotations.index` {ess-icon}::
Index name where Observability annotations are stored. Defaults to `observability-annotations`.

`xpack.apm.searchAggregatedServiceMetrics` {ess-icon}::
Enables Service metrics. Defaults to `false`. When set to `true`, additional configuration in APM Server is required.

`xpack.apm.searchAggregatedTransactions` {ess-icon}::
Enables Transaction histogram metrics. Defaults to `auto` so the UI will use metric indices over transaction indices for transactions if aggregated transactions are found. When set to `always`, additional configuration in APM Server is required. When set to `never` and aggregated transactions are not used.
+
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"@dnd-kit/utilities": "^2.0.0",
"@elastic/apm-rum": "^5.12.0",
"@elastic/apm-rum-react": "^1.4.2",
"@elastic/charts": "48.0.1",
"@elastic/charts": "49.0.0",
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "npm:@elastic/[email protected]",
"@elastic/ems-client": "8.3.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pageLoadAssetSize:
embeddableEnhanced: 22107
enterpriseSearch: 35741
esUiShared: 326654
eventAnnotation: 19500
eventAnnotation: 20500
expressionError: 22127
expressionGauge: 25000
expressionHeatmap: 27505
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
LayoutDirection,
Metric,
MetricElementEvent,
MetricWNumber,
MetricWProgress,
Settings,
} from '@elastic/charts';
Expand Down Expand Up @@ -1124,7 +1125,7 @@ describe('MetricVisComponent', function () {
value: primaryMetric,
valueFormatter,
extra,
} = component.find(Metric).props().data?.[0][0]!;
} = component.find(Metric).props().data?.[0][0]! as MetricWNumber;

return { primary: valueFormatter(primaryMetric), secondary: extra?.props.children[1] };
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export const AvailableReferenceLineIcons = {
MAP_MARKER: 'mapMarker',
PIN_FILLED: 'pinFilled',
STAR_EMPTY: 'starEmpty',
STAR_FILLED: 'starFilled',
TAG: 'tag',
TRIANGLE: 'triangle',
} as const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ export const iconSet = [
value: AvailableReferenceLineIcons.STAR_EMPTY,
label: i18n.translate('expressionXY.xyChart.iconSelect.starLabel', { defaultMessage: 'Star' }),
},
{
value: AvailableReferenceLineIcons.STAR_FILLED,
label: i18n.translate('expressionXY.xyChart.iconSelect.starFilledLabel', {
defaultMessage: 'Star filled',
}),
},
{
value: AvailableReferenceLineIcons.TAG,
label: i18n.translate('expressionXY.xyChart.iconSelect.tagIconLabel', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ export function DiscoverLayout({
viewMode={viewMode}
onDataViewCreated={onDataViewCreated}
availableFields$={savedSearchData$.availableFields$}
persistDataView={persistDataView}
/>
</EuiFlexItem>
<EuiHideFor sizes={['xs', 's']}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ async function getComponent({
onRemoveField: jest.fn(),
showFieldStats,
selected,
persistDataView: jest.fn(),
state: {
query: { query: '', language: 'lucene' },
filters: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ export interface DiscoverFieldProps {
* Optionally show or hide field stats in the popover
*/
showFieldStats?: boolean;
persistDataView: (dataView: DataView) => Promise<DataView | undefined>;

/**
* Discover App State
Expand All @@ -293,7 +292,6 @@ function DiscoverFieldComponent({
onEditField,
onDeleteField,
showFieldStats,
persistDataView,
state,
contextualFields,
}: DiscoverFieldProps) {
Expand Down Expand Up @@ -520,7 +518,6 @@ function DiscoverFieldComponent({
multiFields={rawMultiFields}
trackUiMetric={trackUiMetric}
contextualFields={contextualFields}
persistDataView={persistDataView}
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
import React, { useEffect, useState } from 'react';
import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics';
import type { DataView, DataViewField } from '@kbn/data-views-plugin/public';
import { VISUALIZE_GEO_FIELD_TRIGGER } from '@kbn/ui-actions-plugin/public';
import {
getTriggerConstant,
triggerVisualizeActions,
VisualizeInformation,
} from './lib/visualize_trigger_utils';
import { triggerVisualizeActions, VisualizeInformation } from './lib/visualize_trigger_utils';
import { getVisualizeInformation } from './lib/visualize_trigger_utils';
import { DiscoverFieldVisualizeInner } from './discover_field_visualize_inner';

Expand All @@ -24,11 +19,10 @@ interface Props {
multiFields?: DataViewField[];
contextualFields: string[];
trackUiMetric?: (metricType: UiCounterMetricType, eventName: string | string[]) => void;
persistDataView: (dataView: DataView) => Promise<DataView | undefined>;
}

export const DiscoverFieldVisualize: React.FC<Props> = React.memo(
({ field, dataView, contextualFields, trackUiMetric, multiFields, persistDataView }) => {
({ field, dataView, contextualFields, trackUiMetric, multiFields }) => {
const [visualizeInfo, setVisualizeInfo] = useState<VisualizeInformation>();

useEffect(() => {
Expand All @@ -47,20 +41,11 @@ export const DiscoverFieldVisualize: React.FC<Props> = React.memo(
// regular link click. let the uiActions code handle the navigation and show popup if needed
event.preventDefault();

const trigger = getTriggerConstant(field.type);
const triggerVisualization = (updatedDataView: DataView) => {
trackUiMetric?.(METRIC_TYPE.CLICK, 'visualize_link_click');
triggerVisualizeActions(visualizeInfo.field, contextualFields, updatedDataView);
};

if (trigger === VISUALIZE_GEO_FIELD_TRIGGER) {
const updatedDataView = await persistDataView(dataView);
if (updatedDataView) {
triggerVisualization(updatedDataView);
}
} else {
triggerVisualization(dataView);
}
triggerVisualization(dataView);
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ function getCompProps(): DiscoverSidebarProps {
onDataViewCreated: jest.fn(),
availableFields$,
useNewFieldsApi: true,
persistDataView: jest.fn(),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import useShallowCompareEffect from 'react-use/lib/useShallowCompareEffect';
import { isEqual } from 'lodash';
import { FormattedMessage } from '@kbn/i18n-react';
import { DataViewPicker } from '@kbn/unified-search-plugin/public';
import { DataViewField, getFieldSubtypeMulti, type DataView } from '@kbn/data-views-plugin/public';
import { DataViewField, getFieldSubtypeMulti } from '@kbn/data-views-plugin/public';
import { useDiscoverServices } from '../../../../hooks/use_discover_services';
import { DiscoverField } from './discover_field';
import { DiscoverFieldSearch } from './discover_field_search';
Expand Down Expand Up @@ -93,7 +93,6 @@ export interface DiscoverSidebarProps extends Omit<DiscoverSidebarResponsiveProp
viewMode: VIEW_MODE;

showDataViewPicker?: boolean;
persistDataView: (dataView: DataView) => Promise<DataView | undefined>;
}

export function DiscoverSidebarComponent({
Expand All @@ -118,7 +117,6 @@ export function DiscoverSidebarComponent({
createNewDataView,
showDataViewPicker,
state,
persistDataView,
}: DiscoverSidebarProps) {
const { uiSettings, dataViewFieldEditor } = useDiscoverServices();
const [fields, setFields] = useState<DataViewField[] | null>(null);
Expand Down Expand Up @@ -415,7 +413,6 @@ export function DiscoverSidebarComponent({
onEditField={editField}
onDeleteField={deleteField}
showFieldStats={showFieldStats}
persistDataView={persistDataView}
state={state}
contextualFields={columns}
/>
Expand Down Expand Up @@ -478,7 +475,6 @@ export function DiscoverSidebarComponent({
onEditField={editField}
onDeleteField={deleteField}
showFieldStats={showFieldStats}
persistDataView={persistDataView}
state={state}
contextualFields={columns}
/>
Expand Down Expand Up @@ -510,7 +506,6 @@ export function DiscoverSidebarComponent({
onEditField={editField}
onDeleteField={deleteField}
showFieldStats={showFieldStats}
persistDataView={persistDataView}
state={state}
contextualFields={columns}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ function getCompProps(): DiscoverSidebarResponsiveProps {
viewMode: VIEW_MODE.DOCUMENT_LEVEL,
onDataViewCreated: jest.fn(),
useNewFieldsApi: true,
persistDataView: jest.fn(),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export interface DiscoverSidebarResponsiveProps {
* list of available fields fetched from ES
*/
availableFields$: AvailableFields$;
persistDataView: (dataView: DataView) => Promise<DataView | undefined>;
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/plugins/event_annotation/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const AvailableAnnotationIcons = {
MAP_MARKER: 'mapMarker',
PIN_FILLED: 'pinFilled',
STAR_EMPTY: 'starEmpty',
STAR_FILLED: 'starFilled',
TAG: 'tag',
TRIANGLE: 'triangle',
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const getConvertFnByType = (type: PANEL_TYPES) => {
*/
export const convertTSVBtoLensConfiguration = async (model: Panel, timeRange?: TimeRange) => {
// Disables the option for not supported charts, for the string mode and for series with annotations
if (!model.use_kibana_indexes || (model.annotations && model.annotations.length > 0)) {
if (!model.use_kibana_indexes) {
return null;
}
// Disables if model is invalid
Expand Down
Loading

0 comments on commit ed4b26f

Please sign in to comment.