-
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
Maps embeddables in a dashboard not capturing map id in execution context #153218
Comments
Pinging @elastic/kibana-presentation (Team:Presentation) |
Map id is not populated for embeddable maps because of the way executionContext is created by makePublicExecutionContext.
|
…ecution context (#153616) #153218 Existing execution context implementation spread results from `executionContextServiceStart().get()` to add map `id`. This implementation did not work when map was embedded in another application. When embedded, `executionContextServiceStart().get()` returned the `id` of the parent application and not the `id` for the map. This PR resolves the issue by building executionContext directly in MapEmbeddable and MapApp. MapApp uses `savedObjectId` for `executionContext.id`. MapEmbeddable uses `embeddableId` for `executionContext.id`. The PR also updates the MVT routes to include executionContextId for the execution context with `_mvt` calls. #### Testing To view execution context in kibana logs, add below to kibana.dev.yml. For more information https://www.elastic.co/guide/en/kibana/8.7/kibana-troubleshooting-trace-query.html ``` logging: loggers: - name: execution_context level: debug appenders: [console] ``` #### Execution context for lens and maps panels in dashboard There is not a lot of consistency for what `type` and `name` should be across Kibana. I found [this comment](https://github.com/elastic/kibana/pull/105206/files#r671174649) for when lens added execution context for lens embeddable that stated `type:feature` and `name:sub_feature`. Therefore, I followed the lens example and made `type:maps` and `name:maps` since maps does not have sub_features. ``` [2023-03-23T18:29:12.750-06:00][DEBUG][execution_context] {"type":"application","name":"dashboards","url":"/mth/app/dashboards","page":"app","id":"d98e6530-c9a8-11ed-9340-d743c2c88db8","child":{"type":"maps","name":"maps","id":"91f17723-367d-460e-ad90-dbac1fc072cb","url":"/map/de71f4f0-1902-11e9-919b-ffe5949a18d2","description":"es_geo_grid_source:cluster"}} [2023-03-23T18:29:12.750-06:00][DEBUG][execution_context] {"type":"application","name":"dashboards","url":"/mth/app/dashboards","page":"app","id":"d98e6530-c9a8-11ed-9340-d743c2c88db8","child":{"type":"maps","name":"maps","id":"91f17723-367d-460e-ad90-dbac1fc072cb","url":"/map/de71f4f0-1902-11e9-919b-ffe5949a18d2","description":"es_term_source:terms"}} [2023-03-23T18:29:13.241-06:00][DEBUG][execution_context] {"type":"dashboard","name":"dashboards","url":"/mth/app/dashboards","page":"app","id":"d98e6530-c9a8-11ed-9340-d743c2c88db8","description":"single map","child":{"type":"lens","name":"lnsXY","id":"b9e44118-9e67-4c1c-9159-597d8a9f80d1","description":"lens","url":"/mth/app/lens#/edit/32e87880-c9ab-11ed-9340-d743c2c88db8"}} ``` #### Execution context for maps There is not a lot of consistency across kibana for `type` and `name` in applications. [ExecutionContextService.getDefaultContext](https://github.com/elastic/kibana/blob/main/packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.ts#L99) returns the below so I stuck with `application` for type in client and `server` for type in server. Here is [one more link](#124996) that provides some context value of `name` property. ``` return { type: 'application', name: this.appId, url: window.location.pathname, }; ``` ``` [2023-03-23T18:30:39.886-06:00][DEBUG][execution_context] {"type":"application","name":"maps","url":"/mth/app/maps/map/de71f4f0-1902-11e9-919b-ffe5949a18d2","id":"de71f4f0-1902-11e9-919b-ffe5949a18d2","page":"editor","description":"es_geo_grid_source:cluster"} [2023-03-23T18:30:39.886-06:00][DEBUG][execution_context] {"type":"application","name":"maps","url":"/mth/app/maps/map/de71f4f0-1902-11e9-919b-ffe5949a18d2","id":"de71f4f0-1902-11e9-919b-ffe5949a18d2","page":"editor","description":"es_term_source:terms"} ``` --------- Co-authored-by: kibanamachine <[email protected]>
closed by #153616 |
To reproduce:
[Flights] Global Flight Dashboard
The
X-Opaque-Id
in the logs will contain entries like:In contrast to lens embeddables which create entries like:
Opening the map to edit it does produce the correct execution context, so it seems like the problem is the execution context is not correctly captured by the maps embeddable.
The text was updated successfully, but these errors were encountered: