elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.67k stars 8.23k forks source link

Custom Threshold Rule - ViewInAppUrl does not honour Kibana Space #201333

Open morashwan opened 7 hours ago

morashwan commented 7 hours ago

Kibana version: 8.15.4, 8.16

Elasticsearch version: 8.15.4, 8.16

Describe the bug: The Custom Threshold Rule provides in the action variables multiple urls to access the results and alerts. The viewInAppUrl does not add the Kibana space to the url -> User is routed to Default space, which limit any multi-space Kibana to use this feature. Other urls like alertDetailsUrl are behaving like expected with Kibana space in the url. The json below shows (skipped the irrelevant fields) the url behavior

"alertId": "c631205d-192d-471b-97f3-7012099cdac4",
"spaceId": "a0355",
"context": {
    "alertDetailsUrl": "https: //<redacted>:9243/s/a0355/app/observability/alerts/3929e860-236d-4e5c-a63b-aa693e3ac6d3",
    "viewInAppUrl": "https: //<redacted>t:9243/app/r?l=LOGS_EXPLORER_LOCATOR&v=8.15.4&lz=<redacted>",
}
}

Steps to reproduce:

  1. Create a new Kibana Space
  2. Create Custom Threshold Rule in the new space
  3. Create a rule with email action and output the {{context.viewInAppUrl}}
  4. Url routes to Default space instead of the space created in

Expected behavior: Url routes to the Space where the Rule is created and not Default Space

Screenshots (if relevant):

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

Any additional context:

elasticmachine commented 7 hours ago

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

maryam-saeidi commented 6 hours ago

I checked this issue briefly, and it seems the logs explorer locator (which uses the discover locator behind the scenes) does not have the option to specify spaceId. I am checking with @elastic/kibana-data-discovery team to see how to add that option.

It is worth mentioning that spaceId is needed to be specified on the server side during rule execution. We use the same locator on the alert details page, and it works as expected (meaning it will stay in the same space when clicking on the "open in Discover" link)