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

[Observability] Exploratory View initial skeleton #94426

Merged
merged 86 commits into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
9e7c169
wip
shahzad31 Mar 7, 2021
12c028f
Merge branch 'master' into exploratry-view
shahzad31 Mar 8, 2021
b089a87
Save progress
shahzad31 Mar 10, 2021
501a166
Merge branch 'master' into exploratry-view
shahzad31 Mar 10, 2021
3ed7c82
breakpoint
shahzad31 Mar 11, 2021
c303383
Merge branch 'master' into exploratry-view
shahzad31 Mar 11, 2021
73b2c41
more views
shahzad31 Mar 15, 2021
9166efc
add def col
shahzad31 Mar 15, 2021
3783b5f
Merge branch 'master' into exploratry-view
shahzad31 Mar 15, 2021
04316ab
update
shahzad31 Mar 15, 2021
9677edd
Merge branch 'master' into exploratry-view
shahzad31 Mar 15, 2021
e715ace
wip
shahzad31 Mar 15, 2021
5d3605f
Merge branch 'master' into exploratry-view
shahzad31 Mar 15, 2021
3d824be
wip
shahzad31 Mar 16, 2021
1db17ad
Merge branch 'master' into exploratry-view
shahzad31 Mar 16, 2021
306fa3f
wip
shahzad31 Mar 17, 2021
e2f281f
Merge branch 'master' into exploratry-view
shahzad31 Mar 17, 2021
700cdd7
fix more stuff
shahzad31 Mar 18, 2021
ee82e77
Merge branch 'master' into exploratry-view
shahzad31 Mar 19, 2021
1d5a7c8
update
shahzad31 Mar 21, 2021
91bcf95
Merge branch 'master' into exploratry-view
shahzad31 Mar 22, 2021
2ec3924
update filters
shahzad31 Mar 22, 2021
4f8f118
update
shahzad31 Mar 22, 2021
b2fbc2b
wip
shahzad31 Mar 23, 2021
e5c1e59
update
shahzad31 Mar 23, 2021
c14a2e5
update asset
shahzad31 Mar 24, 2021
165a540
update
shahzad31 Mar 24, 2021
e3b3eb5
update eslint
shahzad31 Mar 24, 2021
4b8aab4
Merge branch 'master' into exploratry-view
shahzad31 Mar 24, 2021
84c2abe
udate
shahzad31 Mar 24, 2021
75b87e1
wip
shahzad31 Mar 24, 2021
533698a
update plugin start/setup
shahzad31 Mar 24, 2021
f60a7f5
Merge branch 'master' into exploratry-view
shahzad31 Mar 24, 2021
805f062
update
shahzad31 Mar 24, 2021
8952b21
Merge branch 'master' into update-obsv-plugin-setup
shahzad31 Mar 24, 2021
68282c6
fix types
shahzad31 Mar 24, 2021
9886ef6
Merge branch 'master' into update-obsv-plugin-setup
shahzad31 Mar 25, 2021
a2121eb
update types
shahzad31 Mar 25, 2021
4b87ef9
Merge branch 'master' into exploratry-view
shahzad31 Mar 25, 2021
ad9574f
Merge branch 'master' into exploratry-view
shahzad31 Mar 25, 2021
52cbefa
fix type
shahzad31 Mar 25, 2021
a6dcd15
fix types
shahzad31 Mar 25, 2021
7af9e25
fix types
shahzad31 Mar 25, 2021
6c1a330
fix types
shahzad31 Mar 25, 2021
89d87e0
Merge branch 'master' into exploratry-view
shahzad31 Mar 25, 2021
a85d735
Merge branch 'master' into exploratry-view
shahzad31 Mar 25, 2021
3c670f2
fix test
shahzad31 Mar 25, 2021
d26f306
update test
shahzad31 Mar 25, 2021
ec98c08
Merge branch 'update-obsv-plugin-setup' into exploratry-view
shahzad31 Mar 25, 2021
43887f1
update types
shahzad31 Mar 26, 2021
967888a
fix types
shahzad31 Mar 26, 2021
8e5109f
Merge branch 'master' into exploratry-view
shahzad31 Mar 26, 2021
9acecc1
fix issue
shahzad31 Mar 26, 2021
082eaf4
Merge branch 'master' into exploratry-view
shahzad31 Mar 26, 2021
211716b
fix types
shahzad31 Mar 26, 2021
635be8e
test
shahzad31 Mar 26, 2021
50e100f
Merge branch 'master' into exploratry-view
shahzad31 Mar 26, 2021
dbb98c7
update tests
shahzad31 Mar 29, 2021
68d8243
added ests
shahzad31 Mar 29, 2021
1f4a516
update
shahzad31 Mar 29, 2021
31b60b6
Merge branch 'master' into exploratry-view
shahzad31 Mar 30, 2021
0557ad3
update
shahzad31 Mar 30, 2021
c512b3d
Merge branch 'master' into exploratry-view
shahzad31 Mar 30, 2021
e4ce7bd
update labels
shahzad31 Mar 30, 2021
1b57eff
Merge branch 'master' into exploratry-view
shahzad31 Mar 30, 2021
17120a6
Merge branch 'master' into exploratry-view
shahzad31 Mar 30, 2021
1710e5d
PR feedback
shahzad31 Mar 31, 2021
f162f96
update
shahzad31 Mar 31, 2021
c43e925
add loading state
shahzad31 Mar 31, 2021
adfefa3
fix types
shahzad31 Mar 31, 2021
e004a7a
fix types
shahzad31 Mar 31, 2021
01a1559
update test
shahzad31 Mar 31, 2021
5406e75
Merge branch 'master' into exploratry-view
shahzad31 Mar 31, 2021
2b5229b
update test
shahzad31 Mar 31, 2021
f894f18
update constants
shahzad31 Mar 31, 2021
7050460
fix type
shahzad31 Mar 31, 2021
06f305b
Merge branch 'master' into exploratry-view
kibanamachine Apr 1, 2021
62070d4
Merge branch 'master' into exploratry-view
shahzad31 Apr 1, 2021
9090e64
update mock
shahzad31 Apr 1, 2021
3e29da3
Merge branch 'exploratry-view' of https://github.com/shahzad31/kibana…
shahzad31 Apr 1, 2021
25c45e0
update test file
shahzad31 Apr 1, 2021
c18c829
debug tests
shahzad31 Apr 1, 2021
99d3596
Merge branch 'master' into exploratry-view
shahzad31 Apr 2, 2021
679a4a8
Merge branch 'master' into exploratry-view
shahzad31 Apr 3, 2021
9c86621
Merge branch 'master' into exploratry-view
shahzad31 Apr 5, 2021
7e5cf29
update plugin setup
shahzad31 Apr 5, 2021
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
4 changes: 3 additions & 1 deletion src/plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {
// Filter helpers namespace:
export const esFilters = {
FilterLabel,
FilterItem,

FILTERS,
FilterStateStore,
Expand Down Expand Up @@ -92,7 +93,7 @@ export const esFilters = {
extractTimeRange,
};

export {
export type {
RangeFilter,
RangeFilterMeta,
RangeFilterParams,
Expand Down Expand Up @@ -484,6 +485,7 @@ export { APPLY_FILTER_TRIGGER } from './triggers';
*/

import { DataPublicPlugin } from './plugin';
import { FilterItem } from './ui/filter_bar';

export function plugin(initializerContext: PluginInitializerContext<ConfigSchema>) {
return new DataPublicPlugin(initializerContext);
Expand Down
166 changes: 89 additions & 77 deletions src/plugins/data/public/ui/filter_bar/filter_item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import {
} from '../../../common';
import { getIndexPatterns } from '../../services';

interface Props {
type PanelOptions = 'pinFilter' | 'editFilter' | 'negateFilter' | 'disableFilter' | 'deleteFilter';

export interface FilterItemProps {
id: string;
filter: Filter;
indexPatterns: IIndexPattern[];
Expand All @@ -34,6 +36,7 @@ interface Props {
onRemove: () => void;
intl: InjectedIntl;
uiSettings: IUiSettingsClient;
hiddenPanelOptions?: Array<PanelOptions>;
}

interface LabelOptions {
Expand All @@ -53,10 +56,10 @@ export type FilterLabelStatus =

export const FILTER_EDITOR_WIDTH = 800;

export function FilterItem(props: Props) {
export function FilterItem(props: FilterItemProps) {
const [isPopoverOpen, setIsPopoverOpen] = useState<boolean>(false);
const [indexPatternExists, setIndexPatternExists] = useState<boolean | undefined>(undefined);
const { id, filter, indexPatterns } = props;
const { id, filter, indexPatterns, hiddenPanelOptions } = props;

useEffect(() => {
const index = props.filter.meta.index;
Expand Down Expand Up @@ -154,83 +157,90 @@ export function FilterItem(props: Props) {

function getPanels() {
const { negate, disabled } = filter.meta;
return [
let mainPanelItems = [
{
id: 0,
items: [
{
name: isFilterPinned(filter)
? props.intl.formatMessage({
id: 'data.filter.filterBar.unpinFilterButtonLabel',
defaultMessage: 'Unpin',
})
: props.intl.formatMessage({
id: 'data.filter.filterBar.pinFilterButtonLabel',
defaultMessage: 'Pin across all apps',
}),
icon: 'pin',
onClick: () => {
setIsPopoverOpen(false);
onTogglePinned();
},
'data-test-subj': 'pinFilter',
},
{
name: props.intl.formatMessage({
id: 'data.filter.filterBar.editFilterButtonLabel',
defaultMessage: 'Edit filter',
name: isFilterPinned(filter)
? props.intl.formatMessage({
id: 'data.filter.filterBar.unpinFilterButtonLabel',
defaultMessage: 'Unpin',
})
: props.intl.formatMessage({
id: 'data.filter.filterBar.pinFilterButtonLabel',
defaultMessage: 'Pin across all apps',
}),
icon: 'pencil',
panel: 1,
'data-test-subj': 'editFilter',
},
{
name: negate
? props.intl.formatMessage({
id: 'data.filter.filterBar.includeFilterButtonLabel',
defaultMessage: 'Include results',
})
: props.intl.formatMessage({
id: 'data.filter.filterBar.excludeFilterButtonLabel',
defaultMessage: 'Exclude results',
}),
icon: negate ? 'plusInCircle' : 'minusInCircle',
onClick: () => {
setIsPopoverOpen(false);
onToggleNegated();
},
'data-test-subj': 'negateFilter',
},
{
name: disabled
? props.intl.formatMessage({
id: 'data.filter.filterBar.enableFilterButtonLabel',
defaultMessage: 'Re-enable',
})
: props.intl.formatMessage({
id: 'data.filter.filterBar.disableFilterButtonLabel',
defaultMessage: 'Temporarily disable',
}),
icon: `${disabled ? 'eye' : 'eyeClosed'}`,
onClick: () => {
setIsPopoverOpen(false);
onToggleDisabled();
},
'data-test-subj': 'disableFilter',
},
{
name: props.intl.formatMessage({
id: 'data.filter.filterBar.deleteFilterButtonLabel',
defaultMessage: 'Delete',
icon: 'pin',
onClick: () => {
setIsPopoverOpen(false);
onTogglePinned();
},
'data-test-subj': 'pinFilter',
},
{
name: props.intl.formatMessage({
id: 'data.filter.filterBar.editFilterButtonLabel',
defaultMessage: 'Edit filter',
}),
icon: 'pencil',
panel: 1,
'data-test-subj': 'editFilter',
},
{
name: negate
? props.intl.formatMessage({
id: 'data.filter.filterBar.includeFilterButtonLabel',
defaultMessage: 'Include results',
})
: props.intl.formatMessage({
id: 'data.filter.filterBar.excludeFilterButtonLabel',
defaultMessage: 'Exclude results',
}),
icon: negate ? 'plusInCircle' : 'minusInCircle',
onClick: () => {
setIsPopoverOpen(false);
onToggleNegated();
},
'data-test-subj': 'negateFilter',
},
{
name: disabled
? props.intl.formatMessage({
id: 'data.filter.filterBar.enableFilterButtonLabel',
defaultMessage: 'Re-enable',
})
: props.intl.formatMessage({
id: 'data.filter.filterBar.disableFilterButtonLabel',
defaultMessage: 'Temporarily disable',
}),
icon: 'trash',
onClick: () => {
setIsPopoverOpen(false);
props.onRemove();
},
'data-test-subj': 'deleteFilter',
},
],
icon: `${disabled ? 'eye' : 'eyeClosed'}`,
onClick: () => {
setIsPopoverOpen(false);
onToggleDisabled();
},
'data-test-subj': 'disableFilter',
},
{
name: props.intl.formatMessage({
id: 'data.filter.filterBar.deleteFilterButtonLabel',
defaultMessage: 'Delete',
}),
icon: 'trash',
onClick: () => {
setIsPopoverOpen(false);
props.onRemove();
},
'data-test-subj': 'deleteFilter',
},
];

if (hiddenPanelOptions && hiddenPanelOptions.length > 0) {
mainPanelItems = mainPanelItems.filter(
(pItem) => !hiddenPanelOptions.includes(pItem['data-test-subj'] as PanelOptions)
);
}
return [
{
id: 0,
items: mainPanelItems,
},
{
id: 1,
Expand Down Expand Up @@ -363,3 +373,5 @@ export function FilterItem(props: Props) {
</EuiPopover>
);
}

export default FilterItem;
9 changes: 9 additions & 0 deletions src/plugins/data/public/ui/filter_bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@ export const FilterLabel = (props: FilterLabelProps) => (
<LazyFilterLabel {...props} />
</React.Suspense>
);

import type { FilterItemProps } from './filter_item';

const LazyFilterItem = React.lazy(() => import('./filter_item'));
export const FilterItem = (props: FilterItemProps) => (
<React.Suspense fallback={<Fallback />}>
<LazyFilterItem {...props} />
</React.Suspense>
);
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
*/

import React, { useState } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui';
import {
EuiButton,
EuiFlexGroup,
EuiFlexItem,
EuiSpacer,
EuiTitle,
} from '@elastic/eui';
import rison from 'rison-node';
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
import { useFetcher } from '../../../../hooks/use_fetcher';
import { I18LABELS } from '../translations';
Expand All @@ -17,7 +24,7 @@ import { BreakdownItem } from '../../../../../typings/ui_filters';
export function PageViewsTrend() {
const { urlParams, uiFilters } = useUrlParams();

const { start, end, searchTerm } = urlParams;
const { start, end, searchTerm, serviceName } = urlParams;

const [breakdown, setBreakdown] = useState<BreakdownItem | null>(null);

Expand Down Expand Up @@ -48,6 +55,14 @@ export function PageViewsTrend() {
[end, start, uiFilters, breakdown, searchTerm]
);

const analyzeHref = {
[serviceName + '-pgv']: {
rt: 'pgv',
serviceName,
time: { from: start, to: end },
},
};

return (
<div>
<EuiFlexGroup responsive={false}>
Expand All @@ -63,6 +78,16 @@ export function PageViewsTrend() {
dataTestSubj={'pvBreakdownFilter'}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton
size="s"
href={`/app/observability/exploratory-view#?sr=${rison.encode(
analyzeHref
)}`}
>
Analyze
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="s" />
<PageViewsChart data={data} loading={status !== 'success'} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ export function getRumPageLoadTransactionsProjection({
filter: [
...rangeQuery(start, end),
{ term: { [TRANSACTION_TYPE]: TRANSACTION_PAGE_LOAD } },
...(checkFetchStartFieldExists
? [
{
// Adding this filter to cater for some inconsistent rum data
// not available on aggregated transactions
exists: {
field: 'transaction.marks.navigationTiming.fetchStart',
},
},
]
: []),
...(urlQuery
? [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const percentileOperation: OperationDefinition<PercentileIndexPatternColu
enabled: true,
schema: 'metric',
field: column.sourceField,
percents: [column.params.percentile],
percents: [60, column.params.percentile],
}).toAst();
},
getEsAggsSuffix: (column) => {
Expand Down
8 changes: 7 additions & 1 deletion x-pack/plugins/lens/public/xy_visualization/expression.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
HorizontalAlignment,
ElementClickListener,
BrushEndListener,
CurveType,
} from '@elastic/charts';
import { I18nProvider } from '@kbn/i18n/react';
import {
Expand Down Expand Up @@ -773,7 +774,12 @@ export function XYChart({
switch (seriesType) {
case 'line':
return (
<LineSeries key={index} {...seriesProps} fit={getFitOptions(fittingFunction)} />
<LineSeries
key={index}
{...seriesProps}
fit={getFitOptions(fittingFunction)}
curve={CurveType.CURVE_CATMULL_ROM}
/>
);
case 'bar':
case 'bar_stacked':
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/observability/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"kibanaVersion": "kibana",
"configPath": ["xpack", "observability"],
"optionalPlugins": ["licensing", "home", "usageCollection"],
"requiredPlugins": ["data"],
"requiredPlugins": ["data", "lens"],
"ui": true,
"server": true,
"requiredBundles": ["data", "kibanaReact", "kibanaUtils"]
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/observability/public/application/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import { PluginContext } from '../context/plugin_context';
import { usePluginContext } from '../hooks/use_plugin_context';
import { useRouteParams } from '../hooks/use_route_params';
import { ObservabilityPluginSetupDeps } from '../plugin';
import { ObservabilityClientPluginsStart } from '../plugin';
import { HasDataContextProvider } from '../context/has_data_context';
import { Breadcrumbs, routes } from '../routes';

Expand Down Expand Up @@ -61,7 +61,7 @@ function App() {

export const renderApp = (
core: CoreStart,
plugins: ObservabilityPluginSetupDeps,
plugins: ObservabilityClientPluginsStart,
appMountParameters: AppMountParameters
) => {
const { element, history } = appMountParameters;
Expand Down
Loading