-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ResponseOps][OnWeek] Connector logs view #148291
[ResponseOps][OnWeek] Connector logs view #148291
Conversation
…kibana into on-week/connectors-event-logs
…kibana into on-week/connectors-event-logs
Pinging @elastic/response-ops (Team:ResponseOps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial code review of server code. It's looking good but I think we could simplify the aggregations for this.
x-pack/plugins/actions/server/lib/create_action_event_log_record_object.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Ying Mao <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
finished the server-side review of this PR
x-pack/plugins/actions/server/lib/get_execution_log_aggregation.ts
Outdated
Show resolved
Hide resolved
…kibana into on-week/connectors-event-logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and I think we can remove that "Filter out execution UUID buckets where actionExecution doc count is 0" bit, if we don't really need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that preconfigured connector logs only show up in the default space. I think since preconfigured connectors are available in all spaces, the logs for them should show up in all spaces automatically, WDYT?
x-pack/plugins/actions/server/lib/create_action_event_log_record_object.ts
Show resolved
Hide resolved
I created a user with |
Resolved in this commit 5104f14 |
Resolved in this commit cb9821b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks great and works as expected!
x-pack/plugins/triggers_actions_ui/public/application/constants/index.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Noted one expression that might be able to be simplified, but also needs another ?.
optional property operator.
x-pack/plugins/actions/server/lib/get_execution_log_aggregation.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! !!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this locally, seems to work as expected. I just have a few comments
[search, setSearchText] | ||
); | ||
|
||
const onShowAllSpacesChange = useCallback(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice if we didn't duplicate this logic as much, maybe a hook to encapsulate some of this space logic? (i.e. useMultipleSpaces
returning onShowAllSpacesChange
and canAccessMultipleSpaces
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved in this commit b9debef
} | ||
}, [setShowFromAllSpaces, showFromAllSpaces, visibleColumns]); | ||
|
||
const columns: EuiDataGridColumn[] = useMemo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also did we want to have the connectors clickable? I think it might be helpful in the cross-space scenario to navigate the user to the corresponding connector page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that is a good idea! I am wondering if this maybe could be a follow on issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we want to make the connector name the first column like how we have it for global rule event logs?
I don't think so, UX asked for this column order.
@@ -0,0 +1,616 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a unit test for this? This seems like the main component of this feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved in this commit 38e4176
|
||
import React from 'react'; | ||
import { act } from 'react-dom/test-utils'; | ||
import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this was written following existing patterns but for mounting react components, we are moving away from enzyme, in favour of testing-library/react, you don't have to change this test (unless you really want to haha) but just a FYI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh okay, thanks for letting me know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I just have 1 more comment. Feel free to merge after addressing it
() => (showFromAllSpaces && spacesData ? accessibleSpaceIds : undefined), | ||
[showFromAllSpaces, spacesData, accessibleSpaceIds] | ||
); | ||
const { onShowAllSpacesChange, canAccessMultipleSpaces, namespaces } = useMultipleSpaces({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's move the useSpacesData
call above into the hook since it's not being used anywhere else, same with actions_connectors
event log table. We won't have to pass in spacesData
into the hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved in this commit b7c1703
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Resolves #147795
Summary
Adds a connectors event log tab that gives the ability to see historical activity of connectors.
Checklist
Delete any items that are not applicable to this PR.
To verify