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

Fix context.pageName by fixing missing executionContext and add enableExecutionContextTracking flag #204547

Merged

Conversation

maryam-saeidi
Copy link
Member

@maryam-saeidi maryam-saeidi commented Dec 17, 2024

Resolves #195778

🐞 Summary

This PR fixes missing executionContext in sharedux router by adding SharedUXContext to the KibanaRootContextProvider (inside of the KibanaRenderContextProvider). (More context provided in this #195778 (comment))

It also introduces enableExecutionContextTracking to enable tracking logic to avoid creating a race condition for the existing custom execution context tracking implementations.

I enabled this flag for the observability plugin and here is the difference:

Item Screenshot
Before image
After image

🧪 How to test

  • Go to the observability alerts page and check the kibana-browser request as shown above

✨ Possible future improvements

Allowing this logic to be provided by the consumer so that we can get rid of custom implementations (Example: APM custom execution context)

@maryam-saeidi maryam-saeidi added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) labels Dec 17, 2024
@maryam-saeidi maryam-saeidi self-assigned this Dec 17, 2024
@maryam-saeidi maryam-saeidi requested review from a team as code owners December 17, 2024 11:16
@botelastic botelastic bot added the Team:obs-ux-management Observability Management User Experience Team label Dec 17, 2024
@elasticmachine
Copy link
Contributor

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

@maryam-saeidi maryam-saeidi deleted the 195778-fix-pageName-second-try branch December 18, 2024 16:29
@maryam-saeidi maryam-saeidi added the backport:version Backport to applied version labels label Dec 18, 2024
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.x

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

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.17 Backport failed because of merge conflicts
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [Security Solution][SIEM migrations] Onboarding UI improvements (#204320)

Manual backport

To create the backport manually run:

node scripts/backport --pr 204547

Questions ?

Please refer to the Backport tool documentation

maryam-saeidi added a commit to maryam-saeidi/kibana that referenced this pull request Dec 18, 2024
…eExecutionContextTracking flag (elastic#204547)

Resolves elastic#195778

## 🐞 Summary
This PR fixes missing executionContext in sharedux router by adding
`SharedUXContext` to the `KibanaRootContextProvider` (inside of the
`KibanaRenderContextProvider`). (More context provided in this
elastic#195778 (comment))

It also introduces `enableExecutionContextTracking` to enable tracking
logic to avoid creating a race condition for the existing custom
execution context tracking implementations.

I enabled this flag for the observability plugin and here is the
difference:

|Item|Screenshot|
|---|---|

|Before|![image](https://github.com/user-attachments/assets/83283d23-3347-45be-95c1-120cdfabb9c5)|

|After|![image](https://github.com/user-attachments/assets/9de51645-6bf1-4537-baeb-6878e7bb3590)|

### 🧪 How to test
- Go to the observability alerts page and check the kibana-browser
request as shown above

### ✨ Possible future improvements

Allowing this logic to be provided by the consumer so that we can get
rid of custom implementations (Example: [APM custom execution
context](https://github.com/elastic/kibana/blob/e9671937bacfaa911d32de0e8885e7f26425888a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/update_execution_context_on_route_change.ts#L21,L25))

---------

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: Elena Stoeva <elenastoeva99@gmail.com>
(cherry picked from commit 53748fd)

# Conflicts:
#	packages/react/kibana_context/render/render_provider.tsx
#	packages/react/kibana_context/root/BUILD.bazel
#	packages/react/kibana_context/root/root_provider.test.tsx
#	packages/react/kibana_context/root/root_provider.tsx
#	packages/react/kibana_context/root/tsconfig.json
@maryam-saeidi
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.17

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

Questions ?

Please refer to the Backport tool documentation

maryam-saeidi added a commit that referenced this pull request Dec 19, 2024
… enableExecutionContextTracking flag (#204547) (#204798)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Fix context.pageName by fixing missing executionContext and add
enableExecutionContextTracking flag
(#204547)](#204547)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Maryam
Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2024-12-18T12:59:23Z","message":"Fix
context.pageName by fixing missing executionContext and add
enableExecutionContextTracking flag (#204547)\n\nResolves
https://github.com/elastic/kibana/issues/195778\r\n\r\n## 🐞
Summary\r\nThis PR fixes missing executionContext in sharedux router by
adding\r\n`SharedUXContext` to the `KibanaRootContextProvider` (inside
of the\r\n`KibanaRenderContextProvider`). (More context provided in
this\r\nhttps://github.com//issues/195778#issuecomment-2426936142)\r\n\r\nIt
also introduces `enableExecutionContextTracking` to enable
tracking\r\nlogic to avoid creating a race condition for the existing
custom\r\nexecution context tracking implementations.\r\n\r\nI enabled
this flag for the observability plugin and here is
the\r\ndifference:\r\n\r\n|Item|Screenshot|\r\n|---|---|\r\n\r\n|Before|![image](https://github.com/user-attachments/assets/83283d23-3347-45be-95c1-120cdfabb9c5)|\r\n\r\n|After|![image](https://github.com/user-attachments/assets/9de51645-6bf1-4537-baeb-6878e7bb3590)|\r\n\r\n###
🧪 How to test\r\n- Go to the observability alerts page and check the
kibana-browser\r\nrequest as shown above\r\n\r\n### ✨ Possible future
improvements\r\n\r\nAllowing this logic to be provided by the consumer
so that we can get\r\nrid of custom implementations (Example: [APM
custom
execution\r\ncontext](https://github.com/elastic/kibana/blob/e9671937bacfaa911d32de0e8885e7f26425888a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/update_execution_context_on_route_change.ts#L21,L25))\r\n\r\n---------\r\n\r\nCo-authored-by:
Anton Dosov <anton.dosov@elastic.co>\r\nCo-authored-by: Davis McPhee
<davis.mcphee@elastic.co>\r\nCo-authored-by: Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>\r\nCo-authored-by: Elena Stoeva
<elenastoeva99@gmail.com>","sha":"53748fdefa1d59d58a4708258a1476dc140b1588","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:obs-ux-management"],"number":204547,"url":"https://github.com/elastic/kibana/pull/204547","mergeCommit":{"message":"Fix
context.pageName by fixing missing executionContext and add
enableExecutionContextTracking flag (#204547)\n\nResolves
https://github.com/elastic/kibana/issues/195778\r\n\r\n## 🐞
Summary\r\nThis PR fixes missing executionContext in sharedux router by
adding\r\n`SharedUXContext` to the `KibanaRootContextProvider` (inside
of the\r\n`KibanaRenderContextProvider`). (More context provided in
this\r\nhttps://github.com//issues/195778#issuecomment-2426936142)\r\n\r\nIt
also introduces `enableExecutionContextTracking` to enable
tracking\r\nlogic to avoid creating a race condition for the existing
custom\r\nexecution context tracking implementations.\r\n\r\nI enabled
this flag for the observability plugin and here is
the\r\ndifference:\r\n\r\n|Item|Screenshot|\r\n|---|---|\r\n\r\n|Before|![image](https://github.com/user-attachments/assets/83283d23-3347-45be-95c1-120cdfabb9c5)|\r\n\r\n|After|![image](https://github.com/user-attachments/assets/9de51645-6bf1-4537-baeb-6878e7bb3590)|\r\n\r\n###
🧪 How to test\r\n- Go to the observability alerts page and check the
kibana-browser\r\nrequest as shown above\r\n\r\n### ✨ Possible future
improvements\r\n\r\nAllowing this logic to be provided by the consumer
so that we can get\r\nrid of custom implementations (Example: [APM
custom
execution\r\ncontext](https://github.com/elastic/kibana/blob/e9671937bacfaa911d32de0e8885e7f26425888a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/update_execution_context_on_route_change.ts#L21,L25))\r\n\r\n---------\r\n\r\nCo-authored-by:
Anton Dosov <anton.dosov@elastic.co>\r\nCo-authored-by: Davis McPhee
<davis.mcphee@elastic.co>\r\nCo-authored-by: Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>\r\nCo-authored-by: Elena Stoeva
<elenastoeva99@gmail.com>","sha":"53748fdefa1d59d58a4708258a1476dc140b1588"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204547","number":204547,"mergeCommit":{"message":"Fix
context.pageName by fixing missing executionContext and add
enableExecutionContextTracking flag (#204547)\n\nResolves
https://github.com/elastic/kibana/issues/195778\r\n\r\n## 🐞
Summary\r\nThis PR fixes missing executionContext in sharedux router by
adding\r\n`SharedUXContext` to the `KibanaRootContextProvider` (inside
of the\r\n`KibanaRenderContextProvider`). (More context provided in
this\r\nhttps://github.com//issues/195778#issuecomment-2426936142)\r\n\r\nIt
also introduces `enableExecutionContextTracking` to enable
tracking\r\nlogic to avoid creating a race condition for the existing
custom\r\nexecution context tracking implementations.\r\n\r\nI enabled
this flag for the observability plugin and here is
the\r\ndifference:\r\n\r\n|Item|Screenshot|\r\n|---|---|\r\n\r\n|Before|![image](https://github.com/user-attachments/assets/83283d23-3347-45be-95c1-120cdfabb9c5)|\r\n\r\n|After|![image](https://github.com/user-attachments/assets/9de51645-6bf1-4537-baeb-6878e7bb3590)|\r\n\r\n###
🧪 How to test\r\n- Go to the observability alerts page and check the
kibana-browser\r\nrequest as shown above\r\n\r\n### ✨ Possible future
improvements\r\n\r\nAllowing this logic to be provided by the consumer
so that we can get\r\nrid of custom implementations (Example: [APM
custom
execution\r\ncontext](https://github.com/elastic/kibana/blob/e9671937bacfaa911d32de0e8885e7f26425888a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/update_execution_context_on_route_change.ts#L21,L25))\r\n\r\n---------\r\n\r\nCo-authored-by:
Anton Dosov <anton.dosov@elastic.co>\r\nCo-authored-by: Davis McPhee
<davis.mcphee@elastic.co>\r\nCo-authored-by: Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>\r\nCo-authored-by: Elena Stoeva
<elenastoeva99@gmail.com>","sha":"53748fdefa1d59d58a4708258a1476dc140b1588"}}]}]
BACKPORT-->
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Dec 19, 2024
…eExecutionContextTracking flag (elastic#204547)

Resolves elastic#195778

## 🐞 Summary
This PR fixes missing executionContext in sharedux router by adding
`SharedUXContext` to the `KibanaRootContextProvider` (inside of the
`KibanaRenderContextProvider`). (More context provided in this
elastic#195778 (comment))

It also introduces `enableExecutionContextTracking` to enable tracking
logic to avoid creating a race condition for the existing custom
execution context tracking implementations.

I enabled this flag for the observability plugin and here is the
difference:

|Item|Screenshot|
|---|---|

|Before|![image](https://github.com/user-attachments/assets/83283d23-3347-45be-95c1-120cdfabb9c5)|

|After|![image](https://github.com/user-attachments/assets/9de51645-6bf1-4537-baeb-6878e7bb3590)|

### 🧪 How to test
- Go to the observability alerts page and check the kibana-browser
request as shown above

### ✨ Possible future improvements

Allowing this logic to be provided by the consumer so that we can get
rid of custom implementations (Example: [APM custom execution
context](https://github.com/elastic/kibana/blob/e9671937bacfaa911d32de0e8885e7f26425888a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/update_execution_context_on_route_change.ts#L21,L25))

---------

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: Elena Stoeva <elenastoeva99@gmail.com>
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Dec 20, 2024
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

5 similar comments
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Dec 31, 2024
benakansara pushed a commit to benakansara/kibana that referenced this pull request Jan 2, 2025
…eExecutionContextTracking flag (elastic#204547)

Resolves elastic#195778

## 🐞 Summary
This PR fixes missing executionContext in sharedux router by adding
`SharedUXContext` to the `KibanaRootContextProvider` (inside of the
`KibanaRenderContextProvider`). (More context provided in this
elastic#195778 (comment))

It also introduces `enableExecutionContextTracking` to enable tracking
logic to avoid creating a race condition for the existing custom
execution context tracking implementations.

I enabled this flag for the observability plugin and here is the
difference:

|Item|Screenshot|
|---|---|

|Before|![image](https://github.com/user-attachments/assets/83283d23-3347-45be-95c1-120cdfabb9c5)|

|After|![image](https://github.com/user-attachments/assets/9de51645-6bf1-4537-baeb-6878e7bb3590)|

### 🧪 How to test
- Go to the observability alerts page and check the kibana-browser
request as shown above

### ✨ Possible future improvements

Allowing this logic to be provided by the consumer so that we can get
rid of custom implementations (Example: [APM custom execution
context](https://github.com/elastic/kibana/blob/e9671937bacfaa911d32de0e8885e7f26425888a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/update_execution_context_on_route_change.ts#L21,L25))

---------

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: Elena Stoeva <elenastoeva99@gmail.com>
kibanamachine added a commit that referenced this pull request Jan 3, 2025
… plugins (#204939) (#205474)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Enable execution context tracking for SLO, infra and synthetics
plugins (#204939)](#204939)

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

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

<!--BACKPORT [{"author":{"name":"Maryam
Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2025-01-03T08:45:21Z","message":"Enable
execution context tracking for SLO, infra and synthetics plugins
(#204939)\n\n## Summary\r\n\r\nThis PR enables default execution context
tracking (which was added in\r\nthis
[PR](#204547)) for
the\r\nfollowing plugins:\r\n\r\n- SLO\r\n- Infra\r\n-
Synthetics\r\n\r\n|Plugin|Before|After|\r\n|---|---|---|\r\n\r\n|SLO|![image](https://github.com/user-attachments/assets/3f3e4dac-a1e7-4fbd-be6b-ea885c89ad88)|![image](https://github.com/user-attachments/assets/ae76d68d-2970-4aaf-816a-05c161b1e4fe)|\r\n\r\n|Synthetics|![image](https://github.com/user-attachments/assets/9e6d5bda-1fd0-48e4-a5d8-5f2b0e35cf54)|![image](https://github.com/user-attachments/assets/a016cc78-121a-4381-8786-9ef96f20c028)|\r\n|Infra
>\r\nInventory|![image](https://github.com/user-attachments/assets/9186d9ba-5789-42dc-9f5c-e06d3e5c1598)|![image](https://github.com/user-attachments/assets/d4da56b8-581c-4be1-bd33-8a62b602392e)|\r\n|Infra
>\r\nHosts|![image](https://github.com/user-attachments/assets/18a982cb-fedf-4193-b402-8bf2ef8d7052)|![image](https://github.com/user-attachments/assets/4138f985-bf3e-477a-ba71-d6f0e3483ef8)|","sha":"2e9201855392894ff3de5c765c263ac69d1214d0","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management"],"title":"Enable
execution context tracking for SLO, infra and synthetics
plugins","number":204939,"url":"https://github.com/elastic/kibana/pull/204939","mergeCommit":{"message":"Enable
execution context tracking for SLO, infra and synthetics plugins
(#204939)\n\n## Summary\r\n\r\nThis PR enables default execution context
tracking (which was added in\r\nthis
[PR](#204547)) for
the\r\nfollowing plugins:\r\n\r\n- SLO\r\n- Infra\r\n-
Synthetics\r\n\r\n|Plugin|Before|After|\r\n|---|---|---|\r\n\r\n|SLO|![image](https://github.com/user-attachments/assets/3f3e4dac-a1e7-4fbd-be6b-ea885c89ad88)|![image](https://github.com/user-attachments/assets/ae76d68d-2970-4aaf-816a-05c161b1e4fe)|\r\n\r\n|Synthetics|![image](https://github.com/user-attachments/assets/9e6d5bda-1fd0-48e4-a5d8-5f2b0e35cf54)|![image](https://github.com/user-attachments/assets/a016cc78-121a-4381-8786-9ef96f20c028)|\r\n|Infra
>\r\nInventory|![image](https://github.com/user-attachments/assets/9186d9ba-5789-42dc-9f5c-e06d3e5c1598)|![image](https://github.com/user-attachments/assets/d4da56b8-581c-4be1-bd33-8a62b602392e)|\r\n|Infra
>\r\nHosts|![image](https://github.com/user-attachments/assets/18a982cb-fedf-4193-b402-8bf2ef8d7052)|![image](https://github.com/user-attachments/assets/4138f985-bf3e-477a-ba71-d6f0e3483ef8)|","sha":"2e9201855392894ff3de5c765c263ac69d1214d0"}},"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/204939","number":204939,"mergeCommit":{"message":"Enable
execution context tracking for SLO, infra and synthetics plugins
(#204939)\n\n## Summary\r\n\r\nThis PR enables default execution context
tracking (which was added in\r\nthis
[PR](#204547)) for
the\r\nfollowing plugins:\r\n\r\n- SLO\r\n- Infra\r\n-
Synthetics\r\n\r\n|Plugin|Before|After|\r\n|---|---|---|\r\n\r\n|SLO|![image](https://github.com/user-attachments/assets/3f3e4dac-a1e7-4fbd-be6b-ea885c89ad88)|![image](https://github.com/user-attachments/assets/ae76d68d-2970-4aaf-816a-05c161b1e4fe)|\r\n\r\n|Synthetics|![image](https://github.com/user-attachments/assets/9e6d5bda-1fd0-48e4-a5d8-5f2b0e35cf54)|![image](https://github.com/user-attachments/assets/a016cc78-121a-4381-8786-9ef96f20c028)|\r\n|Infra
>\r\nInventory|![image](https://github.com/user-attachments/assets/9186d9ba-5789-42dc-9f5c-e06d3e5c1598)|![image](https://github.com/user-attachments/assets/d4da56b8-581c-4be1-bd33-8a62b602392e)|\r\n|Infra
>\r\nHosts|![image](https://github.com/user-attachments/assets/18a982cb-fedf-4193-b402-8bf2ef8d7052)|![image](https://github.com/user-attachments/assets/4138f985-bf3e-477a-ba71-d6f0e3483ef8)|","sha":"2e9201855392894ff3de5c765c263ac69d1214d0"}}]}]
BACKPORT-->

Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Jan 13, 2025
…eExecutionContextTracking flag (elastic#204547)

Resolves elastic#195778

## 🐞 Summary
This PR fixes missing executionContext in sharedux router by adding
`SharedUXContext` to the `KibanaRootContextProvider` (inside of the
`KibanaRenderContextProvider`). (More context provided in this
elastic#195778 (comment))

It also introduces `enableExecutionContextTracking` to enable tracking
logic to avoid creating a race condition for the existing custom
execution context tracking implementations.

I enabled this flag for the observability plugin and here is the
difference:

|Item|Screenshot|
|---|---|

|Before|![image](https://github.com/user-attachments/assets/83283d23-3347-45be-95c1-120cdfabb9c5)|

|After|![image](https://github.com/user-attachments/assets/9de51645-6bf1-4537-baeb-6878e7bb3590)|

### 🧪 How to test
- Go to the observability alerts page and check the kibana-browser
request as shown above

### ✨ Possible future improvements

Allowing this logic to be provided by the consumer so that we can get
rid of custom implementations (Example: [APM custom execution
context](https://github.com/elastic/kibana/blob/e9671937bacfaa911d32de0e8885e7f26425888a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/update_execution_context_on_route_change.ts#L21,L25))

---------

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: Elena Stoeva <elenastoeva99@gmail.com>
viduni94 pushed a commit to viduni94/kibana that referenced this pull request Jan 23, 2025
…eExecutionContextTracking flag (elastic#204547)

Resolves elastic#195778

## 🐞 Summary
This PR fixes missing executionContext in sharedux router by adding
`SharedUXContext` to the `KibanaRootContextProvider` (inside of the
`KibanaRenderContextProvider`). (More context provided in this
elastic#195778 (comment))

It also introduces `enableExecutionContextTracking` to enable tracking
logic to avoid creating a race condition for the existing custom
execution context tracking implementations.

I enabled this flag for the observability plugin and here is the
difference:

|Item|Screenshot|
|---|---|

|Before|![image](https://github.com/user-attachments/assets/83283d23-3347-45be-95c1-120cdfabb9c5)|

|After|![image](https://github.com/user-attachments/assets/9de51645-6bf1-4537-baeb-6878e7bb3590)|

### 🧪 How to test
- Go to the observability alerts page and check the kibana-browser
request as shown above

### ✨ Possible future improvements

Allowing this logic to be provided by the consumer so that we can get
rid of custom implementations (Example: [APM custom execution
context](https://github.com/elastic/kibana/blob/e9671937bacfaa911d32de0e8885e7f26425888a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/update_execution_context_on_route_change.ts#L21,L25))

---------

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: Elena Stoeva <elenastoeva99@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Execution context remains the same on every route change
7 participants