mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[EBT] Add Meta
description for EBT metrics on management pages (#225095)
## Summary Resolves https://github.com/elastic/observability-dev/issues/4556. This PR will amend the existing EBT `onPageReady` tracking for TTFCP with some descriptions to help consumers of the telemetry data understand the context around what we are tracking for this timing data. Also exports the `Meta` type for re-use in a Synthetics-specific implementation that needs to accept this parameter.
This commit is contained in:
parent
9f6eb0a0cb
commit
21fcf54178
9 changed files with 37 additions and 5 deletions
|
@ -10,7 +10,18 @@
|
||||||
type ApmPageId = 'services' | 'traces' | 'dependencies';
|
type ApmPageId = 'services' | 'traces' | 'dependencies';
|
||||||
type InfraPageId = 'hosts';
|
type InfraPageId = 'hosts';
|
||||||
type OnboardingPageId = 'onboarding';
|
type OnboardingPageId = 'onboarding';
|
||||||
|
type AlertingPageId = 'alerts';
|
||||||
|
type AlertDetailsPageId = 'alert_details';
|
||||||
|
type SloPageId = 'slos';
|
||||||
|
type SyntheticsPageId = 'synthetics';
|
||||||
|
|
||||||
export type Key = `${ApmPageId}` | `${InfraPageId}` | `${OnboardingPageId}`;
|
export type Key =
|
||||||
|
| `${ApmPageId}`
|
||||||
|
| `${InfraPageId}`
|
||||||
|
| `${OnboardingPageId}`
|
||||||
|
| `${AlertingPageId}`
|
||||||
|
| `${AlertDetailsPageId}`
|
||||||
|
| `${SloPageId}`
|
||||||
|
| `${SyntheticsPageId}`;
|
||||||
|
|
||||||
export type DescriptionWithPrefix = `[ttfmp_${Key}] ${string}`;
|
export type DescriptionWithPrefix = `[ttfmp_${Key}] ${string}`;
|
||||||
|
|
|
@ -24,4 +24,5 @@ function dynamic<TElement extends React.ComponentType<any>, TRef = {}>(loader: L
|
||||||
export { usePerformanceContext } from './context/use_performance_context';
|
export { usePerformanceContext } from './context/use_performance_context';
|
||||||
export { perfomanceMarkers } from './performance_markers';
|
export { perfomanceMarkers } from './performance_markers';
|
||||||
export { usePageReady } from './context/use_page_ready';
|
export { usePageReady } from './context/use_page_ready';
|
||||||
|
export { type Meta } from './context/performance_context';
|
||||||
export const PerformanceContextProvider = dynamic(() => import('./context/performance_context'));
|
export const PerformanceContextProvider = dynamic(() => import('./context/performance_context'));
|
||||||
|
|
|
@ -195,6 +195,10 @@ export function AlertDetails() {
|
||||||
usePageReady({
|
usePageReady({
|
||||||
isRefreshing: isLoading,
|
isRefreshing: isLoading,
|
||||||
isReady: !isLoading && !!alertDetail && activeTabId === 'overview',
|
isReady: !isLoading && !!alertDetail && activeTabId === 'overview',
|
||||||
|
meta: {
|
||||||
|
description:
|
||||||
|
'[ttfmp_alert_details] The Observability Alert Details overview page has loaded successfully.',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
|
|
|
@ -136,6 +136,7 @@ function InternalAlertsPage() {
|
||||||
meta: {
|
meta: {
|
||||||
rangeFrom: alertSearchBarStateProps.rangeFrom,
|
rangeFrom: alertSearchBarStateProps.rangeFrom,
|
||||||
rangeTo: alertSearchBarStateProps.rangeTo,
|
rangeTo: alertSearchBarStateProps.rangeTo,
|
||||||
|
description: '[ttfmp_alerts] The Observability Alerts page has loaded a table of alerts.',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -108,6 +108,9 @@ export function SloDetailsPage() {
|
||||||
usePageReady({
|
usePageReady({
|
||||||
isReady: !isLoading && slo !== undefined,
|
isReady: !isLoading && slo !== undefined,
|
||||||
isRefreshing: isRefetching,
|
isRefreshing: isRefetching,
|
||||||
|
meta: {
|
||||||
|
description: '[ttfmp_slos] The SLO details page has loaded and SLO data is present.',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
useBreadcrumbs(getBreadcrumbs(basePath, slo), { serverless });
|
useBreadcrumbs(getBreadcrumbs(basePath, slo), { serverless });
|
||||||
|
|
|
@ -82,6 +82,13 @@ export function SloList() {
|
||||||
usePageReady({
|
usePageReady({
|
||||||
isReady: !isLoading && sloList !== undefined,
|
isReady: !isLoading && sloList !== undefined,
|
||||||
isRefreshing: isLoading,
|
isRefreshing: isLoading,
|
||||||
|
customMetrics: {
|
||||||
|
key1: 'slo_list_count',
|
||||||
|
value1: sloList?.total ?? 0,
|
||||||
|
},
|
||||||
|
meta: {
|
||||||
|
description: '[ttfmp_slos] The SLOs list has finished loading.',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -39,7 +39,9 @@ export const MonitorListContainer = ({
|
||||||
|
|
||||||
const { status: overviewStatus } = useSelector(selectOverviewStatus);
|
const { status: overviewStatus } = useSelector(selectOverviewStatus);
|
||||||
|
|
||||||
useSyntheticsPageReady();
|
useSyntheticsPageReady({
|
||||||
|
meta: { description: '[ttfmp_synthetics] Synthetics monitor list has loaded.' },
|
||||||
|
});
|
||||||
|
|
||||||
// TODO: Display inline errors in the management table
|
// TODO: Display inline errors in the management table
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,9 @@ export const OverviewPage: React.FC = () => {
|
||||||
|
|
||||||
const { loading: locationsLoading, locationsLoaded } = useSelector(selectServiceLocationsState);
|
const { loading: locationsLoading, locationsLoaded } = useSelector(selectServiceLocationsState);
|
||||||
|
|
||||||
useSyntheticsPageReady();
|
useSyntheticsPageReady({
|
||||||
|
meta: { description: '[ttfmp_synthetics] Synthetics overview page has loaded monitor data.' },
|
||||||
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!locationsLoading && !locationsLoaded) {
|
if (!locationsLoading && !locationsLoaded) {
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { usePageReady } from '@kbn/ebt-tools';
|
import { usePageReady, type Meta } from '@kbn/ebt-tools';
|
||||||
import { initialLoadReported, selectOverviewStatus } from '../state/overview_status';
|
import { initialLoadReported, selectOverviewStatus } from '../state/overview_status';
|
||||||
|
|
||||||
export const useSyntheticsPageReady = () => {
|
export const useSyntheticsPageReady = (props?: { meta?: Meta }) => {
|
||||||
const {
|
const {
|
||||||
loaded,
|
loaded,
|
||||||
isInitialLoad,
|
isInitialLoad,
|
||||||
|
@ -29,5 +29,6 @@ export const useSyntheticsPageReady = () => {
|
||||||
// This will collect the metric even when we are periodically refreshing the data in the background
|
// This will collect the metric even when we are periodically refreshing the data in the background
|
||||||
// and not only when the user decides to refresh the data, the action is the same
|
// and not only when the user decides to refresh the data, the action is the same
|
||||||
isRefreshing: loaded && isLoadingOverviewStatus,
|
isRefreshing: loaded && isLoadingOverviewStatus,
|
||||||
|
meta: props?.meta,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue