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

[APM] Elastic Entity Model enablement #187593

Merged
merged 33 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a4379ef
Add service for logs rate timeseries
kpatticha Jun 25, 2024
0cbef3c
Add service for logs error rate timeseries
kpatticha Jun 25, 2024
539b8c1
Add API test
kpatticha Jun 25, 2024
d307334
Add api tests
kpatticha Jun 25, 2024
4564a4f
Merge branch 'main' of github.com:elastic/kibana into logs-timeseries
kpatticha Jun 26, 2024
9b133db
wip
kpatticha Jun 27, 2024
40b74bf
Merge branch 'main' of github.com:elastic/kibana into logs-timeseries
kpatticha Jun 28, 2024
143460f
Add log rate chart
kpatticha Jun 28, 2024
89fc6db
display charts
kpatticha Jun 28, 2024
42c8e7c
Fix call out
kpatticha Jun 28, 2024
2f1f1a3
Fix dashboard
kpatticha Jun 28, 2024
789442b
Fix TS and lint
kpatticha Jun 30, 2024
4d0f59a
wip
kpatticha Jul 1, 2024
06f8c3e
Merge branch 'main' of github.com:elastic/kibana into eem-enablement
kpatticha Jul 4, 2024
55c44d7
Improve eem enablement workflow
kpatticha Jul 4, 2024
244da1a
Show feedback modal on restore
kpatticha Jul 4, 2024
0cbb85f
Handle unauthorised
kpatticha Jul 4, 2024
7d7a82c
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jul 4, 2024
829cfb1
Address PR feedback
kpatticha Jul 8, 2024
49427b5
Fix lint
kpatticha Jul 8, 2024
664e785
Merge branch 'eem-enablement' of github.com:kpatticha/kibana into eem…
kpatticha Jul 8, 2024
3fc0fd5
Update text for the link and popover
kpatticha Jul 9, 2024
ec86fb0
Merge branch 'main' of github.com:elastic/kibana into eem-enablement
kpatticha Jul 9, 2024
e305811
Pixel perfect feedback modal
kpatticha Jul 9, 2024
76916e9
Update text for the unauthorised modal
kpatticha Jul 9, 2024
2f60139
Add thank you survey
kpatticha Jul 9, 2024
884db4d
Merge branch 'main' into eem-enablement
smith Jul 9, 2024
c9019f1
Merge branch 'main' into eem-enablement
kpatticha Jul 10, 2024
5f8ca54
Merge branch 'main' into eem-enablement
kpatticha Jul 10, 2024
65ca981
Use the last EEM index
kpatticha Jul 10, 2024
083f5cd
Merge branch 'eem-enablement' of github.com:kpatticha/kibana into eem…
kpatticha Jul 10, 2024
3b1a7be
Fix tests
kpatticha Jul 10, 2024
808a64e
Update test
kpatticha Jul 10, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('Service inventory', () => {
it('with the correct environment when changing the environment', () => {
cy.wait(mainAliasNames);

cy.getByTestSubj('environmentFilter').type('production');
cy.getByTestSubj('environmentFilter').type('{selectall}production');

cy.contains('button', 'production').click();

Expand All @@ -103,6 +103,7 @@ describe('Service inventory', () => {

it('when selecting a different time range and clicking the update button', () => {
cy.wait(mainAliasNames);
cy.getByTestSubj('apmServiceGroupsTourDismissButton').click();

cy.selectAbsoluteTimeRange(
moment(timeRange.rangeFrom).subtract(5, 'm').toISOString(),
Expand Down
12 changes: 3 additions & 9 deletions x-pack/plugins/observability_solution/apm/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"lens",
"maps",
"uiActions",
"logsDataAccess"
"logsDataAccess",
"entityManager"
],
"optionalPlugins": [
"actions",
Expand All @@ -52,13 +53,6 @@
"cases",
"observabilityAIAssistant"
],
"requiredBundles": [
"fleet",
"kibanaReact",
"kibanaUtils",
"ml",
"observability",
"maps"
]
"requiredBundles": ["fleet", "kibanaReact", "kibanaUtils", "ml", "observability", "maps"]
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,39 @@
* 2.0.
*/
import React from 'react';
import { i18n } from '@kbn/i18n';
import { EuiEmptyPrompt, EuiLoadingLogo } from '@elastic/eui';
import { isEmpty } from 'lodash';
import { apmEnableMultiSignal } from '@kbn/observability-plugin/common';
import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context';
import { ApmServiceInventory } from './apm_signal_inventory';
import { MultiSignalInventory } from './multi_signal_inventory';
import { useApmParams } from '../../../hooks/use_apm_params';
import { useEntityManagerEnablementContext } from '../../../context/entity_manager_context/use_entity_manager_enablement_context';

export const ServiceInventory = () => {
const { core } = useApmPluginContext();
const isMultiSignalEnabled = core.uiSettings.get<boolean>(apmEnableMultiSignal, false);
export function ServiceInventory() {
const { isEntityManagerEnabled, isEnablementPending } = useEntityManagerEnablementContext();

const {
query: { serviceGroup },
} = useApmParams('/services');

return isMultiSignalEnabled && isEmpty(serviceGroup) ? (
if (isEnablementPending) {
return (
<EuiEmptyPrompt
icon={<EuiLoadingLogo logo="logoObservability" size="xl" />}
title={
<h2>
{i18n.translate('xpack.apm.loadingService', {
defaultMessage: 'Loading services',
})}
</h2>
}
/>
);
}

return isEntityManagerEnabled && isEmpty(serviceGroup) ? (
<MultiSignalInventory />
) : (
<ApmServiceInventory />
);
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const apmRoutes = {
environmentFilter={false}
showServiceGroupSaveButton={false}
showServiceGroupsNav
showEnablementCallout
selectedNavButton="serviceGroups"
>
<ServiceGroupsList />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { RedirectWithDefaultEnvironment } from './redirect_with_default_environm
import { RedirectWithOffset } from './redirect_with_offset';
import { ScrollToTopOnPathChange } from './scroll_to_top_on_path_change';
import { UpdateExecutionContextOnRouteChange } from './update_execution_context_on_route_change';
import { EntityManagerEnablementContextProvider } from '../../../context/entity_manager_context/entity_manager_context';

const storage = new Storage(localStorage);

Expand Down Expand Up @@ -83,15 +84,17 @@ export function ApmAppRoot({
<BreadcrumbsContextProvider>
<UrlParamsProvider>
<LicenseProvider>
<AnomalyDetectionJobsContextProvider>
<InspectorContextProvider>
<ApmThemeProvider>
<MountApmHeaderActionMenu />
<Route component={ScrollToTopOnPathChange} />
<RouteRenderer />
</ApmThemeProvider>
</InspectorContextProvider>
</AnomalyDetectionJobsContextProvider>
<EntityManagerEnablementContextProvider>
<AnomalyDetectionJobsContextProvider>
<InspectorContextProvider>
<ApmThemeProvider>
<MountApmHeaderActionMenu />
<Route component={ScrollToTopOnPathChange} />
<RouteRenderer />
</ApmThemeProvider>
</InspectorContextProvider>
</AnomalyDetectionJobsContextProvider>
</EntityManagerEnablementContextProvider>
</LicenseProvider>
</UrlParamsProvider>
</BreadcrumbsContextProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { ServiceGroupsButtonGroup } from '../../app/service_groups/service_group
import { ApmEnvironmentFilter } from '../../shared/environment_filter';
import { getNoDataConfig } from './no_data_config';
import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context';
import { EntityEnablement } from '../../shared/entity_enablement';

// Paths that must skip the no data screen
const bypassNoDataScreenPaths = ['/settings', '/diagnostics'];
Expand All @@ -45,6 +46,7 @@ export function ApmMainTemplate({
environmentFilter = true,
showServiceGroupSaveButton = false,
showServiceGroupsNav = false,
showEnablementCallout = false,
environmentFilterInTemplate = true,
selectedNavButton,
...pageTemplateProps
Expand All @@ -55,6 +57,7 @@ export function ApmMainTemplate({
environmentFilter?: boolean;
showServiceGroupSaveButton?: boolean;
showServiceGroupsNav?: boolean;
showEnablementCallout?: boolean;
selectedNavButton?: 'serviceGroups' | 'allServices';
} & KibanaPageTemplateProps &
Pick<ObservabilityPageTemplateProps, 'pageSectionProps'>) {
Expand Down Expand Up @@ -126,6 +129,7 @@ export function ApmMainTemplate({
const pageHeaderTitle = (
<EuiFlexGroup justifyContent="spaceBetween" wrap={true}>
{pageHeader?.pageTitle ?? pageTitle}
<EuiFlexItem grow={false} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Why is this item needed?

<EuiFlexItem grow={false}>
<EuiFlexGroup justifyContent="center">
<EuiFlexItem grow={false}>
Expand All @@ -152,10 +156,14 @@ export function ApmMainTemplate({
rightSideItems,
...pageHeader,
pageTitle: pageHeaderTitle,
children:
showServiceGroupsNav && selectedNavButton ? (
<ServiceGroupsButtonGroup selectedNavButton={selectedNavButton} />
) : null,
children: (
<EuiFlexGroup direction="column">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this will actually happen but if none of the conditions below are met, there will be an empty div in the DOM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the component we pass as children? That won't happen unless we change the template params we pass. We pass showServiceGroupsNav in ServiceGroupTemplate which is used for the services

{showEnablementCallout && selectedNavButton === 'allServices' && <EntityEnablement />}
{showServiceGroupsNav && selectedNavButton && (
<ServiceGroupsButtonGroup selectedNavButton={selectedNavButton} />
)}
</EuiFlexGroup>
),
}}
{...pageTemplateProps}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export function ServiceGroupTemplate({
environmentFilter={environmentFilter}
showServiceGroupSaveButton={!isAllServices}
showServiceGroupsNav={isAllServices}
showEnablementCallout
selectedNavButton={isAllServices ? 'allServices' : 'serviceGroups'}
{...pageTemplateProps}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React, { useContext } from 'react';
import { i18n } from '@kbn/i18n';
import {
useEuiTheme,
EuiButtonEmpty,
EuiConfirmModal,
EuiFlexGroup,
EuiFlexItem,
EuiIcon,
EuiPanel,
EuiText,
EuiTitle,
} from '@elastic/eui';
import { getSurveyFeedbackURL } from '@kbn/observability-shared-plugin/public';
import { KibanaEnvironmentContext } from '../../../context/kibana_environment_context/kibana_environment_context';
import { getPathForFeedback } from '../../../utils/get_path_for_feedback';

export function FeedbackModal({
isFeedbackModalVisible = false,
onClose,
}: {
isFeedbackModalVisible?: boolean;
onClose: () => void;
}) {
const kibanaEnvironment = useContext(KibanaEnvironmentContext);
const { kibanaVersion, isCloudEnv, isServerlessEnv } = kibanaEnvironment;
const sanitizedPath = getPathForFeedback(window.location.pathname);
const { euiTheme } = useEuiTheme();

return (
<>
{isFeedbackModalVisible && (
<EuiConfirmModal
style={{
width: '600px',
}}
onCancel={onClose}
onConfirm={onClose}
confirmButtonText={
<EuiButtonEmpty
css={{
color: euiTheme.colors.emptyShade,
}}
data-test-subj="xpack.apm.eemFeedback.button.open"
iconType="discuss"
target="_blank"
size="s"
href={getSurveyFeedbackURL({
formUrl: 'https://ela.st/new-o11y-experience',
kibanaVersion,
isCloudEnv,
isServerlessEnv,
sanitizedPath,
})}
>
{i18n.translate('xpack.apm.eemFeedback.button.openSurvey', {
defaultMessage: 'Tell us what you think!',
})}
</EuiButtonEmpty>
}
defaultFocusedButton="confirm"
>
<EuiPanel hasShadow={false}>
<EuiFlexGroup
direction="column"
justifyContent="center"
alignItems="center"
gutterSize="s"
>
<EuiFlexItem>
<EuiIcon type="heart" size="l" />
</EuiFlexItem>
<EuiFlexItem>
<EuiTitle>
<h2>
{i18n.translate('xpack.apm.eemFeedback.title', {
defaultMessage: 'Let us know what you think!',
})}
</h2>
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>

<EuiPanel hasShadow={false} paddingSize="s">
<EuiText grow={false} size="s">
<p>
{i18n.translate('xpack.apm.feedbackModal.body.thanks', {
defaultMessage:
"Thank you for trying our new experience. We'll be continuing to improve on this so please come back often.",
})}
</p>
</EuiText>
</EuiPanel>
</EuiConfirmModal>
)}
</>
);
}
Loading