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

[Security Solution][Detection Engine] adds EBT telemetry for rule preview #194326

Merged
merged 10 commits into from
Oct 10, 2024

Conversation

vitaliidm
Copy link
Contributor

@vitaliidm vitaliidm commented Sep 27, 2024

@vitaliidm vitaliidm self-assigned this Sep 27, 2024
@vitaliidm vitaliidm added Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Team:Detection Engine Security Solution Detection Engine Area 8.16 candidate labels Sep 27, 2024
@vitaliidm vitaliidm marked this pull request as ready for review September 30, 2024 11:00
@vitaliidm vitaliidm requested review from a team as code owners September 30, 2024 11:00
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-engine (Team:Detection Engine)

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 20.5MB 20.5MB +133.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
securitySolution 87.9KB 88.0KB +110.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @vitaliidm


import { previewRule } from '../../../rule_management/api/api';
import { transformOutput } from '../../../../detections/containers/detection_engine/rules/transforms';
import type { TimeframePreviewOptions } from '../../../../detections/pages/detection_engine/rules/types';
import { usePreviewInvocationCount } from './use_preview_invocation_count';
import * as i18n from './translations';

const trackPreview = (enableLoggedRequests: boolean) => {
track(METRIC_TYPE.COUNT, TELEMETRY_EVENT.PREVIEW_RULE_ALL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe using event based telemetry here can be a bit simlier.

it will be just 1 event with property for enabled logs

Copy link
Contributor Author

@vitaliidm vitaliidm Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkhristinin

Considered it, but went first with UI counters. On the second thought - it does not look to complicated to add EBT.
So, I reimplemented it. So need another approval here

@vitaliidm vitaliidm requested a review from nkhristinin October 9, 2024 14:54
@vitaliidm vitaliidm changed the title [Security Solution][Detection Engine] adds UI counters telemetry for rule preview [Security Solution][Detection Engine] adds EBT telemetry for rule preview Oct 9, 2024
Copy link
Contributor

@nkhristinin nkhristinin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 5929 5931 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 20.6MB 20.6MB +111.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
securitySolution 88.3KB 88.7KB +351.0B

History

cc @vitaliidm

@vitaliidm vitaliidm merged commit f687ce2 into elastic:main Oct 10, 2024
41 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11269960360

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 10, 2024
…le preview (#194326) (#195710)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution][Detection Engine] adds EBT telemetry for rule
preview (#194326)](#194326)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Vitalii
Dmyterko","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-10T08:06:33Z","message":"[Security
Solution][Detection Engine] adds EBT telemetry for rule preview
(#194326)\n\n## Summary\r\n\r\n - adds basic EBT telemetry for rule
preview\r\n\r\n### To test \r\n\r\nUse Discover Data View in staging to
see reported
events:\r\nhttps://telemetry-v2-staging.elastic.dev/s/securitysolution/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:now-28h,to:now))&_a=(columns:!(properties.ruleType,properties.loggedRequestsEnabled),filters:!(),index:security-solution-ebt-kibana-browser,interval:auto,query:(language:kuery,query:'event_type%20:%20%22Preview%20rule%22'),sort:!(!(timestamp,desc)))\r\n\r\nNote,
there is a few hours delay from event reported locally to be\r\nstored
on staging
host","sha":"f687ce2ba34a500522907b76add4327c16ad1bec","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:
SecuritySolution","backport:prev-minor","Team:Detection Engine","8.16
candidate"],"title":"[Security Solution][Detection Engine] adds EBT
telemetry for rule
preview","number":194326,"url":"https://github.com/elastic/kibana/pull/194326","mergeCommit":{"message":"[Security
Solution][Detection Engine] adds EBT telemetry for rule preview
(#194326)\n\n## Summary\r\n\r\n - adds basic EBT telemetry for rule
preview\r\n\r\n### To test \r\n\r\nUse Discover Data View in staging to
see reported
events:\r\nhttps://telemetry-v2-staging.elastic.dev/s/securitysolution/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:now-28h,to:now))&_a=(columns:!(properties.ruleType,properties.loggedRequestsEnabled),filters:!(),index:security-solution-ebt-kibana-browser,interval:auto,query:(language:kuery,query:'event_type%20:%20%22Preview%20rule%22'),sort:!(!(timestamp,desc)))\r\n\r\nNote,
there is a few hours delay from event reported locally to be\r\nstored
on staging
host","sha":"f687ce2ba34a500522907b76add4327c16ad1bec"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194326","number":194326,"mergeCommit":{"message":"[Security
Solution][Detection Engine] adds EBT telemetry for rule preview
(#194326)\n\n## Summary\r\n\r\n - adds basic EBT telemetry for rule
preview\r\n\r\n### To test \r\n\r\nUse Discover Data View in staging to
see reported
events:\r\nhttps://telemetry-v2-staging.elastic.dev/s/securitysolution/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:now-28h,to:now))&_a=(columns:!(properties.ruleType,properties.loggedRequestsEnabled),filters:!(),index:security-solution-ebt-kibana-browser,interval:auto,query:(language:kuery,query:'event_type%20:%20%22Preview%20rule%22'),sort:!(!(timestamp,desc)))\r\n\r\nNote,
there is a few hours delay from event reported locally to be\r\nstored
on staging host","sha":"f687ce2ba34a500522907b76add4327c16ad1bec"}}]}]
BACKPORT-->

Co-authored-by: Vitalii Dmyterko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.16 candidate backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants