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

[8.17] Fix context.pageName by fixing missing executionContext and add enableExecutionContextTracking flag (#204547) #204807

Open
wants to merge 3 commits into
base: 8.17
Choose a base branch
from

Conversation

maryam-saeidi
Copy link
Member

Backport

This will backport the following commits from main to 8.17:

Questions ?

Please refer to the Backport tool documentation

…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 <[email protected]>
Co-authored-by: Davis McPhee <[email protected]>
Co-authored-by: Marco Antonio Ghiani <[email protected]>
Co-authored-by: Elena Stoeva <[email protected]>
(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
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@maryam-saeidi
Copy link
Member Author

Tested and worked as expected:

image

@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 19, 2024

💚 Build Succeeded

  • Buildkite Build
  • Commit: f0eb0c3
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-204807-f0eb0c391a9f

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
advancedSettings 110 121 +11
aiAssistantManagementSelection 69 70 +1
aiops 628 629 +1
alerting 245 246 +1
apm 1880 1881 +1
banners 33 44 +11
canvas 1291 1292 +1
cases 822 823 +1
cloudDataMigration 22 33 +11
cloudDefend 110 111 +1
cloudLinks 78 89 +11
cloudSecurityPosture 662 663 +1
console 238 239 +1
controls 363 374 +11
core 450 451 +1
crossClusterReplication 133 134 +1
dashboard 689 690 +1
dashboardEnhanced 96 107 +11
data 523 534 +11
dataQuality 89 90 +1
dataUsage 133 134 +1
dataViewEditor 86 97 +11
dataViewFieldEditor 162 173 +11
dataViewManagement 248 249 +1
dataVisualizer 732 741 +9
devTools 43 44 +1
discover 979 980 +1
embeddable 143 154 +11
enterpriseSearch 2323 2324 +1
eventAnnotationListing 592 600 +8
exploratoryView 182 183 +1
expressionError 40 51 +11
expressionGauge 107 118 +11
expressionHeatmap 182 193 +11
expressionImage 26 37 +11
expressionLegacyMetricVis 47 58 +11
expressionMetric 24 35 +11
expressionMetricVis 115 126 +11
expressionPartitionVis 199 210 +11
expressionRepeatImage 24 35 +11
expressionRevealImage 27 38 +11
expressionShape 70 81 +11
expressionTagcloud 170 181 +11
expressionXY 260 271 +11
filesManagement 198 199 +1
fleet 1245 1246 +1
globalSearchBar 48 57 +9
graph 310 311 +1
grokdebugger 41 52 +11
guidedOnboarding 42 53 +11
home 267 268 +1
imageEmbeddable 141 152 +11
indexLifecycleManagement 262 263 +1
indexManagement 699 700 +1
infra 1532 1533 +1
ingestPipelines 358 359 +1
inputControlVis 94 105 +11
inspector 78 89 +11
integrationAssistant 468 469 +1
interactiveSetup 58 69 +11
inventory 279 280 +1
investigateApp 583 584 +1
kibanaOverview 137 138 +1
kibanaReact 214 221 +7
kibanaUtils 176 187 +11
kubernetesSecurity 202 203 +1
lens 1491 1492 +1
licenseManagement 125 126 +1
licensing 29 40 +11
links 131 142 +11
logstash 75 76 +1
management 130 131 +1
maps 1257 1258 +1
metricsDataAccess 319 330 +11
ml 2137 2138 +1
mockIdpPlugin 38 49 +11
monitoring 494 495 +1
navigation 77 88 +11
newsfeed 27 38 +11
observability 1076 1077 +1
observabilityAIAssistantApp 385 386 +1
observabilityAiAssistantManagement 361 362 +1
observabilityLogsExplorer 210 211 +1
observabilityOnboarding 263 264 +1
osquery 345 346 +1
painlessLab 45 56 +11
presentationPanel 111 122 +11
profiling 305 306 +1
remoteClusters 125 126 +1
reporting 152 163 +11
rollup 146 147 +1
runtimeFields 34 45 +11
savedObjects 36 47 +11
savedObjectsManagement 122 123 +1
savedObjectsTagging 106 117 +11
searchAssistant 253 260 +7
searchHomepage 152 153 +1
searchIndices 235 236 +1
searchInferenceEndpoints 97 98 +1
searchNotebooks 55 66 +11
searchPlayground 269 270 +1
searchprofiler 78 89 +11
security 527 528 +1
securitySolution 6198 6199 +1
serverless 78 89 +11
serverlessSearch 290 291 +1
share 94 105 +11
slo 853 854 +1
snapshotRestore 211 212 +1
spaces 338 339 +1
synthetics 1043 1044 +1
telemetry 54 65 +11
timelines 175 186 +11
transform 487 488 +1
triggersActionsUi 860 861 +1
uiActions 40 51 +11
unifiedSearch 376 385 +9
upgradeAssistant 178 179 +1
uptime 593 594 +1
ux 201 202 +1
visDefaultEditor 206 217 +11
visTypeMarkdown 32 43 +11
visTypeTable 50 61 +11
visTypeTimelion 66 77 +11
visTypeTimeseries 462 471 +9
visTypeVega 280 291 +11
visTypeVislib 126 137 +11
visualizations 491 492 +1
watcher 189 190 +1
total +730

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/shared-ux-router 13 15 +2

Async chunks

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

id before after diff
aiops 590.5KB 591.0KB +532.0B
alerting 92.5KB 92.8KB +368.0B
apm 3.5MB 3.5MB +433.0B
canvas 1.1MB 1.1MB +522.0B
cases 491.2KB 491.4KB +237.0B
cloudDataMigration 5.9KB 6.0KB +133.0B
cloudDefend 231.8KB 232.1KB +286.0B
cloudSecurityPosture 509.4KB 509.8KB +363.0B
console 206.8KB 207.0KB +237.0B
controls 459.0KB 459.1KB +134.0B
crossClusterReplication 146.2KB 146.7KB +455.0B
dashboard 649.7KB 650.0KB +245.0B
dataQuality 28.2KB 28.5KB +374.0B
dataUsage 238.1KB 238.4KB +395.0B
dataViewFieldEditor 176.9KB 176.9KB +1.0B
dataViewManagement 139.6KB 140.0KB +364.0B
dataVisualizer 613.7KB 614.3KB +665.0B
devTools 7.7KB 8.1KB +358.0B
discover 810.0KB 810.5KB +515.0B
enterpriseSearch 2.6MB 2.6MB +675.0B
eventAnnotationListing 229.5KB 229.6KB +138.0B
exploratoryView 183.0KB 183.5KB +514.0B
filesManagement 123.2KB 123.3KB +185.0B
fleet 1.8MB 1.8MB +770.0B
graph 415.8KB 416.1KB +372.0B
grokdebugger 11.0KB 11.1KB +134.0B
home 151.9KB 152.3KB +381.0B
imageEmbeddable 69.1KB 69.3KB +266.0B
indexLifecycleManagement 166.0KB 166.3KB +375.0B
indexManagement 697.8KB 698.0KB +243.0B
infra 1.7MB 1.7MB +953.0B
ingestPipelines 405.7KB 405.9KB +236.0B
inputControlVis 52.1KB 52.2KB +133.0B
integrationAssistant 879.8KB 880.1KB +284.0B
inventory 236.5KB 236.7KB +141.0B
investigateApp 483.6KB 483.9KB +316.0B
kibanaOverview 54.7KB 55.0KB +375.0B
kibanaReact 197.1KB 197.1KB +1.0B
kibanaUtils 60.8KB 60.8KB +1.0B
kubernetesSecurity 216.4KB 216.7KB +290.0B
lens 1.5MB 1.5MB +250.0B
licenseManagement 46.5KB 46.9KB +375.0B
links 52.6KB 48.2KB -4.4KB
logstash 33.4KB 33.7KB +362.0B
management 48.3KB 48.7KB +374.0B
maps 3.0MB 3.0MB +273.0B
metricsDataAccess 99.5KB 99.6KB +133.0B
ml 4.7MB 4.7MB +2.7KB
monitoring 533.4KB 533.7KB +407.0B
observability 473.2KB 473.4KB +266.0B
observabilityAIAssistantApp 239.2KB 239.2KB +3.0B
observabilityLogsExplorer 147.1KB 147.6KB +515.0B
observabilityOnboarding 282.9KB 283.3KB +374.0B
osquery 1.0MB 1.0MB +248.0B
painlessLab 18.5KB 18.7KB +138.0B
profiling 406.0KB 406.1KB +139.0B
remoteClusters 79.2KB 79.6KB +374.0B
rollup 115.5KB 115.9KB +375.0B
savedObjectsManagement 86.6KB 86.9KB +358.0B
searchAssistant 161.9KB 161.9KB +1.0B
searchHomepage 54.8KB 55.3KB +511.0B
searchIndices 168.2KB 168.9KB +715.0B
searchInferenceEndpoints 72.5KB 73.0KB +514.0B
searchPlayground 168.1KB 168.7KB +516.0B
searchprofiler 48.2KB 48.4KB +145.0B
security 540.7KB 540.7KB +7.0B
securitySolution 13.3MB 13.3MB +2.1KB
serverlessSearch 339.5KB 340.8KB +1.3KB
slo 829.7KB 843.3KB +13.6KB
snapshotRestore 262.7KB 263.1KB +419.0B
spaces 256.9KB 256.9KB +1.0B
synthetics 1.1MB 1.1MB +801.0B
timelines 32.8KB 32.9KB +133.0B
transform 473.5KB 474.0KB +519.0B
triggersActionsUi 1.7MB 1.7MB +3.1KB
unifiedSearch 355.1KB 355.1KB +2.0B
upgradeAssistant 158.4KB 158.6KB +234.0B
uptime 468.1KB 468.6KB +520.0B
ux 168.0KB 168.1KB +173.0B
visTypeTimeseries 507.0KB 507.0KB +4.0B
visTypeVega 1.9MB 1.9MB +2.0B
visualizations 318.3KB 318.5KB +241.0B
watcher 166.2KB 166.6KB +381.0B
total +42.0KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/shared-ux-router 0 2 +2

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
advancedSettings 7.4KB 7.5KB +133.0B
banners 10.4KB 10.5KB +133.0B
cases 159.5KB 159.8KB +280.0B
cloudLinks 30.2KB 30.3KB +139.0B
console 38.4KB 38.6KB +279.0B
core 454.1KB 454.4KB +363.0B
dashboard 51.8KB 52.1KB +279.0B
dashboardEnhanced 17.9KB 18.0KB +138.0B
data 419.9KB 420.1KB +134.0B
dataViewEditor 13.5KB 13.7KB +133.0B
dataViewFieldEditor 26.8KB 26.9KB +134.0B
embeddable 72.1KB 72.2KB +133.0B
expressionGauge 16.3KB 16.4KB +133.0B
expressionHeatmap 17.2KB 17.3KB +133.0B
expressionLegacyMetricVis 12.5KB 12.6KB +133.0B
expressionMetricVis 16.9KB 17.0KB +133.0B
expressionPartitionVis 29.1KB 29.3KB +133.0B
expressionTagcloud 13.2KB 13.3KB +133.0B
expressionXY 42.0KB 42.1KB +138.0B
fleet 173.7KB 174.0KB +280.0B
globalSearchBar 29.8KB 30.0KB +133.0B
guidedOnboarding 29.6KB 29.7KB +137.0B
indexManagement 46.7KB 46.9KB +279.0B
ingestPipelines 17.5KB 17.8KB +279.0B
inspector 24.9KB 25.1KB +133.0B
interactiveSetup 59.6KB 59.7KB +140.0B
kibanaReact 39.4KB 39.5KB +139.0B
lens 50.8KB 51.1KB +279.0B
licensing 11.7KB 11.8KB +133.0B
links 16.8KB 16.8KB +14.0B
maps 54.4KB 54.6KB +280.0B
mockIdpPlugin 10.6KB 10.8KB +133.0B
navigation 17.9KB 17.9KB +3.0B
newsfeed 12.7KB 12.8KB +133.0B
observability 104.1KB 104.4KB +280.0B
osquery 46.9KB 47.2KB +279.0B
presentationPanel 43.3KB 43.4KB +133.0B
reporting 52.7KB 52.8KB +133.0B
runtimeFields 13.9KB 14.0KB +133.0B
savedObjects 17.6KB 17.7KB +133.0B
savedObjectsTagging 22.6KB 22.7KB +133.0B
searchPlayground 7.2KB 7.2KB +1.0B
security 67.8KB 68.5KB +656.0B
serverless 14.1KB 14.3KB +133.0B
share 58.1KB 58.3KB +134.0B
slo 28.8KB 28.8KB +7.0B
spaces 34.0KB 34.5KB +512.0B
telemetry 24.8KB 24.9KB +133.0B
uiActions 23.9KB 24.1KB +138.0B
unifiedSearch 38.6KB 38.7KB +133.0B
upgradeAssistant 24.6KB 24.8KB +279.0B
visDefaultEditor 24.0KB 24.1KB +133.0B
visTypeMarkdown 9.7KB 9.8KB +133.0B
visTypeTable 19.2KB 19.3KB +133.0B
visTypeTimelion 13.4KB 13.6KB +133.0B
visTypeTimeseries 20.4KB 20.6KB +134.0B
visTypeVega 36.1KB 36.2KB +138.0B
visTypeVislib 15.3KB 15.5KB +133.0B
visualizations 70.9KB 71.2KB +279.0B
total +10.0KB
Unknown metric groups

API count

id before after diff
@kbn/react-kibana-context-root 10 11 +1
@kbn/shared-ux-router 14 16 +2
total +3

async chunk count

id before after diff
slo 30 31 +1

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport ci:project-deploy-observability Create an Observability project Team:obs-ux-management Observability Management User Experience Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants