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.x] Fix context.pageName by fixing missing executionContext and add enableExecutionContextTracking flag (#204547) #204798

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

maryam-saeidi
Copy link
Member

Backport

This will backport the following commits from main to 8.x:

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 <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/root/BUILD.bazel
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #32 / InfraOps App Metrics UI Node Details #Asset Type: host Processes Tab should render processes tab and with Total Value summary
  • [job] [logs] FTR Configs #56 / Rules Management - Prebuilt Rules - Prebuilt Rules Management @ess @serverless @skipInServerlessMKI install_prebuilt_rules_from_real_package should install prebuilt rules from the package storage

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
advancedSettings 110 121 +11
aiAssistantManagementSelection 75 76 +1
aiops 625 632 +7
alerting 242 243 +1
apm 1932 1933 +1
assetInventory 16 17 +1
banners 33 44 +11
canvas 1292 1293 +1
cases 826 827 +1
cloudDataMigration 22 33 +11
cloudDefend 110 111 +1
cloudLinks 78 89 +11
cloudSecurityPosture 660 661 +1
console 238 239 +1
controls 364 375 +11
core 437 438 +1
crossClusterReplication 133 134 +1
dashboard 688 689 +1
dashboardEnhanced 97 108 +11
data 523 534 +11
dataQuality 90 91 +1
dataUsage 142 143 +1
dataViewEditor 86 97 +11
dataViewFieldEditor 162 173 +11
dataViewManagement 248 249 +1
dataVisualizer 735 742 +7
devTools 43 44 +1
discover 984 985 +1
embeddable 132 143 +11
enterpriseSearch 2335 2336 +1
entityManagerApp 47 48 +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 1255 1256 +1
globalSearchBar 48 57 +9
graph 310 311 +1
grokdebugger 41 52 +11
guidedOnboarding 42 53 +11
home 267 268 +1
imageEmbeddable 142 153 +11
indexLifecycleManagement 262 263 +1
indexManagement 696 697 +1
infra 1531 1532 +1
ingestPipelines 358 359 +1
inputControlVis 95 106 +11
inspector 78 89 +11
integrationAssistant 474 475 +1
interactiveSetup 58 69 +11
inventory 257 258 +1
investigateApp 601 602 +1
kibanaOverview 137 138 +1
kibanaReact 214 221 +7
kibanaUtils 176 187 +11
kubernetesSecurity 202 203 +1
lens 1518 1519 +1
licenseManagement 125 126 +1
licensing 29 40 +11
links 132 143 +11
logstash 75 76 +1
management 130 131 +1
maps 1259 1260 +1
metricsDataAccess 319 330 +11
ml 2129 2130 +1
mockIdpPlugin 38 49 +11
monitoring 495 496 +1
navigation 77 88 +11
newsfeed 27 38 +11
observability 1074 1075 +1
observabilityAIAssistantApp 427 428 +1
observabilityAiAssistantManagement 367 368 +1
observabilityLogsExplorer 211 212 +1
observabilityOnboarding 264 265 +1
osquery 345 346 +1
painlessLab 45 56 +11
presentationPanel 112 123 +11
profiling 312 313 +1
remoteClusters 125 126 +1
reporting 153 164 +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 161 162 +1
searchNotebooks 55 66 +11
searchPlayground 269 270 +1
searchprofiler 79 90 +11
security 527 528 +1
securitySolution 6401 6402 +1
serverless 78 89 +11
serverlessSearch 290 291 +1
share 94 105 +11
slo 862 863 +1
snapshotRestore 211 212 +1
spaces 338 339 +1
streamsApp 167 168 +1
synthetics 1042 1043 +1
telemetry 54 65 +11
timelines 175 186 +11
transform 488 489 +1
triggersActionsUi 866 867 +1
uiActions 40 51 +11
unifiedSearch 376 385 +9
upgradeAssistant 169 170 +1
uptime 594 595 +1
ux 208 209 +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 +737

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 621.6KB 622.3KB +648.0B
alerting 98.6KB 99.0KB +397.0B
apm 3.5MB 3.5MB +453.0B
canvas 1.1MB 1.1MB +551.0B
cases 491.2KB 491.4KB +235.0B
cloudDataMigration 6.1KB 6.3KB +162.0B
cloudDefend 231.9KB 232.1KB +286.0B
cloudSecurityPosture 502.9KB 503.3KB +392.0B
console 206.9KB 207.2KB +237.0B
controls 460.0KB 460.1KB +163.0B
crossClusterReplication 146.5KB 147.0KB +484.0B
dashboard 632.7KB 632.9KB +249.0B
dataQuality 28.5KB 28.9KB +403.0B
dataUsage 243.0KB 243.4KB +424.0B
dataViewFieldEditor 178.3KB 178.3KB +1.0B
dataViewManagement 140.0KB 140.4KB +393.0B
dataVisualizer 614.8KB 615.6KB +810.0B
devTools 8.0KB 8.4KB +387.0B
discover 813.8KB 814.3KB +544.0B
enterpriseSearch 2.6MB 2.6MB +666.0B
entityManagerApp 12.5KB 12.7KB +166.0B
eventAnnotationListing 231.7KB 231.9KB +167.0B
exploratoryView 182.9KB 183.5KB +543.0B
filesManagement 125.5KB 125.7KB +214.0B
fleet 1.9MB 1.9MB +770.0B
graph 418.0KB 418.4KB +401.0B
grokdebugger 11.2KB 11.3KB +163.0B
home 152.2KB 152.6KB +410.0B
imageEmbeddable 69.5KB 69.9KB +324.0B
indexLifecycleManagement 166.1KB 166.5KB +404.0B
indexManagement 698.2KB 698.4KB +241.0B
infra 1.7MB 1.7MB +1011.0B
ingestPipelines 406.7KB 407.0KB +236.0B
inputControlVis 52.3KB 52.5KB +162.0B
integrationAssistant 880.5KB 880.8KB +284.0B
inventory 234.1KB 234.3KB +170.0B
investigateApp 484.3KB 484.6KB +318.0B
kibanaOverview 54.9KB 55.3KB +404.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 +557.0B
licenseManagement 46.8KB 47.2KB +404.0B
links 53.0KB 48.5KB -4.5KB
logstash 33.6KB 34.0KB +391.0B
management 48.5KB 48.9KB +403.0B
maps 3.0MB 3.0MB +273.0B
metricsDataAccess 99.7KB 99.9KB +162.0B
ml 4.7MB 4.7MB +3.0KB
monitoring 533.6KB 534.0KB +436.0B
observability 481.5KB 481.7KB +266.0B
observabilityAIAssistantApp 294.2KB 294.2KB +2.0B
observabilityLogsExplorer 147.7KB 148.2KB +544.0B
observabilityOnboarding 283.1KB 283.4KB +403.0B
osquery 1.0MB 1.0MB +248.0B
painlessLab 18.7KB 18.9KB +166.0B
profiling 406.3KB 406.5KB +168.0B
remoteClusters 79.4KB 79.8KB +403.0B
rollup 115.8KB 116.2KB +405.0B
savedObjectsManagement 86.9KB 87.3KB +387.0B
searchAssistant 162.0KB 162.0KB +1.0B
searchHomepage 55.0KB 55.6KB +540.0B
searchIndices 167.7KB 168.4KB +743.0B
searchInferenceEndpoints 98.8KB 99.4KB +548.0B
searchPlayground 163.2KB 163.7KB +547.0B
searchprofiler 49.0KB 49.2KB +174.0B
security 540.7KB 540.7KB +7.0B
securitySolution 18.5MB 18.5MB +2.6KB
serverlessSearch 339.7KB 341.0KB +1.4KB
slo 843.1KB 856.8KB +13.7KB
snapshotRestore 263.3KB 263.8KB +448.0B
spaces 256.7KB 256.7KB +1.0B
streamsApp 116.4KB 116.6KB +167.0B
synthetics 1.1MB 1.1MB +859.0B
timelines 33.0KB 33.1KB +162.0B
transform 475.5KB 476.1KB +548.0B
triggersActionsUi 1.7MB 1.7MB +4.5KB
unifiedSearch 363.6KB 363.6KB +2.0B
upgradeAssistant 158.2KB 158.4KB +234.0B
uptime 468.4KB 468.9KB +549.0B
ux 168.2KB 168.4KB +206.0B
visTypeTimeseries 507.3KB 507.3KB +4.0B
visTypeVega 1.9MB 1.9MB +2.0B
visualizations 321.9KB 322.1KB +239.0B
watcher 166.5KB 166.9KB +410.0B
total +46.5KB

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.7KB 7.8KB +162.0B
banners 10.7KB 10.8KB +162.0B
cases 159.6KB 159.9KB +309.0B
cloudLinks 30.4KB 30.6KB +168.0B
console 38.6KB 38.9KB +308.0B
core 451.0KB 451.4KB +392.0B
dashboard 51.8KB 52.1KB +308.0B
dashboardEnhanced 18.1KB 18.3KB +168.0B
data 420.0KB 420.2KB +163.0B
dataViewEditor 13.8KB 13.9KB +162.0B
dataViewFieldEditor 27.0KB 27.1KB +163.0B
embeddable 55.5KB 55.7KB +166.0B
expressionGauge 16.5KB 16.7KB +162.0B
expressionHeatmap 17.4KB 17.6KB +162.0B
expressionLegacyMetricVis 12.7KB 12.9KB +162.0B
expressionMetricVis 17.1KB 17.3KB +162.0B
expressionPartitionVis 29.3KB 29.5KB +162.0B
expressionTagcloud 13.5KB 13.6KB +162.0B
expressionXY 42.2KB 42.4KB +167.0B
fleet 173.2KB 173.5KB +309.0B
globalSearchBar 30.0KB 30.2KB +162.0B
guidedOnboarding 29.8KB 29.9KB +166.0B
indexManagement 46.9KB 47.2KB +308.0B
ingestPipelines 17.7KB 18.0KB +308.0B
inspector 25.1KB 25.3KB +162.0B
interactiveSetup 60.0KB 60.1KB +169.0B
kibanaReact 40.0KB 40.1KB +168.0B
licensing 11.9KB 12.1KB +162.0B
links 16.7KB 16.8KB +14.0B
maps 54.5KB 54.8KB +309.0B
mockIdpPlugin 10.9KB 11.0KB +162.0B
navigation 17.9KB 17.9KB +3.0B
newsfeed 13.0KB 13.1KB +162.0B
observability 105.1KB 105.4KB +309.0B
observabilityAIAssistantApp 14.2KB 14.2KB +1.0B
osquery 47.2KB 47.5KB +308.0B
presentationPanel 43.5KB 43.6KB +162.0B
reporting 52.9KB 53.1KB +162.0B
runtimeFields 14.1KB 14.2KB +162.0B
savedObjects 17.8KB 18.0KB +162.0B
savedObjectsTagging 22.8KB 23.0KB +162.0B
security 68.1KB 68.7KB +685.0B
serverless 14.3KB 14.5KB +162.0B
share 58.0KB 58.1KB +163.0B
slo 29.7KB 29.7KB +7.0B
spaces 34.2KB 34.8KB +541.0B
telemetry 25.1KB 25.2KB +162.0B
uiActions 24.2KB 24.4KB +167.0B
unifiedSearch 38.4KB 38.6KB +162.0B
upgradeAssistant 24.8KB 25.1KB +308.0B
visDefaultEditor 24.2KB 24.4KB +162.0B
visTypeMarkdown 9.9KB 10.1KB +162.0B
visTypeTable 19.4KB 19.6KB +162.0B
visTypeTimelion 13.7KB 13.9KB +162.0B
visTypeTimeseries 20.6KB 20.8KB +163.0B
visTypeVega 36.3KB 36.5KB +166.0B
visTypeVislib 15.3KB 15.4KB +162.0B
visualizations 64.9KB 65.2KB +308.0B
total +11.3KB
Unknown metric groups

API count

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

async chunk count

id before after diff
slo 30 31 +1

@maryam-saeidi
Copy link
Member Author

Tested and worked as expected:

image

@maryam-saeidi maryam-saeidi merged commit 1665216 into elastic:8.x Dec 19, 2024
13 checks passed
@maryam-saeidi maryam-saeidi deleted the backport/8.x/pr-204547 branch December 19, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:obs-ux-management Observability Management User Experience Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants