kibana/packages/kbn-shared-ux-utility
Tim Sullivan 704e080c93
Integrate Event-Based Telemetry in KibanaErrorBoundary (#169895)
## Summary

Part of https://github.com/elastic/kibana-team/issues/646
Depends on https://github.com/elastic/kibana/pull/169324

Implements telemetry for fatal errors caught by KibanaErrorBoundary in:
-
`packages/core/application/core-application-browser-internal/src/ui/app_router.tsx`
- `packages/kbn-shared-ux-utility/src/with_suspense.tsx` [*]
- `packages/react/kibana_context/render/render_provider.tsx` [*]
-
`src/plugins/management/public/components/management_app/management_router.tsx`
-
`x-pack/plugins/observability_shared/public/components/page_template/page_template.tsx`
- `x-pack/plugins/security_solution/public/app/app.tsx`

[*] The changes made to these allowed the `analytics` dependency to be
provided optionally, to avoid a breaking API change for maintainers.

## Logging screenshot
You can trigger a fatal error in the new error boundary component in
most places in Kibana by adding a TypeError to a React component:
`<p>{breakHere()}</p>`
<img width="1586" alt="fatal error telemetry console log"
src="97f973ac-bb25-41f2-bfe2-547a23f2f450">

## Telemetry work info
Dashboard:
<img width="1382" alt="image"
src="4fe5353a-61ba-405a-ac18-0dd6a044c182">
Discover:
<img width="1331" alt="image"
src="2161b552-c441-4b7c-adef-25896147c08a">

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-03 12:55:00 -07:00
..
src Integrate Event-Based Telemetry in KibanaErrorBoundary (#169895) 2023-11-03 12:55:00 -07:00
index.ts Integrate Event-Based Telemetry in KibanaErrorBoundary (#169895) 2023-11-03 12:55:00 -07:00
jest.config.js [sharedUX] Move to Package-based Architecture (#127546) 2022-03-16 17:13:58 -04:00
kibana.jsonc [codeowners] rename global experience to @elastic/appex-sharedux 2023-01-18 10:02:49 -07:00
package.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
README.mdx [api-docs] follow the correct schema for frontmatter (#138348) 2022-08-10 17:17:50 -05:00
tsconfig.json Integrate Event-Based Telemetry in KibanaErrorBoundary (#169895) 2023-11-03 12:55:00 -07:00

---
id: kibSharedUXUtility
slug: /kibana-dev-docs/shared-ux/packages/kbn-shared-ux-utility
title: Shared UX Utilities
description: The `@kbn/shared-ux-utility` package contains a set of React, DOM and other utilities.
date: 2022-03-11
tags: ['kibana', 'dev', 'sharedUX']
---

## About Shared UX Utility

At present, this package is currently a "catch-all" for universally-shared utilities.  View the specific documentation for each utility for 

> Important: do not add new utilities to this package without considering if a different home is more appropriate.  Reach out to the Shared UX team for help.