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

[Behavioral Analytics] Introduce empty state for events tab #146685

Merged

Conversation

tutelaris
Copy link
Member

@tutelaris tutelaris commented Nov 30, 2022

Description

In order to proceed with the Behavioral Analytics introduction, it's required to introduce an empty state on the events tab, when there are no events, and remove this state once events start coming.

This PR is dedicated to introducing an empty state in the events tab.

Screen.Recording.2022-12-02.at.18.53.07.mov

@tutelaris tutelaris added release_note:skip Skip the PR/issue when compiling release notes skip-ci Team:EnterpriseSearch labels Nov 30, 2022
@tutelaris tutelaris self-assigned this Nov 30, 2022
@tutelaris tutelaris requested a review from a team November 30, 2022 13:28
@tutelaris tutelaris marked this pull request as draft November 30, 2022 13:29
@tutelaris tutelaris force-pushed the tutelaris/introduce-empty-state-events branch from 243fc36 to 081ddab Compare November 30, 2022 13:30
@tutelaris tutelaris force-pushed the tutelaris/introduce-empty-state-events branch 3 times, most recently from d98257d to 2a83fc6 Compare December 2, 2022 17:25
@tutelaris tutelaris removed the skip-ci label Dec 2, 2022
@tutelaris tutelaris force-pushed the tutelaris/introduce-empty-state-events branch from 2a83fc6 to b74d535 Compare December 2, 2022 17:40
@tutelaris tutelaris marked this pull request as ready for review December 2, 2022 17:41
try {
const eventsIndexExists = await analyticsEventsIndexExists(client, request.params.id);

if (!eventsIndexExists) {
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: as this is the purpose of the API, I wouldn't expect it to throw an error if the index doesn't exist. It should be a 2xx response with a boolean flag on whether the index exists or not.

Copy link
Member Author

@tutelaris tutelaris Dec 12, 2022

Choose a reason for hiding this comment

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

I'm not sure. It's going to be not REST-compliant then, since we try to call exists in the scope of passed {collectionId}. If it was events/exists/{collectionId}, then it makes sense. Also, I wanted to be aligned with the Elasticsearch API, which returns 404 if the index doesn't exist and returns 200 with the payload when it exists

Copy link
Member

Choose a reason for hiding this comment

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

Personally 4xx / 5xx errors should be reserved for genuinely unexpected responses. For example I would expect a 404 error here if the analytics collection didn't exist. I wouldn't expect a 404 for when the purpose of this endpoint is check if events index is present. My reasoning stems from APM monitoring where this 4xx/5xx would indicate an issue but its an expected response. Hope that makes sense.

// analyticsEventsIndexExists: jest.fn(),
// }));

describe('delete analytics collection lib function', () => {
Copy link
Member

Choose a reason for hiding this comment

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

typo: incorrect test name

});

describe('FetchAnalyticsCollectionsApiLogic', () => {
it('calls the analytics collections list api', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

typo: test name incorrect

@tutelaris tutelaris force-pushed the tutelaris/introduce-empty-state-events branch from 9997aa6 to 8812b8e Compare December 12, 2022 13:14
@tutelaris tutelaris force-pushed the tutelaris/introduce-empty-state-events branch from 8812b8e to 0518d2a Compare December 12, 2022 13:22
@tutelaris tutelaris requested a review from joemcelroy December 12, 2022 13:25
@tutelaris tutelaris enabled auto-merge (squash) December 12, 2022 16:16
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #48 / APM API tests basic no data Service group counts with alerts "before all" hook for "returns the correct number of alerts"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 1881 1883 +2

Async chunks

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

id before after diff
enterpriseSearch 2.0MB 2.0MB +2.0KB
Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 60 66 +6
osquery 109 115 +6
securitySolution 445 451 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 69 75 +6
osquery 110 117 +7
securitySolution 521 527 +6
total +21

History

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

cc @tutelaris

@tutelaris tutelaris merged commit f81c816 into elastic:main Dec 12, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:EnterpriseSearch v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants