-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Introduce custom dashboards tab in service overview #166789
Merged
Merged
Changes from 57 commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
9c09111
Add dashboards svg
kpatticha 32cfd91
Introduce dashboards tab
kpatticha 435f133
Add empty component
kpatticha 448478f
List available dashboards to select
kpatticha 87d3c05
Add dashboard as a saved object
kpatticha 7597387
wip
kpatticha 8842051
Add linkTo property
kpatticha d7dfd7a
wip
kpatticha 3ea1c10
Merge branch 'main' of github.com:elastic/kibana into 163590-dashboard
kpatticha 3a831f2
Fetch dashboard specific to the service
kpatticha bcc0879
Add contect menu
kpatticha 4e29c2d
Fix context menu
kpatticha 01896c7
Fix refresh
kpatticha 0070117
Add unlink option
kpatticha 776c330
Go to dashboard link
kpatticha 38a2d91
Additional actions
kpatticha bfbdb32
Clean up
kpatticha 1cf717c
Move state to the component
kpatticha abd138e
Add edit mode
kpatticha 17071a7
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine ed23453
Rename components
kpatticha 8124da3
Polish the UI
kpatticha b5576e2
Fix loading
kpatticha c00caa1
Disable adding existing service dashboards
kpatticha 1eb36e4
Fix preselect current dashboard
kpatticha ed642a3
Return latest updated service dashboard
kpatticha 26f526a
Use context filter
kpatticha c2d2533
Merge branch '163590-dashboard' of github.com:kpatticha/kibana into 1…
kpatticha b825d57
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 280eae6
Merge branch 'main' of github.com:elastic/kibana into 163590-dashboard
kpatticha 61b98e0
Fix packages
kpatticha e41add7
Fix types
kpatticha 468cf94
Merge branch '163590-dashboard' of github.com:kpatticha/kibana into 1…
kpatticha 4938015
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 3f996b7
Revert change regarding telemetry task
kpatticha 2057c02
Merge branch '163590-dashboard' of github.com:kpatticha/kibana into 1…
kpatticha 7fc3ddc
Address design feedback
kpatticha d3d9fda
Add api tests
kpatticha 6cdf44a
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine 511ff54
Fix i18n keys
kpatticha b440043
Merge branch '163590-dashboard' of github.com:kpatticha/kibana into 1…
kpatticha 21813e8
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine 5799238
Rename SO to `apm-custom-dashboards`
kpatticha e0ce670
Remove not used attributes
kpatticha a889f3d
Fetch dashboard title dynamically
kpatticha dc83340
Show dashboard that exists
kpatticha d4dcf1e
Merge branch 'main' of github.com:elastic/kibana into 163590-dashboard
kpatticha 09a0234
Get service that match dashboard kuery
kpatticha f69c8a7
Update API tests
kpatticha 0dec0fa
Merge branch '163590-dashboard' of github.com:kpatticha/kibana into 1…
kpatticha 2b5ae27
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine eb1f920
Deep-link specific dashboard
kpatticha 4b37f76
Merge branch '163590-dashboard' of github.com:kpatticha/kibana into 1…
kpatticha 9d2e573
Fix eslint
kpatticha e49b972
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine acb2da7
Fix dashboard updateInput
kpatticha 3106f02
Merge branch '163590-dashboard' of github.com:kpatticha/kibana into 1…
kpatticha 1fef7be
Rename useContextFilter to useServiceFiltet
kpatticha 8ed3d8a
Fix mapping
kpatticha d3c66fc
Make SO exportable
kpatticha 2e54123
Make sure we search only if there any linked dashboards
kpatticha fac14a6
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine 928d739
Merge branch 'main' into 163590-dashboard
kibanamachine 86ae010
Pass timerange
kpatticha 43f4545
Fix checks
kpatticha 14079de
Fix types
kpatticha cdeeff2
Fix types in testing
kpatticha db629d8
Address feedback, rename to customDashboard
kpatticha 878fec0
t pMerge branch 'main' of github.com:elastic/kibana into 163590-dashb…
kpatticha e8c8e2d
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine 01ca59b
Merge branch 'main' into 163590-dashboard
kpatticha e911284
Fix tests
kpatticha 8e7be83
Merge branch '163590-dashboard' of github.com:kpatticha/kibana into 1…
kpatticha 6093ebf
Merge branch 'main' of github.com:elastic/kibana into 163590-dashboard
kpatticha 869f7be
Update snapshot
kpatticha 7cb024b
Rename getLinkedCustomDashboards to getCustomDashboards
kpatticha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const APM_CUSTOM_DASHBOARDS_SAVED_OBJECT_TYPE = 'apm-custom-dashboards'; | ||
|
||
export interface ServiceDashboard { | ||
dashboardSavedObjectId: string; | ||
useContextFilter: boolean; | ||
kuery?: string; | ||
} | ||
|
||
export interface SavedServiceDashboard extends ServiceDashboard { | ||
id: string; | ||
updatedAt: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
x-pack/plugins/apm/public/components/app/service_dashboards/actions/edit_dashboard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* 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 { EuiButtonEmpty } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import React, { useState } from 'react'; | ||
import { SavedServiceDashboard } from '../../../../../common/service_dashboards'; | ||
import { SaveDashboardModal } from './save_dashboard_modal'; | ||
|
||
export function EditDashboard({ | ||
onRefresh, | ||
currentDashboard, | ||
}: { | ||
onRefresh: () => void; | ||
currentDashboard: SavedServiceDashboard; | ||
}) { | ||
const [isModalVisible, setIsModalVisible] = useState(false); | ||
return ( | ||
<> | ||
<EuiButtonEmpty | ||
color="text" | ||
size="s" | ||
iconType={'pencil'} | ||
data-test-subj="apmEditServiceDashboardMenu" | ||
onClick={() => setIsModalVisible(!isModalVisible)} | ||
> | ||
{i18n.translate('xpack.apm.serviceDashboards.editEmptyButtonLabel', { | ||
defaultMessage: 'Edit dashboard link', | ||
})} | ||
</EuiButtonEmpty> | ||
|
||
{isModalVisible && ( | ||
<SaveDashboardModal | ||
onClose={() => setIsModalVisible(!isModalVisible)} | ||
onRefresh={onRefresh} | ||
currentDashboard={currentDashboard} | ||
/> | ||
)} | ||
</> | ||
); | ||
} |
41 changes: 41 additions & 0 deletions
41
x-pack/plugins/apm/public/components/app/service_dashboards/actions/goto_dashboard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* 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 { EuiButtonEmpty } from '@elastic/eui'; | ||
import { useKibana } from '@kbn/kibana-react-plugin/public'; | ||
import { i18n } from '@kbn/i18n'; | ||
import React from 'react'; | ||
import { ApmPluginStartDeps } from '../../../../plugin'; | ||
import { SavedServiceDashboard } from '../../../../../common/service_dashboards'; | ||
|
||
export function GotoDashboard({ | ||
currentDashboard, | ||
}: { | ||
currentDashboard: SavedServiceDashboard; | ||
}) { | ||
const { | ||
services: { | ||
dashboard: { locator: dashboardLocator }, | ||
}, | ||
} = useKibana<ApmPluginStartDeps>(); | ||
|
||
const url = dashboardLocator?.getRedirectUrl({ | ||
dashboardId: currentDashboard?.dashboardSavedObjectId, | ||
}); | ||
return ( | ||
<EuiButtonEmpty | ||
data-test-subj="apmGotoDashboardGoToDashboardButton" | ||
color="text" | ||
size="s" | ||
iconType={'visGauge'} | ||
href={url} | ||
> | ||
{i18n.translate('xpack.apm.serviceDashboards.contextMenu.goToDashboard', { | ||
defaultMessage: 'Go to dashboard', | ||
})} | ||
</EuiButtonEmpty> | ||
); | ||
} |
12 changes: 12 additions & 0 deletions
12
x-pack/plugins/apm/public/components/app/service_dashboards/actions/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* 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 { LinkDashboard } from './link_dashboard'; | ||
import { GotoDashboard } from './goto_dashboard'; | ||
import { EditDashboard } from './edit_dashboard'; | ||
|
||
export { LinkDashboard, GotoDashboard, EditDashboard }; |
58 changes: 58 additions & 0 deletions
58
x-pack/plugins/apm/public/components/app/service_dashboards/actions/link_dashboard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* 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 { EuiButton, EuiButtonEmpty } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import React, { useState } from 'react'; | ||
import { SavedServiceDashboard } from '../../../../../common/service_dashboards'; | ||
import { SaveDashboardModal } from './save_dashboard_modal'; | ||
|
||
export function LinkDashboard({ | ||
onRefresh, | ||
emptyButton = false, | ||
serviceDashboards, | ||
}: { | ||
onRefresh: () => void; | ||
emptyButton?: boolean; | ||
serviceDashboards?: SavedServiceDashboard[]; | ||
}) { | ||
const [isModalVisible, setIsModalVisible] = useState(false); | ||
|
||
return ( | ||
<> | ||
{emptyButton ? ( | ||
<EuiButtonEmpty | ||
color="text" | ||
size="s" | ||
iconType={'plusInCircle'} | ||
data-test-subj="apmLinkServiceDashboardMenu" | ||
onClick={() => setIsModalVisible(true)} | ||
> | ||
{i18n.translate('xpack.apm.serviceDashboards.linkEmptyButtonLabel', { | ||
defaultMessage: 'Link new dashboard', | ||
})} | ||
</EuiButtonEmpty> | ||
) : ( | ||
<EuiButton | ||
data-test-subj="apmAddServiceDashboard" | ||
onClick={() => setIsModalVisible(true)} | ||
> | ||
{i18n.translate('xpack.apm.serviceDashboards.linkButtonLabel', { | ||
defaultMessage: 'Link dashboard', | ||
})} | ||
</EuiButton> | ||
)} | ||
|
||
{isModalVisible && ( | ||
<SaveDashboardModal | ||
onClose={() => setIsModalVisible(false)} | ||
onRefresh={onRefresh} | ||
serviceDashboards={serviceDashboards} | ||
/> | ||
)} | ||
</> | ||
); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it should be called "service" since one dashboard could be linked to many services (at least in the future)