-
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.
[8.16] [SecuritySolution][Onboarding] Send Telemetry when integration…
… tabs or cards clicked (#196291) (#197296) # Backport This will backport the following commits from `main` to `8.16`: - [[SecuritySolution][Onboarding] Send Telemetry when integration tabs or cards clicked (#196291)](#196291) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Angela Chuang","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-22T15:52:43Z","message":"[SecuritySolution][Onboarding] Send Telemetry when integration tabs or cards clicked (#196291)\n\n## Summary\r\nhttps://github.com//issues/196145\r\n\r\nTo verify:\r\n\r\n1. Add these lines to `kibana.dev.yml`\r\n```\r\nlogging.browser.root.level: debug\r\ntelemetry.optIn: true\r\n```\r\n2. In the onboarding hub, expand the integration card.\r\nIt should log `onboarding_tab_${tabId}` on tabs clicked.\r\n\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/bd30c9ed-7c99-4ca0-93e7-6d9bf0146e62\r\n\r\n\r\nIt should log `onboarding_card_${integrationId}` on integration cards\r\nclicked.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/58750d88-7bbf-4b27-8e54-587f3f6f32c2\r\n\r\n\r\n3. Manage integrations callout link clicked::\r\n`onboarding_manage_integrations`;\r\n4. Endpoint callout link clicked: `onboarding_endpoint_learn_more`;\r\n5. Agentless callout link clicked: `onboarding_agentless_learn_more`;\r\n6. Agent still required callout link clicked:\r\n`onboarding_agent_required`;\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"2b270897a3f22ed5ca04ef173895cfa8660f9ea2","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:skip","v9.0.0","v6.8.16","Team:Threat Hunting:Explore","ci:cloud-deploy"],"title":"[SecuritySolution][Onboarding] Send Telemetry when integration tabs or cards clicked","number":196291,"url":"https://github.com/elastic/kibana/pull/196291","mergeCommit":{"message":"[SecuritySolution][Onboarding] Send Telemetry when integration tabs or cards clicked (#196291)\n\n## Summary\r\nhttps://github.com//issues/196145\r\n\r\nTo verify:\r\n\r\n1. Add these lines to `kibana.dev.yml`\r\n```\r\nlogging.browser.root.level: debug\r\ntelemetry.optIn: true\r\n```\r\n2. In the onboarding hub, expand the integration card.\r\nIt should log `onboarding_tab_${tabId}` on tabs clicked.\r\n\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/bd30c9ed-7c99-4ca0-93e7-6d9bf0146e62\r\n\r\n\r\nIt should log `onboarding_card_${integrationId}` on integration cards\r\nclicked.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/58750d88-7bbf-4b27-8e54-587f3f6f32c2\r\n\r\n\r\n3. Manage integrations callout link clicked::\r\n`onboarding_manage_integrations`;\r\n4. Endpoint callout link clicked: `onboarding_endpoint_learn_more`;\r\n5. Agentless callout link clicked: `onboarding_agentless_learn_more`;\r\n6. Agent still required callout link clicked:\r\n`onboarding_agent_required`;\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"2b270897a3f22ed5ca04ef173895cfa8660f9ea2"}},"sourceBranch":"main","suggestedTargetBranches":["6.8"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196291","number":196291,"mergeCommit":{"message":"[SecuritySolution][Onboarding] Send Telemetry when integration tabs or cards clicked (#196291)\n\n## Summary\r\nhttps://github.com//issues/196145\r\n\r\nTo verify:\r\n\r\n1. Add these lines to `kibana.dev.yml`\r\n```\r\nlogging.browser.root.level: debug\r\ntelemetry.optIn: true\r\n```\r\n2. In the onboarding hub, expand the integration card.\r\nIt should log `onboarding_tab_${tabId}` on tabs clicked.\r\n\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/bd30c9ed-7c99-4ca0-93e7-6d9bf0146e62\r\n\r\n\r\nIt should log `onboarding_card_${integrationId}` on integration cards\r\nclicked.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/58750d88-7bbf-4b27-8e54-587f3f6f32c2\r\n\r\n\r\n3. Manage integrations callout link clicked::\r\n`onboarding_manage_integrations`;\r\n4. Endpoint callout link clicked: `onboarding_endpoint_learn_more`;\r\n5. Agentless callout link clicked: `onboarding_agentless_learn_more`;\r\n6. Agent still required callout link clicked:\r\n`onboarding_agent_required`;\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"2b270897a3f22ed5ca04ef173895cfa8660f9ea2"}},{"branch":"6.8","label":"v6.8.16","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Angela Chuang <[email protected]>
- Loading branch information
1 parent
f9dee7c
commit 2f89ad1
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