-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SecuritySolution][Onboarding] Send Telemetry when integration tabs o…
…r cards clicked (#196291) ## Summary #196145 To verify: 1. Add these lines to `kibana.dev.yml` ``` logging.browser.root.level: debug telemetry.optIn: true ``` 2. In the onboarding hub, expand the integration card. It should log `onboarding_tab_${tabId}` on tabs clicked. https://github.com/user-attachments/assets/bd30c9ed-7c99-4ca0-93e7-6d9bf0146e62 It should log `onboarding_card_${integrationId}` on integration cards clicked. https://github.com/user-attachments/assets/58750d88-7bbf-4b27-8e54-587f3f6f32c2 3. Manage integrations callout link clicked:: `onboarding_manage_integrations`; 4. Endpoint callout link clicked: `onboarding_endpoint_learn_more`; 5. Agentless callout link clicked: `onboarding_agentless_learn_more`; 6. Agent still required callout link clicked: `onboarding_agent_required`; ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (cherry picked from commit 2b27089)
- Loading branch information
Showing
15 changed files
with
185 additions
and
12 deletions.
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
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/security_solution/public/onboarding/common/lib/__mocks__/telemetry.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,8 @@ | ||
/* | ||
* 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 trackOnboardingLinkClick = jest.fn(); |
12 changes: 12 additions & 0 deletions
12
x-pack/plugins/security_solution/public/onboarding/common/lib/telemetry.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 { METRIC_TYPE, TELEMETRY_EVENT, track } from '../../../common/lib/telemetry'; | ||
|
||
export const trackOnboardingLinkClick = (linkId: string) => { | ||
track(METRIC_TYPE.CLICK, `${TELEMETRY_EVENT.ONBOARDING}_${linkId}`); | ||
}; |
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
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
43 changes: 43 additions & 0 deletions
43
...boarding/components/onboarding_body/cards/integrations/callouts/endpoint_callout.test.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,43 @@ | ||
/* | ||
* 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. | ||
*/ | ||
/* | ||
* 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 from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { EndpointCallout } from './endpoint_callout'; | ||
import { TestProviders } from '../../../../../../common/mock/test_providers'; | ||
import { trackOnboardingLinkClick } from '../../../../../common/lib/telemetry'; | ||
|
||
jest.mock('../../../../../../common/lib/kibana'); | ||
jest.mock('../../../../../common/lib/telemetry'); | ||
|
||
describe('EndpointCallout', () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('renders the callout', () => { | ||
const { getByTestId, getByText } = render(<EndpointCallout />, { wrapper: TestProviders }); | ||
|
||
expect( | ||
getByText('Orchestrate response across endpoint vendors with bidirectional integrations') | ||
).toBeInTheDocument(); | ||
expect(getByTestId('endpointLearnMoreLink')).toBeInTheDocument(); | ||
}); | ||
|
||
it('should track the agent link click', () => { | ||
const { getByTestId } = render(<EndpointCallout />, { wrapper: TestProviders }); | ||
|
||
getByTestId('endpointLearnMoreLink').click(); | ||
|
||
expect(trackOnboardingLinkClick).toHaveBeenCalledWith('endpoint_learn_more'); | ||
}); | ||
}); |
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
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
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
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