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

[8.x] [Onboarding] Additional auto-detect flow telemetry (#207726) #208489

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -7,46 +7,53 @@

import type { EventTypeOpts, SchemaValue } from '@elastic/ebt/client';

interface ObservabilityOnboardingIntegrationTelemetryFields {
installSource: string;
pkgName: string;
pkgVersion: string;
title: string;
}

interface FlowEventFields {
flow?: string;
step?: string;
step_status?: string;
flow_type: string;
flow_id: string;
step: string;
step_status: string;
step_message?: string;
uses_legacy_onboarding_page: boolean;
payload?: {
integrations?: Array<{
installSource: string;
pkgName: string;
pkgVersion: string;
title: string;
}>;
agentId?: string;
os?: string;
arch?: string;
};
}

type ObservabilityOnboardingTelemetryEvent = EventTypeOpts<FlowEventFields>;

export const OBSERVABILITY_ONBOARDING_TELEMETRY_EVENT: ObservabilityOnboardingTelemetryEvent = {
eventType: 'observability_onboarding',
schema: {
flow: {
flow_type: {
type: 'keyword',
_meta: {
description:
"The current onboarding flow user is going through (e.g. 'system_logs', 'nginx'). If not present, user is on the landing screen.",
optional: true,
"The current onboarding flow type user is going through (e.g. 'autoDetect', 'logFiles', 'kubernetes'). If not present, user is on the landing screen.",
},
},
flow_id: {
type: 'keyword',
_meta: {
description: 'Unique identifier of the current onboarding session',
},
},
step: {
type: 'keyword',
_meta: {
description: 'The current step in the onboarding flow.',
optional: true,
},
},
step_status: {
type: 'keyword',
_meta: {
description: 'The status of the step in the onboarding flow.',
optional: true,
},
},
step_message: {
Expand All @@ -56,10 +63,62 @@ export const OBSERVABILITY_ONBOARDING_TELEMETRY_EVENT: ObservabilityOnboardingTe
optional: true,
},
},
uses_legacy_onboarding_page: {
type: 'boolean',
payload: {
properties: {
integrations: {
type: 'array',
items: {
properties: {
installSource: {
type: 'keyword',
_meta: {
description:
'The source of the package used to create the integration. Usually "registry" or "custom".',
},
},
pkgName: {
type: 'keyword',
_meta: {
description: 'The name of the package used to create the integration.',
},
},
pkgVersion: {
type: 'keyword',
_meta: {
description: 'The version of the package used to create the integration.',
},
},
title: { type: 'keyword', _meta: { description: 'The visual name of the package.' } },
},
},
_meta: {
optional: true,
},
},
agentId: {
type: 'keyword',
_meta: {
description: 'The ID of the Elastic Agent installed on the host.',
optional: true,
},
},
os: {
type: 'keyword',
_meta: {
description: 'OS used by the host.',
optional: true,
},
},
arch: {
type: 'keyword',
_meta: {
description: 'Architecture used by the host.',
optional: true,
},
},
},
_meta: {
description: 'Whether the user is using the legacy onboarding page or the new one',
optional: true,
},
},
},
Expand Down Expand Up @@ -87,48 +146,6 @@ export const OBSERVABILITY_ONBOARDING_FEEDBACK_TELEMETRY_EVENT: EventTypeOpts<{
},
};

type ObservabilityOnboardingAutodetectTelemetryEvent = EventTypeOpts<
FlowEventFields & {
integrations?: ObservabilityOnboardingIntegrationTelemetryFields[];
}
>;

export const OBSERVABILITY_ONBOARDING_AUTODETECT_TELEMETRY_EVENT: ObservabilityOnboardingAutodetectTelemetryEvent =
{
eventType: 'observability_onboarding_autodetect',
schema: {
...OBSERVABILITY_ONBOARDING_TELEMETRY_EVENT.schema,
integrations: {
type: 'array',
items: {
properties: {
installSource: {
type: 'keyword',
_meta: {
description:
'The source of the package used to create the integration. Usually "registry" or "custom".',
},
},
pkgName: {
type: 'keyword',
_meta: {
description: 'The name of the package used to create the integration.',
},
},
pkgVersion: {
type: 'keyword',
_meta: { description: 'The version of the package used to create the integration.' },
},
title: { type: 'keyword', _meta: { description: 'The visual name of the package.' } },
},
},
_meta: {
optional: true,
},
},
},
};

interface OnboardingFirehoseFlowEventContext {
selectedCreateStackOption?: string;
cloudServiceProvider?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app';
import { Router } from '@kbn/shared-ux-router';
import React from 'react';
import ReactDOM from 'react-dom';
import { OBSERVABILITY_ONBOARDING_TELEMETRY_EVENT } from '../../common/telemetry_events';
import { AppContext, ConfigSchema, ObservabilityOnboardingAppServices } from '..';
import { ObservabilityOnboardingHeaderActionMenu } from './shared/header_action_menu';
import {
Expand Down Expand Up @@ -53,10 +52,6 @@ export function ObservabilityOnboardingAppRoot({
context,
};

core.analytics.reportEvent(OBSERVABILITY_ONBOARDING_TELEMETRY_EVENT.eventType, {
uses_legacy_onboarding_page: false,
});

return (
<KibanaRenderContextProvider {...core}>
<div className={APP_WRAPPER_CLASS}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import { GetStartedPanel } from '../shared/get_started_panel';
import { isSupportedLogo, LogoIcon } from '../../shared/logo_icon';
import { FeedbackButtons } from '../shared/feedback_buttons';
import { ObservabilityOnboardingContextValue } from '../../../plugin';
import { useAutoDetectTelemetry } from './use_auto_detect_telemetry';
import { SupportedIntegrationsList } from './supported_integrations_list';

export const AutoDetectPanel: FunctionComponent = () => {
Expand All @@ -46,16 +45,6 @@ export const AutoDetectPanel: FunctionComponent = () => {
services: { share },
} = useKibana<ObservabilityOnboardingContextValue>();

useAutoDetectTelemetry(
status,
installedIntegrations.map(({ title, pkgName, pkgVersion, installSource }) => ({
title,
pkgName,
pkgVersion,
installSource,
}))
);

if (error) {
return <EmptyPrompt onboardingFlowType="auto-detect" error={error} onRetryClick={refetch} />;
}
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading