-
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
[RAM] Allow users to see event logs from all spaces they have access to #140449
Conversation
…itch # Conflicts: # x-pack/plugins/alerting/common/execution_log_types.ts # x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts # x-pack/plugins/alerting/server/rules_client/rules_client.ts
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.
Looks good overall! I left some comments and it would be great to add some UI tests for this, especially for the spaces routing on click and the spaces switch.
@@ -398,6 +398,7 @@ export interface GetGlobalExecutionKPIParams { | |||
dateStart: string; | |||
dateEnd?: string; | |||
filter?: string; | |||
namespaces?: Array<string | undefined>; |
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.
Is it possible to make this type a bit stricter? (I.e. just Array<string>
). I see that getNameSpace
could return undefined, could we filter those entries out or do they have some significance being undefined?
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.
The Default namespace is referred to as undefined
internally. As far as I can tell, this changed recently; it used to just be the string default
.
...ugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.ts
Outdated
Show resolved
Hide resolved
..._actions_ui/public/application/sections/rule_details/components/rule_event_log_data_grid.tsx
Outdated
Show resolved
Hide resolved
...ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.tsx
Outdated
Show resolved
Hide resolved
...actions_ui/public/application/sections/rule_details/components/rule_event_log_list_table.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/use_spaces_data.tsx
Show resolved
Hide resolved
Just pushed a fix for accessing action error logs from alternate spaces |
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've tested the fix for the error logs, seems to work as expected. I just had some small comments
@@ -389,6 +401,50 @@ export class ClusterClientAdapter<TDoc extends { body: AliasAny; index: string } | |||
} | |||
} | |||
|
|||
public async queryEventsWithAuthFilter( |
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'm wondering if we should reduce some of the code duplication between this and queryEventsBySavedObjects
, or maybe we can modify queryEventsBySavedObjects
to support the new auth filters? Curious to hear your thoughts
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 don't want to modify the existing queryEventsBySavedObjects
functionality too much, I'm not sure if it'll modify expected error behaviors in unpredictable places.
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI 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: |
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!
* main: (43 commits) [Synthetics] Step details page screenshot (elastic#143452) [Lens] Datatable expression types improvement. (elastic#144173) [packages/kbn-journeys] start apm after browser start and stop after browser is closed (elastic#144267) [Files] Make files namespace agnostic (elastic#144019) Implement base browser-side logging system (elastic#144107) Correct wrong multiplier for byte conversion (elastic#143751) [Monaco] Add JSON syntax support to the Monaco editor (elastic#143739) CCS Smoke Test for Remote Clusters and Index Management (elastic#142423) [api-docs] Daily api_docs build (elastic#144294) chore(NA): include progress on Bazel tasks (elastic#144275) [RAM] Allow users to see event logs from all spaces they have access to (elastic#140449) [APM] Show recommended minimum size when going below 5 minutes (elastic#144170) [typecheck] delete temporary target_types dirs in packages (elastic#144271) [Security Solution][Endpoint] adds new alert loading utility and un-skip FTR test for endpoint (elastic#144133) [performance/journeys] revert data_stress_test_lens.ts journey step (elastic#144261) [TIP] Use search strategies in Threat Intelligence (elastic#143267) Optimize react-query dependencies (elastic#144206) [babel/node] invalidate cache when synth pkg map is updated (elastic#144258) [APM] AWS lambda estimated cost (elastic#143986) [Maps] layer group wizard (elastic#144129) ...
Summary
Closes #137995

Adds a property called
namespaces
to theglobal_execution_logs
API. This is an array of Space IDs to fetch logs for.In the global Logs tab, a switch will be enabled if the current user has access to multiple spaces. It will be disabled if the current user can only access one space. When this switch is toggled, it will send all accessible
namespaces
to the logs API.Clicking a link to a rule on a different space will switch the user to that space in a new tab.
Checklist