Commit graph

46 commits

Author SHA1 Message Date
Luke Elmers
b6287708f6
Adds AGPL 3.0 license (#192025)
Updates files outside of x-pack to be triple-licensed under Elastic
License 2.0, AGPL 3.0, or SSPL 1.0.
2024-09-06 19:02:41 -06:00
Dario Gieselaar
8ade3da14d
@kbn/io-ts-utils: strictKeys: validate objects in arrays (#191607)
Makes sure keys from plain objects in arrays are validated as well.

---------

Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co>
Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2024-08-30 08:00:42 +02:00
Alejandro Fernández Haro
b79f5abed3
[Move @kbn/config-schema to server] kbn-io-ts-utils (#191692) 2024-08-29 04:31:01 -05:00
Kevin Delemme
aa67c800ce
chore(investigate): Add investigate-app plugin from poc (#188122) 2024-07-23 11:44:32 -04:00
Marco Antonio Ghiani
0a0853bef9
[Spacetime] Fields metadata services (#183806)
## 📓 Summary

Closes https://github.com/elastic/observability-dev/issues/3331

Given the needs described in the linked issue about having a centralized
and async way to consume field metadata across Kibana, this work focuses
on providing server/client services to consume field metadata on demand
from static ECS definition and integration manifests, with the chance to
extend further the possible resolution sources.


3b2d9027-5c29-4081-ab17-1b43618c62a7

## 💡 Reviewers hints

This PR got quite long as it involves and touches different parts of the
codebase, so I'll break down the interesting parts for an easier review.

More details, code examples and mechanics description can be found in
the README file for the plugin.

### `@kbn/fields-metadata-plugin`

To avoid bundling and consuming the whole ECS static definition
client-side, a new plugin `@kbn/fields-metadata-plugin` is created to
expose the server/client services which enable retrieving only the
fields needed on a use-case basis.

### FieldsMetadataService server side

A `FieldsMetadataService` is instantiated on the plugin setup/start
server lifecycle, exposing a client to consume the fields and setup
tools for registering external dependencies.

The start contract exposes a `FieldsMetadataClient` instance. With this,
any application in Kibana can query for some fields using the available
methods, currently:
- `FieldsMetadataClient.prototype.getByName()`: retrieves a single
`FieldMetadata` instance.
- `FieldsMetadataClient.prototype.find()`: retrieves a record of
matching `FieldMetadata` instances.

`FieldsMetadataClient` is instantiated with the source repositories
dependencies. They act as encapsulated sources which are responsible for
fetching fields from their related source. Currently, there are 2 field
repository sources used in the resolution step, but we can use this
concept to extend the resolution step in future with more sources (LLM,
OTel, ...).
The currently used sources are:
- `EcsFieldsRepository`: allows fetching static ECS field metadata.
- `IntegrationFieldsRepository`: allows fetching fields from an
integration package from EPR, where the fields metadata are stored. To
correctly consume these fields, the `fleet` plugin must be enabled,
otherwise, the service won't be able to access the registered fields
extractor implemented with the fleet services.
As this service performs a more expensive retrieval process than the
`EcsFieldsRepository` constant complexity access, a caching layer is
applied to the retrieved results from the external source to minimize
latency.

### Fields metadata API

To expose this service to the client, a first API endpoint is created to
find field metadata and filter the results to minimize the served
payload.
- `GET /internal/fields_metadata/find` supports some initial query
parameters to narrow the fields' search.

### FieldsMetadataService client side

As we have a server-side `FieldsMetadataService`, we need a client
counterpart to consume the exposed API safely and go through the
validation steps.

The client `FieldsMetadataService` works similarly to the server-side
one, exposing a client which is returned by the public start contract of
the plugin, allowing any other to directly use fields metadata
client-side.

This client would work well with existing state management solutions, as
it's not decoupled from any library.

### useFieldsMetadata

For simpler use cases where we need a quick and easy way to consume
fields metadata client-side, the plugin start contract also exposes a
`useFieldsMetadata` react custom hook, which is pre-created accessing
the FieldsMetadataService client described above. It is important to
retrieve the hook from the start contract of this plugin, as it already
gets all the required dependencies injected minimizing the effort on the
consumer side.

The `UnifiedDocViewer` plugin changes exemplify how we can use this hook
to access and filter fields' metadata quickly.

### `registerIntegrationFieldsExtractor` (@elastic/fleet)

Getting fields from an integration dataset is more complex than
accessing a static dictionary of ECS fields, and to achieve that we need
access to the PackageService implemented by the fleet team.

To get access to the package, maintain a proper separation of concerns
and avoid a direct dependency on the fleet plugin, some actions were
taken:
- the `PackageService.prototype.getPackageFieldsMetadata()` method is
implemented to keep the knowledge about retrieving package details on
this service instead of mixing it on parallel services.
- a fleet `registerIntegrationFieldsExtractor` service is created and
used during the fleet plugin setup to register a callback that accesses
the service as an internal user and retrieves the fields by the given
parameters.
- the fields metadata plugin returns a
`registerIntegrationFieldsExtractor` function from its server setup so
that we can use it to register the above-mentioned callback that
retrieves fields from an integration.

This inverts the dependency between `fields_metadata` and `fleet`
plugins so that the `fields_metadata` plugin keeps zero dependencies on
external apps.

## Adoption

We currently have places where the `@elastic/ecs` package is directly
accessed and where we might be able to refactor the codebase to consume
this service.

**[EcsFlat usages in
Kibana](https://github.com/search?q=repo%3Aelastic%2Fkibana%20EcsFlat&type=code)**

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-05 09:51:50 +02:00
Tiago Costa
250790e0f1
chore(NA): upgrade typescript into v4.9.5 (#175178)
This PR bumps the Typescript version used on Kibana into v4.9.5. The
full set of changes can be found
[here](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/).
So far, as long I can see, the performance is better than in the version
we're currently in.

I didn't want to make assumptions for such a diversity of type errors
across the codebase so instead I choose to mark the failures with
`@ts-expect-error` and let each team decide how to handle it.

There is a list below with the files (and teams those belong to) where
the annotations were added. If each team could provide help of fixing
the ones under their domain it would be fantastic. It can be done in
this PR or in subsequent ones.

Here it goes the list for follow up:

@elastic/kibana-core - tracking issue:
https://github.com/elastic/kibana/issues/176153
- [ ]
[packages/analytics/client/src/analytics_client/analytics_client.ts](https://github.com/elastic/kibana/pull/175178/files#diff-57477fa4b8c2fcd5a3159e8a6a9a1db80199dbe94b2917a520d4dcee4f65599b)
- [ ]
[packages/analytics/client/src/analytics_client/context_service.ts](https://github.com/elastic/kibana/pull/175178/files#diff-b7802a3b9a46305607ff678abde499d9c9e1dd8b1f3f6a76add1a8c3a0b94e43)
- [ ]
[packages/analytics/client/src/analytics_client/types.ts](https://github.com/elastic/kibana/pull/175178/files#diff-6584fc2ecf29864805de0f0f82dcff81a850b53aeff25932a598c9157c991d43)
- [ ]
[packages/core/http/core-http-router-server-internal/src/validator.ts](https://github.com/elastic/kibana/pull/175178/files#diff-5a4d386d142b33439aa7c638b7ddc2300da40155c636b4cf3119929b8bb57b72)
- [ ]
[packages/core/http/core-http-server-internal/src/cookie_session_storage.ts](https://github.com/elastic/kibana/pull/175178/files#diff-9efcaa58a5bdbfcac57c68b9c2e108b921c9c5ea88abf90920191b150d56a03a)
- [ ]
[packages/core/plugins/core-plugins-server-internal/src/create_browser_config.ts](https://github.com/elastic/kibana/pull/175178/files#diff-b49a02fac82b32dd34c271d0ed71f7f79f173591e6810b32093975bd50fe11b1)
- [ ]
[packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/bulk_update.ts](https://github.com/elastic/kibana/pull/175178/files#diff-9a151f7dc25effb6f2bb084075b7d1d8e8ee049dcd91e92a0d27e014d3bc82b8)
- [ ]
[packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/update.ts](https://github.com/elastic/kibana/pull/175178/files#diff-d5a4ebda74b0c2e2ca625fe395a185e3ff0076bc44614cf640cf33cbc5cba2bd)
- [ ]
[packages/kbn-es-types/src/search.ts](https://github.com/elastic/kibana/pull/175178/files#diff-49222c37a13c4c85c287947aaa8293029513f4a34933fcac6116ad3059ee8fcf)
- [ ]
[packages/kbn-utility-types/src/dot.ts](https://github.com/elastic/kibana/pull/175178/files#diff-f14998302c20ca97ac7f3faa7b542f22670708eac134e6af96c354489a641689)
- [ ]
[src/core/server/mocks.ts](https://github.com/elastic/kibana/pull/175178/files#diff-a3e30603bf537517842354df3548e88a25f4d9e2a6be08f95b88fb8db48e4228)
- [ ]
[test/plugin_functional/test_suites/core_plugins/rendering.ts](https://github.com/elastic/kibana/pull/175178/files#diff-eb6bd8a02c024aa1ab5c3debbeda149e8d2fb2614bca80d09c3f9aa21100ed7d)

@elastic/kibana-presentation 
- [ ]
[packages/content-management/content_editor/src/__jest__/tests.helpers.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-6e56e39c2e9accef38070408bb589fb4cc973e4353098574be142aa8e3da399e)
- [ ]
[src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts](https://github.com/elastic/kibana/pull/175178/files#diff-1aa4b1f585b7a75d996ad7620d8cfef03584e41f77d529172acc5250f5de092f)
- [ ]
[src/plugins/presentation_util/public/services/create/provider.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-baa5fb3d72bf64b6c269155b736f6af387688b0f2f77d804f5fd5ced69d3e2c9)
- [ ]
[x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts](https://github.com/elastic/kibana/pull/175178/files#diff-da216f23664ac188404e9a48cdf33b05ad121512d988da5cd88a72724d5bfff9)
- [ ]
[x-pack/plugins/canvas/server/templates/status_report.ts](https://github.com/elastic/kibana/pull/175178/files#diff-45598e8b99710f8fd7a0a00eb7b0810cb24bf529b7fefb52dfd5f05b82a23578)
- [ ]
[x-pack/plugins/canvas/server/templates/summary_report.ts](https://github.com/elastic/kibana/pull/175178/files#diff-b1eb9cec629f0adcae86dede388d6b343b785970a458fbf57c96dbd32b3fc8b5)
- [ ]
[x-pack/plugins/canvas/types/arguments.ts](https://github.com/elastic/kibana/pull/175178/files#diff-c7d1e4fa5026000bb99d03e5dace364226857c8e1e928a182c14c3f33f0006d9)
- [ ]
[x-pack/plugins/canvas/types/functions.ts](https://github.com/elastic/kibana/pull/175178/files#diff-00548b1936e05f24bc8dcbf453bf5a49f0f129989bab422926d3f4b56e35abae)

@elastic/apm 
- [ ]
[packages/kbn-apm-synthtrace-client/src/lib/interval.ts](https://github.com/elastic/kibana/pull/175178/files#diff-ec08c88331cc24811a3e24cec3aa99d02a707fb1a5848e1fb3a7c3172f99f1e7)
- [ ]
[packages/kbn-apm-synthtrace/src/lib/shared/get_serialize_transform.ts](https://github.com/elastic/kibana/pull/175178/files#diff-98d45df58fce30ac60a87c3a88aa7368ecf16f5b79b68a67419d8546974e42db)
- [ ]
[packages/kbn-apm-synthtrace/src/lib/utils/with_client.ts](https://github.com/elastic/kibana/pull/175178/files#diff-612d609963c9fe7830bc4e522bd3bb614369772906708b163e9854ec85cf879c)
- [ ]
[x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.test.ts](https://github.com/elastic/kibana/pull/175178/files#diff-69ee25aee396b7ccb9cc749b4f9cfad19a380bf3c4eb1f2d1848390b75477732)

@elastic/obs-knowledge-team  
- [ ]
[packages/kbn-io-ts-utils/src/to_json_schema/index.ts](https://github.com/elastic/kibana/pull/175178/files#diff-012b20f075e09f40a1839b759082ffea0122aeb79d6b5fd5e642f9abee2435e2)
- [ ]
[packages/kbn-server-route-repository/src/test_types.ts](https://github.com/elastic/kibana/pull/175178/files#diff-a4e28211d0c856831b71488f849f1c9e542373d4a287baa3cbfa032278cc8dc0)

@elastic/security-detection-engine   
- [ ]
[packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.test.ts](https://github.com/elastic/kibana/pull/175178/files#diff-594114826caa3dee11e8dda5d6a67d4ce852b02f5d4df9721925c19d9c5d97af)
- [ ]
[packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.ts](https://github.com/elastic/kibana/pull/175178/files#diff-8a1645d3d66eedeb05f8d954a3855523f8403b7a9c59200ad8184af96bb28cfb)
- [ ]
[x-pack/plugins/lists/server/routes/utils/build_siem_response.ts](https://github.com/elastic/kibana/pull/175178/files#diff-170882f010e12304aec81e167487cfc086c2d6a1d7dbbb36d1db2215d072577e)

@elastic/appex-sharedux 
- [ ]
[packages/shared-ux/router/impl/routes.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-43ba27115faf87c05460364c3b30b32f2794451404c82470653ccd9258e944b8)
- [ ]
[src/plugins/files/server/routes/file_kind/enhance_router.ts](https://github.com/elastic/kibana/pull/175178/files#diff-33258e2bd2f400b53a1366511ec3ef1c83b8f0aee762c1bd83abdea3ff153c2a)
- [ ]
[src/plugins/files/server/routes/types.ts](https://github.com/elastic/kibana/pull/175178/files#diff-bad66d1fdd59cf33bfa9a20aa96dde580fab1b7da8252723ee08c4e99203074f)

@elastic/kibana-visualizations 
- [x]
[src/plugins/chart_expressions/expression_legacy_metric/public/__stories__/metric_renderer.stories.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-e66ed20c106e40aee23cbca1980280ef6600797f5d2210486be007d7fe5d72ca)
- [x]
[src/plugins/chart_expressions/expression_legacy_metric/public/components/with_auto_scale.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-d45fb549abb422cdd706da86c52a3d9dc3b0517f028b966b20cf2679aabcd24f)
- [x]
[src/plugins/expressions/common/execution/execution_contract.ts](https://github.com/elastic/kibana/pull/175178/files#diff-8817ec58899f80b4bfd6144dc59c3e6dc9a508e31264cd2bdf155a0b1746d9f9)
- [x]
[src/plugins/vis_types/table/public/components/table_vis_basic.test.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-4de9a68e38b105b862755f59d2d05722bfba6ffc85dcb0b2cf5eaf754a6afb50)
- [x]
[src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/percentile.ts](https://github.com/elastic/kibana/pull/175178/files#diff-c5fef6976b67ee678ec2dda15e0bd3ca56bef8404565499b915783a40c3c908d)
- [x]
[src/plugins/vis_types/timeseries/public/convert_to_lens/lib/convert/percentile_rank.ts](https://github.com/elastic/kibana/pull/175178/files#diff-8ad6988492e0ada34f9899f56f40533e41e537d6d79af1cc3794fdb68fbff358)
- [x]
[src/plugins/visualizations/public/vis.ts](https://github.com/elastic/kibana/pull/175178/files#diff-15c314cac8f334b9e9feb83d9f23c0c9e94f4c85405cfa4b4e3b3b445bd6763e)
- [x]
[src/plugins/visualizations/public/vis_async.ts](https://github.com/elastic/kibana/pull/175178/files#diff-d5e129fbb0217fe4da38f828794cd141bc6a4d32d87847713920312a5d27f150)
- [ ]
[x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/formula.test.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-5624778a752c98be20953fd297e58165dab354ddab95bcf0c6b2a91d854a9c71)
- [x]
[x-pack/plugins/lens/public/debounced_component/debounced_component.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-9c14c9f29c5b351993b25d462b1d988e354068a1db9a8651515c3ee85fbd6ce9)
- [ ]
[x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-8ca1f3be4f6696d9c05773cfaa23d7489a1c460fffdf39c8ad2ba8aa09f6c194)
- [ ]
[x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-d3a5ba0620f3712afd6af94b1f4ceea107d356c6812ae245d1b496caf86c54a7)
- [x]
[x-pack/plugins/lens/public/state_management/lens_slice.ts](https://github.com/elastic/kibana/pull/175178/files#diff-8b56f34b3034981765e12503ccd32ca15b2d889ab6acd594737ae5313a5e2312)
- [x]
[x-pack/plugins/lens/server/migrations/common_migrations.ts](https://github.com/elastic/kibana/pull/175178/files#diff-7609127370894696659846e16e36353fda9cc11150c663334236caf597854b24)
- [ ]
[src/plugins/embeddable/public/registry/saved_object_to_panel_methods.ts](bcd925ecb6 (diff-1401b355377c76ab6458756aa0e3177beef5ec56796c58b7a52b5e003f85b5cf))

@elastic/kibana-data-discovery 
- [ ]
[src/plugins/data_view_management/public/components/test_utils.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-60386b173801a1e7fa97b99de49501c4fe7053c099ee06107292461acc7d26a8)
- [ ]
[src/plugins/unified_histogram/public/layout/layout.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-03181d67508c4c66d682a019b9b1e9235ca8a6dc656450e563422c9720bfa24f)

@elastic/platform-deployment-management 
- [ ]
[src/plugins/es_ui_shared/static/forms/hook_form_lib/components/use_field.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-ef2d4424a31a8d8def4c1c2d9d756cfef9cc58b30837c1b6639e3419e572cdd9)
- [ ]
[src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts](https://github.com/elastic/kibana/pull/175178/files#diff-b80eb528652fd57fe88cae03deed4737cba5992b3a9ddf62259e4aa892b2ec68)
- [ ]
[src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field_from_props.ts](https://github.com/elastic/kibana/pull/175178/files#diff-ac8d10db6808671a05edbe0e9f4cecf330377cf85aaef8d96019e8e1dc7987ef)
- [ ]
[src/plugins/es_ui_shared/static/forms/hook_form_lib/types.ts](https://github.com/elastic/kibana/pull/175178/files#diff-3e75c35c5d016b55290a30604c278eaf90bbd5a78a26613dbed19f0abd59212f)

@elastic/kibana-security 
- [x]
[src/plugins/interactive_setup/public/use_form.ts](https://github.com/elastic/kibana/pull/175178/files#diff-afe9ad58c9ccaf628d72ed916620587703bd960ba313e3199fbef4c98ad30841)

@elastic/ml-ui 
- [ ]
[x-pack/packages/ml/cancellable_search/src/use_cancellable_search.ts](https://github.com/elastic/kibana/pull/175178/files#diff-4a366c647aadac020022b1186fa424fa6475b2ba907d9391cfff5e77863dec48)
- [ ]
[x-pack/packages/ml/date_picker/src/components/full_time_range_selector.test.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-b5dd4c2d53eedbc4d749261001ab2f735f798ec6cbf249c900db517294a4ec59)
- [ ]
[x-pack/plugins/aiops/public/hooks/use_cancellable_search.ts](https://github.com/elastic/kibana/pull/175178/files#diff-361b7df5c49f9b67a897baab531df2456ceba3b57eaee9b2bb193b4d70aed052)
- [ ]
[x-pack/plugins/data_visualizer/public/application/data_drift/use_data_drift_result.ts](https://github.com/elastic/kibana/pull/175178/files#diff-0c1ebe9287033ed3afdbe615c8e95f6091285de5df1455134d9f6d14d3e9b970)

@elastic/response-ops 
- [ ]
[x-pack/plugins/alerting/server/application/rule/methods/create/create_rule.ts](https://github.com/elastic/kibana/pull/175178/files#diff-a4ecdf971673064aa6dc4ab5620e7b128efcc27b3e77804a3753d2839eaa7ba2)
- [ ]
[x-pack/plugins/alerting/server/application/rule/methods/resolve/types/resolved_rule.ts](https://github.com/elastic/kibana/pull/175178/files#diff-fd0549bd17f14e41a3c47a0dfe01a3cbd76f141983aa076ce30537db4edb0f0c)
- [ ]
[x-pack/plugins/alerting/server/routes/get_rule.test.ts](https://github.com/elastic/kibana/pull/175178/files#diff-5c8d8530f6a5ebb71ff59f03cb212af6ca2cffe015ee061cd998d11b63f5fd2d)
- [ ]
[x-pack/plugins/alerting/server/routes/lib/rewrite_rule.test.ts](https://github.com/elastic/kibana/pull/175178/files#diff-032345b22421e404941669203a41b51b23a5223a555ef286ab29ff1ea199a287)
- [ ]
[x-pack/plugins/alerting/server/routes/rule/apis/create/create_rule_route.test.ts](https://github.com/elastic/kibana/pull/175178/files#diff-425f9213402823ce800f9f4400ccce476c1b15d82302f238b3e07312bcacf1fe)
- [ ]
[x-pack/plugins/cases/public/api/utils.ts](https://github.com/elastic/kibana/pull/175178/files#diff-3b36a4b3a6bcd19c1ee4aa7f83fb50e08ae3715c936c26ca911df9e8da319d63)
- [ ]
[x-pack/plugins/cases/public/components/case_view/components/user_list.test.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-1ce6d0fd74881ed9a9dd9bbe7ec597083382aee3395fb032c46ec7acd8a201f5)
- [ ]
[x-pack/plugins/stack_connectors/public/connector_types/opsgenie/params.test.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-e08360892ade8eba65f8e6097525cb749918b8beb9d949d3f9e3a79dfcb9df97)
- [ ]
[x-pack/plugins/triggers_actions_ui/public/application/lib/suspended_component_with_props.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-2f91d7445dd017643fe50c068a42d4c143ca0208aac42ad35d10401aaf6480c6)
- [ ]
[x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_alerts_filter_timeframe.test.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-37c30c5d49eaaaeef4e05d01d4e6e73584684ab9707d731c7945aca56cde6091)
- [ ]
[x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_conditions.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-51a33d1d3b082b2615edd649b7ebc3bdb00e9c107cee754e468fa9512d064835)
- [ ]
[x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_conditions_group.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-24314823291cc4b2970c60f3c66c9e1c2d49aa88b668a063dd1d44724cde7080)

@elastic/security-threat-hunting-investigations
- [ ]
[x-pack/plugins/ecs_data_quality_dashboard/server/lib/build_response/index.ts](https://github.com/elastic/kibana/pull/175178/files#diff-8aefd6c90e985c7a1c8715b4c894be71e3d8abcb58fad0c513b4ab37e23cffbb)

@elastic/security-generative-ai
- [ ]
[x-pack/plugins/elastic_assistant/server/lib/build_response/index.ts](https://github.com/elastic/kibana/pull/175178/files#diff-0e0fa80b96f36b0daa287213f9f35da73adfd869d33b16a4f44ab1a336f66925)

@elastic/enterprise-search-frontend
- [ ]
[x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector_total_stats.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-61c41618bb97778cb1fd7d0645ddc07e779f1b1c63a0e7684b0a6df664de0c91)
- [ ]
[x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler_total_stats.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-d8651696438142564028406ccab850b316a3fb3b6d5f38ca7e4e6804f6491d1b)
- [ ]
[x-pack/plugins/enterprise_search/public/applications/search_index/pipelines/pipelines_json_configurations_logic.ts](https://github.com/elastic/kibana/pull/175178/files#diff-d77f51637904e4d4672b6b2d7f7ced6df73af142e8ba3fb5a074c700b5cf0fd0)
- [ ]
[x-pack/plugins/enterprise_search/public/applications/shared/accordion_list/accordion_list.test.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-f19e11825ff7d643f74a9f95cda32843685c28f0a7e7fc8b6d9f05dc659e0ee7)

@elastic/fleet 
- [ ]
[x-pack/plugins/fleet/.storybook/context/fixtures/integration.nginx.ts](https://github.com/elastic/kibana/pull/175178/files#diff-0d84f41c1e7da6af3d1dc869fa722c384247beddf2a58de6c00bdedd3a835ed1)
- [ ]
[x-pack/plugins/fleet/common/authz.test.ts](https://github.com/elastic/kibana/pull/175178/files#diff-25b3fe4e87a154100ec03010e9c5f08a00790104352757922f03caf2c24536f8)
- [ ]
[x-pack/plugins/fleet/public/applications/fleet/sections/settings/hooks/use_confirm_modal.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-ea640c827015978c83ae51a221392f57124a6fccb90c977991133baa020f6487)
- [ ]
[x-pack/plugins/fleet/server/services/preconfiguration.ts](https://github.com/elastic/kibana/pull/175178/files#diff-82d451a43233c196f1c527436ec5b4afe16c669d25f912086ef83939fe04fbda)

@elastic/platform-deployment-management
- [ ]
[x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/form_errors_context.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-6fdd461892c891ebad0ba30154ecf28479dd10c63b756eb57e658a02cb62ae63)

@elastic/obs-ux-logs-team / @elastic/obs-ux-infra_services-team

- [ ]
[x-pack/plugins/infra/public/containers/metrics_source/source.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-f27b71c245d27489c408611dfd2d2c020e4e881b6db7dcaf0b2f0cf8401ce5a1)
- [ ]
[x-pack/plugins/infra/public/pages/metrics/metric_detail/components/section.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-d782e8608b4b6ec1e5de15432ee899be94dfbdbedddc8d94b09c3399e2754294)
- [ ]
[x-pack/plugins/infra/public/pages/metrics/metric_detail/components/sub_section.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-eb598de689a9aa6536795e7f63a7c59a771c2c4e0a0bb81ee0102c8ce864620d)
- [ ]
[x-pack/plugins/logs_shared/public/components/logging/log_text_stream/vertical_scroll_panel.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-68bd0b43320ea3e59359e977d70f1c2e33518c1de5d97f39df17cb0a6a71cb99)
- [x]
[x-pack/plugins/observability_solution/logs_explorer/public/utils/proxies.ts](https://github.com/elastic/kibana/pull/175178/files#diff-134c464cedf12a2a2e1bceb1014d63e9ac7df4fd263ee5fe4ddd13fe3af7382d)
- [x]
[x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/validation.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-cf41bdb5d7247755b3b5dff0f428d847c9aa2f1ecff14c4e8fbfec5048e3ff91)
- [x]
[x-pack/plugins/synthetics/public/apps/synthetics/state/service_locations/api.ts](https://github.com/elastic/kibana/pull/175178/files#diff-571225171a2250a7b66cdc308eea2308cccdfc5ddf69c454dffd59d890947fe3)
- [x]
[x-pack/plugins/synthetics/public/utils/api_service/api_service.ts](https://github.com/elastic/kibana/pull/175178/files#diff-04d770eab9404afbf543d52e1ca2e869e0248f86ca2943d8811ca95a6a37f331)
- [x]
[x-pack/plugins/synthetics/server/routes/types.ts](https://github.com/elastic/kibana/pull/175178/files#diff-ddd7e79b79cf790fbd1798174b6f6a25cd869d1afd4ecf53f1a3febaa980f618)
- [x]
[x-pack/plugins/synthetics/server/synthetics_service/service_api_client.ts](https://github.com/elastic/kibana/pull/175178/files#diff-b22608feca8f7a00a94d538f7a51c1be3bbd355d9966e5a1e4b4b2e84c663342)
- [x]
[x-pack/plugins/uptime/public/legacy_uptime/components/common/monitor_tags.test.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-840db8c32fd91ca5075b60203426a93bff6a3e522f7d65f0a9c5b02733071cf4)
- [x]
[x-pack/plugins/uptime/public/legacy_uptime/state/api/utils.ts](https://github.com/elastic/kibana/pull/175178/files#diff-576a5e3c17bfaeaaf8f1c3df1cfc7f84021bf7ee234e7df77c38cd0afd90d573)
- [x]
[x-pack/plugins/uptime/public/utils/api_service/api_service.ts](https://github.com/elastic/kibana/pull/175178/files#diff-85df170f1ea77dc9faa8aaec88929babd7bd24ee78845ea5bb8e9ed43c19e051)
- [x]
[x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_snapshot_counts.ts](https://github.com/elastic/kibana/pull/175178/files#diff-f80f1cca2be5a43785f840c2705b59732e4eb8b57f8879806600b3220e9bb234)
- [x]
[x-pack/plugins/uptime/server/legacy_uptime/lib/requests/search/find_potential_matches.ts](https://github.com/elastic/kibana/pull/175178/files#diff-80c8152e4da9f7d2fa42cd5dcf35a34c70cd86b32da08d0710620272ac4e9f62)
- [x]
[x-pack/plugins/uptime/server/legacy_uptime/lib/requests/search/query_context.ts](https://github.com/elastic/kibana/pull/175178/files#diff-8692f1eec652074b463e4b8478116ba796ce5cd0bcc818755300b36e80baeb95)
- [x]
[x-pack/plugins/uptime/server/legacy_uptime/lib/requests/search/refine_potential_matches.ts](https://github.com/elastic/kibana/pull/175178/files#diff-7b93319a7e63eb6e09cbb3147b49f40ef794f684be024d62f094c72cfdb2693c)
- [x]
[x-pack/plugins/uptime/server/legacy_uptime/routes/types.ts](https://github.com/elastic/kibana/pull/175178/files#diff-5618c2b61f704802d87c620000f5500f2340605fbe8abe5a261864e83ed9eded)
- [x]
[x-pack/plugins/ux/public/application/ux_app.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-0bd45972562be4fcdad56b6fe2c2c9800775689067b0c2a956733e5c334b43c9)
- [x]
[x-pack/plugins/ux/public/components/app/rum_dashboard/ux_overview_fetchers.ts](https://github.com/elastic/kibana/pull/175178/files#diff-8bfd9c637261e22d413a95546cb9dd54efcd41930646fbdf8081965f81b4dcf3)

@elastic/kibana-gis 
- [ ]
[x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts](https://github.com/elastic/kibana/pull/175178/files#diff-23b9c9add47e2d51d022faf8e8527b46febf5d265fdddfb383bbc86b58257691)
- [ ]
[x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-b981aee9ac5aa5b1eb7f811eae5a461f15835f2d81d693b40a402fd55a8b9f59)
- [ ]
[x-pack/plugins/maps/public/classes/styles/vector/symbol_utils.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-94970fa194c5e647c78a36fe6c8894365780f320f77db6065572bec88ac5586b)
- [ ]
[x-pack/plugins/maps/public/lazy_wrapper.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-27e988b8e71057b5c527ff008ca6c92a545bbe29ddeb9ea2a461aeb5bdb498ae)

@elastic/observability-ui 
- [ ]
[x-pack/plugins/observability_shared/public/contexts/inspector/inspector_context.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-cd6617fddf50f9a5e29d8674a54dbd8d65e298f31fec6c2a9635bd39681b6910)

@elastic/security-defend-workflows
- [ ]
[x-pack/plugins/osquery/common/utility_types.ts](https://github.com/elastic/kibana/pull/175178/files#diff-e1aaf9c0e4f18af25b940e2b0aa55fb274022fa5fd2e378276c88da6b0e7c392)

@elastic/security-solution
- [ ]
[x-pack/plugins/security_solution/common/endpoint/generate_data.ts](https://github.com/elastic/kibana/pull/175178/files#diff-12dc63d6524a714b19d487bcf75486270eea7d5d52e6d1ecdeaa935545f33ac0)
- [x]
[x-pack/plugins/security_solution/common/utility_types.ts](https://github.com/elastic/kibana/pull/175178/files#diff-8d3ac0c16b9803465d90e48032b32738dfe8ff891b152677542607db57cb684b)
- [ ]
[x-pack/plugins/security_solution/public/common/components/page/manage_query.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-43f472ce0931147aadfa34f11cbb0804c1ef968a999528f3ac70ac39977dde21)
- [ ]
[x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/dns_top_domains.ts](https://github.com/elastic/kibana/pull/175178/files#diff-f8273324b45291f2561273d33a0080807a82fb7deb08124d06418f2882360d5b)
- [ ]
[x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentication_metric_failure.ts](https://github.com/elastic/kibana/pull/175178/files#diff-4653e6776fc5d5ab3dba81b9d1df1b23d936975d5770c6456eb6ecda99951b8b)
- [ ]
[x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.ts](https://github.com/elastic/kibana/pull/175178/files#diff-c69f65409bc0c3c1d986616357292a9506e02d5510f418e3969add19ed5c9073)
- [ ]
[x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_bar.ts](https://github.com/elastic/kibana/pull/175178/files#diff-0b2b3087618234227771b2c2c7b905c727225a158f21cdc7f70148ec22938ad8)
- [ ]
[x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_metric_success.ts](https://github.com/elastic/kibana/pull/175178/files#diff-c4ccd8146a7b8614dd2b431e552f0a9cdd2fa759e852f16898b1e4ca5ae31520)
- [ ]
[x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts](https://github.com/elastic/kibana/pull/175178/files#diff-8aba26a2e24f78b4272485f28691a6315422c65537c9ae54ff5754b0bd75bc5d)
- [ ]
[x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/index.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-cfed12b5fe28617d39f22c2f5e5573e1f7c5bab15bc274245b71fefb0b67540f)
- [ ]
[x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_table.tsx](https://github.com/elastic/kibana/pull/175178/files#diff-e15c09422e069163df1b0e68c612fe7000aa83c817bbca386f5a59a6251ccfab)
- [ ]
[x-pack/plugins/security_solution/scripts/endpoint/common/agent_downloads_service.ts](https://github.com/elastic/kibana/pull/175178/files#diff-74090a1d7f0d5bcef92cf0f90c279334c8742fc45dad51dcc733113124689847)
- [ ]
[x-pack/plugins/security_solution/server/endpoint/services/actions/clients/mocks.ts](https://github.com/elastic/kibana/pull/175178/files#diff-cd5726e4db2d4f93c2fa913032e9803facf1ed926ce0ba38864c0342d9ff968e)
- [ ]
[x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts](https://github.com/elastic/kibana/pull/175178/files#diff-637b99199ff7a5c6e2cc30bf4a460118fc7357afe5f60bdfeb0cb724701fc405)
- [ ]
[x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/utils.ts](https://github.com/elastic/kibana/pull/175178/files#diff-288cb69918810a15b715a67fd6d978dfc6aaa64630b3f06ff5c9bf7485cb8cc7)
- [ ]
[x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/validations.ts](https://github.com/elastic/kibana/pull/175178/files#diff-b6c6d3cff1c78443a0b5d34b6ec820ce9fa8584b1a88c82b7fde100788655381)
- [ ]
[x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.ts](https://github.com/elastic/kibana/pull/175178/files#diff-f2f612dd995d2c059b2e28dde1009b16c361ce9e1ae4600343c47d3beacfb0a3)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nick Partridge <nick.ryan.partridge@gmail.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@elastic.co>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: achyutjhunjhunwala <achyut.jhunjhunwala@elastic.co>
Co-authored-by: Justin Kambic <jk@elastic.co>
Co-authored-by: Jan Monschke <jan.monschke@elastic.co>
2024-02-25 01:23:57 +00:00
Cauê Marcondes
db08fb5c5b
[APM] Show Universal Profiling on Transaction view (#176302)
New Setting: Default value is `False`
<img width="1070" alt="Screenshot 2024-02-08 at 15 06 43"
src="46e8273c-4389-4de5-8b93-77d3e7a191d8">
---
<img width="1335" alt="Screenshot 2024-02-08 at 14 59 17"
src="45531abc-1c1c-4525-a2dc-b7573f857fa6">
<img width="1339" alt="Screenshot 2024-02-08 at 14 59 33"
src="d0ca0c7e-d33e-4f4a-83d4-70ef96b2bf1b">
2024-02-13 03:58:35 -07:00
Pierre Gayvallet
02bafbdf92
flag packages without side effects (#173351)
## Summary

Add the `sideEffects` meta to packages without side effects to optimize
tree-shaking on browser-side bundles.


Notes:
- it mostly impacts the `securitySolution` app (almost 2mb reduction)
- it's not always beneficial for all apps, some apps gain some weight,
likely related to the way webpack optimizes the chunks, but I feel like
it's still overall beneficial (don't hesitate to say if you think
otherwise)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-12-19 02:46:39 -07:00
mohamedhamed-ahmed
ddc07c53a5
[Log Stream] Support date nanos (#170308)
closes #88290 

## 📝  Summary

As described in #88290 we need to add `date_nanos` support to the Stream
UI page. In this PR the necessary changes have been made all over the
Stream UI and the usages of it.

##   Testing

⚠️ Testing the Stream UI with old timestamp indices is important to make
sure that the behavior is still as before and not affected at all. This
can be done by running local env from the PR and simulating all
interactions on edge-lit cluster for example, to make sure that the
behavior is not changed.

For testing the new changes with support of `date_nano`:

1. You can use [the steps
here](https://github.com/elastic/kibana/issues/88290#issuecomment-1713400873)
to create and ingest documents with nano precision.
2. Navigate to the stream UI and the documents should be displayed
properly.
3. Sync with the URL state should be changed from timestamp to ISO
string date.
4. Changing time ranges should behave as before, as well as Text
Highlights.
5. Open the logs flyout and you should see the timestamp in nano
seconds.
6. Play around with the minimap, it should behave exactly as before.

### Stream UI:

<img width="2556" alt="Screenshot 2023-11-02 at 14 15 49"
src="596966cd-0ee0-44ee-ba15-f387f3725f66">

- The stream UI has been affected in many areas:
- The logPosition key in the URL should now be in ISO string, but still
backward compatible incase the user has bookmarks with timestamps.
- The minimap should still behave as before in terms of navigation
onClick and also highlighting displayed areas

### Stream UI Flyout:

<img width="2556" alt="Screenshot 2023-11-02 at 14 15 23"
src="6081533c-3bed-43e1-872d-c83fe78ab436">

- The logs flyout should now display the date in nanos format if the
document is ingested using a nano format.

### Anomalies:

<img width="1717" alt="Screenshot 2023-11-01 at 10 37 22"
src="b6170d76-40a4-44db-85de-d8ae852bc17e">

-Anomalies tab under logs as a navigation to stream UI which should
still behave as before passing the filtration and time.

### Categories:

<img width="1705" alt="Screenshot 2023-11-01 at 10 38 19"
src="c4c19202-d27f-410f-b94d-80507542c775">

-Categories tab under logs as a navigation to stream UI which should
still behave as before passing the filtration and time.

### External Links To Stream:
- All links to the Stream UI should still work as before:
   - APM Links for traces, containers, hosts
   - Infra links in Inventory and Hosts views

## 🎥 Demo


9a39bc5a-ba37-49e0-b7f2-e73260fb01f0
2023-11-13 14:51:33 +01:00
Paul Bianciardi
c72d4d3372
Update new codeowners for Obs team changes (#170182)
Updates new teams as codeowners for Observability team changes.

Also took the opportunity to:
- Delete some paths that no longer exist
- Split infra code ownership between teams (from #168992)
2023-11-08 14:30:17 +00:00
Dario Gieselaar
e47152d8fd
[Observability AI Assistant]: Chat & function calling (#162906)
Implements chat & function calling for the Observability AI Assistant.
The APM related changes are due to a correction in the `toBooleanRt`
type.

Code in `x-pack/observability_ai_assistant` has been reviewed via
feature branches.

---------

Co-authored-by: Coen Warmer <coen.warmer@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>
2023-08-08 13:48:05 +02:00
Felix Stürmer
0069062fb4
[Logs+] Fix landing page log data check and redirect (#162662)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Gil Raphaelli <graphaelli@gmail.com>
2023-08-04 19:16:00 +02:00
Tomasz Ciecierski
132139ee74
[Defend workflows] Establish /common/api folder in osquery plugin (#161944) 2023-08-01 13:00:10 +02:00
Dario Gieselaar
8f57280853
Validate array types for strictKeysRt (#161526) 2023-07-13 18:37:34 +02:00
Carlos Crespo
d79e69a1ed
[Infrastructure UI] Add strict payload validation to inventory_views endpoint (#160852)
closes [#157505](https://github.com/elastic/kibana/issues/157505)
fixes [#157740](https://github.com/elastic/kibana/issues/157740)
## Summary

This PR adds strict payload validation to `inventory_views` endpoint. I
tried to make the types consistent between sever and frontend code and
because of that more changes had to be made. I also refactored the
`toolbar_control` component, decoupling them from Inventory View and
Metrics Explorer View types


### How to test

- Call the endpoint below trying to use invalid values. see
[here](https://github.com/elastic/kibana/pull/160852/files#diff-058b21e249ebbe2795d450d07025d8904a58cfb07a97979e85975f87e931ffceR133-R143).

```bash
[POST|PUT] kbn:/api/infra/inventory_views
{
  "attributes": {
    "metric": {
        "type": [TYPE]
    },
    "sort": {
        "by": "name"
        "direction": "desc"
    },
    "groupBy": [],
    "nodeType": "host",
    "view": "map",
    "customOptions": [],
    "customMetrics": [],
    "boundsOverride": {
        "max": 1,
        "min": 0
    },
    "autoBounds": true,
    "accountId": "",
    "region": "",
    "autoReload": false,
    "filterQuery": {
        "expression": "",
        "kind": "kuery"
    },
    "legend": {
        "palette": "cool",
        "steps": 10,
        "reverseColors": false
    },
    "timelineOpen": false,
    "name": "test-uptime"
  }
}
```

- Set up a local Kibana instance
- Navigate to `Infrastructure`
- In the UI, use the Saved View feature and try different field
combinations

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-05 08:52:24 +02:00
Marco Antonio Ghiani
6a0d6deaa6
[Logs+] Implement Logs Dataset selector (#159907)
## 📓  Summary

Closes https://github.com/elastic/observability-dev/issues/2655

This PR introduces a customized log consumption experience in the
Discover plugin. By leveraging the new `discover_log_explorer` plugin
and utilizing the `discover.customize` functionality, we have curated a
more tailored user experience.

The key feature of this implementation is the `DatasetSelector`
component, which replaces the original Discover `DataViewPicker`. It
handles the retrieval, rendering, and navigation of integrations and
data streams related to logs, providing an improved user interface.

This PR involves significant development efforts, including the creation
of the `discover_log_explorer` plugin, implementation of services, state
machines, custom hooks, and enhancements to presentational components.
The following overview will help reviewers understand the
responsibilities of each component in this implementation.


d725b699-452e-4718-8189-8dc1fab4d044

## DatasetsService & DatasetsClient

The DatasetsService is introduced, a crucial component that mediates
access to the newly implemented DatasetsClient. During the plugin's
lifecycle, the DatasetsService exposes a client property through its
start() method, providing convenient access to a DatasetsClient
instance.

The DatasetsClient is responsible for abstracting the data fetching
process for two endpoints: the integrations endpoint and the data
streams listing endpoint. These endpoints are utilized to populate the
selector options in the user interface. To facilitate this, the
DatasetsClient exposes the findIntegrations and findDatasets methods,
which handle the respective data fetching.

## Discover Customization

The critical part of this work consists of where the customization is
applied.
Inside the `public/plugin.tsx`, we lazy load and create, injecting the
required dependencies, the `CustomDatasetSelector`, which already
encapsulates all the logic required to make the selector work with the
external APIs.
We kept separating the data fetching logic from how the selector works,
and all the data and events are passed into the UI component with
properties.

```ts
discover.customize(
  DISCOVER_LOG_EXPLORER_PROFILE_ID,
  ({ customizations, stateContainer }) => {

    customizations.set({
      id: 'search_bar',
      CustomDataViewPicker: createLazyCustomDatasetSelector({
        datasetsClient: datasetsService.client,
        stateContainer,
      }),
    });
    ...
```

## Data fetching state machines & custom hooks

To handle the data fetching of integrations and unmanaged data streams,
we created two different state machines to separately handle the related
action for each dataset, such as remote search, in-memory search, error
handling etc.

### Integration machine and useIntegrations

The integrations state machine handles automatic data fetching of the
resources and additionally provides transitions for loading more
integrations, searching integrations by HTTP request, searching locally
into integration streams, and all the related loading and error handling
states.

It is then interpreted inside the `useIntegrations` custom hook, which
exposes the fetched data and handlers for all the above-mentioned
actions.

<img width="1975" alt="Screenshot 2023-05-30 at 09 44 42"
src="6daeca9f-826d-4a0f-bd90-eb4826ed1bde">


### Datasets machine and useDatasets

Similar to the integrations state machine, but simplified since the data
streams search can only happen with HTTP requests and there is no
pagination that requires to handle the load of more entries.

It is interpreted inside the `useDatasets` custom hook, which also
exposes the fetched data and handlers for the available actions.

<img width="1692" alt="Screenshot 2023-05-30 at 09 45 11"
src="5f9690e2-4e8f-439e-9ffd-f3b34cf3eaf5">

## DatasetSelector

The `DatasetSelector` component contains all the logic that manages the
navigation and searches across the different panels that render
integrations, integrations' streams or unmanaged streams.
As the datasets come from different APIs or are performed in-memory, the
search work follow this logic:
- When listing the integrations list (first level of the
`EuiContextMenu`), the search is done with an HTTP request.
- When listing the data streams list for a specific integration (second
level of the `EuiContextMenu`), the search is done in-memory, filtering
and sorting directly in the client.
- When listing the unmanaged data streams list (second level of the
`EuiContextMenu`), the search is done again with an HTTP request.

To handle these possible user journeys correctly without side effects,
we created another state machine and exposed its actions with an
internal `useDatasetSelector` custom hook.

<img width="1978" alt="Screenshot 2023-05-30 at 09 46 04"
src="84aa4247-c65d-40de-9eb6-6117bee731f8">

## Next steps

This component will change quite a lot until we won't get to a final
design. As soon as a first solid mvp is defined for production, a
complete test for the component will be implemented, among with a more
generic functional test for the core customization features.

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
2023-06-28 15:20:44 +02:00
Carlos Crespo
bc041fd467
[asset_manager] Add io-ts validations to asset endpoints (#157502)
closes https://github.com/elastic/kibana/issues/154147

## Summary

This PR introduces `io-ts` runtime validation to asset manager
endpoints.

The parameters will be validated as follows:
- `maxDistance`: range from 1 to 5
- `size`: range from 1 to 100
- `type`: `k8s.pod` or `k8s.cluster` or `k8s.node`
- `relation`: `ancestors` or `descendants` or `references`
- any date parameter: Date ISO or DateMath formats

### How to test this PR

- enable `xpack.assetManager.alphaEnabled` in kibana.dev.yml
- Call the endpoints below and try to pass invalid parameters where
they're applicable:
- `GET
kbn:/api/asset-manager/assets?from=2023-03-25T17:44:44.000Z&to=2023-03-25T18:44:44.000Z`
- `GET
kbn:/api/asset-manager/assets/diff?aFrom=2022-02-07T00:00:00.000Z&aTo=2022-02-07T01:30:00.000Z&bFrom=2022-02-07T01:00:00.000Z&bTo=2022-02-07T02:00:00.000Z`
- `GET
kbn:/api/asset-manager/assets/related?ean=k8s.node:node-101&relation=ancestors&maxDistance=1&from=2023-04-18T13:10:13.111Z&to=2023-04-18T15:10:13.111Z`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-31 14:36:56 -03:00
Marco Antonio Ghiani
6ac4e1919c
[Infrastructure UI] Implement inventory views CRUD endpoints (#154900)
## 📓  Summary

Part of #152617 
Closes #155158 

This PR implements the CRUD endpoints for the inventory views.
Following the approach used for the LogViews service, it exposes a
client that abstracts all the logic concerned to the `inventory-view`
saved objects.

It also follows the guideline provided for [Versioning
interfaces](https://docs.elastic.dev/kibana-dev-docs/versioning-interfaces)
and [Versioning HTTP
APIs](https://docs.elastic.dev/kibana-dev-docs/versioning-http-apis),
preparing for the serverless.

## 🤓 Tips for the reviewer
You can open the Kibana dev tools and play with the following snippet to
test the create APIs, or you can perform the same requests with your
preferred client:
```
// Get all
GET kbn:/api/infra/inventory_views

// Create one
POST kbn:/api/infra/inventory_views
{
  "attributes": {
    "name": "My inventory view"
  }
}

// Get one
GET kbn:/api/infra/inventory_views/<switch-with-id>

// Update one
PUT kbn:/api/infra/inventory_views/<switch-with-id>
{
  "attributes": {
    "name": "My inventory view 2"
  }
}

// Delete one
DELETE kbn:/api/infra/inventory_views/<switch-with-id>
```

## 👣 Next steps
- Replicate the same logic for the metrics explorer saved object
- Create a client-side abstraction to consume the service
- Update the existing react custom hooks to consume the endpoint

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-24 11:54:43 +02:00
Carlos Crespo
ef218cd704
[Infrastructure UI] New Infra api (#155084)
closes: [#152103](https://github.com/elastic/kibana/issues/152103)
fixes: https://github.com/elastic/kibana/issues/151768

## Summary

This PR adds a new API to return host metrics for the Hosts View page. 

The difference between this API and Snapshot API is that this one runs a
terms aggregation and the API can return a range of 1 to 500 hosts,
preventing it from returning all data.

It uses Inventory Model aggregations, so the performance should be
similar to that of the Snapshot API. The `limit` parameter is what will
allow the client to try to get a better response time from the API.

#### Snapshot API

Returns all 500 hosts

15 minutes
<img width="317" alt="image"
src="https://user-images.githubusercontent.com/2767137/230073865-d0d98ce8-76ff-4295-be9b-94f5b342c9f7.png">

1 day
<img width="317" alt="image"
src="https://user-images.githubusercontent.com/2767137/230076350-affbad3d-a498-481e-bcba-bcec019ab739.png">

1 week
<img width="317" alt="image"
src="https://user-images.githubusercontent.com/2767137/230077049-320d90c8-4f3e-47ba-bd16-1c5878a83254.png">


#### Hosts API

100 hosts limit

15 minutes
<img width="317" alt="image"
src="https://user-images.githubusercontent.com/2767137/233349080-50acdf55-d269-49f7-be97-3fc259021020.png">

1 day
<img width="317" alt="image"
src="https://user-images.githubusercontent.com/2767137/233349614-826a791a-aef5-4e7a-b103-2900c4f64f49.png">

1 week
<img width="317" alt="image"
src="https://user-images.githubusercontent.com/2767137/233350318-388ae9b3-8b7b-4365-9f32-7dcbc2342480.png">

### How to test
```bash
curl --location -u elastic:changeme 'http://0.0.0.0:5601/ftw/api/metrics/infra' \
--header 'kbn-xsrf: xxxx' \
--header 'Content-Type: application/json' \
--data '{
    "type": "host",
    "limit": 100,
    "metrics": [
        {
            "type": "rx"
        },
        {
            "type": "tx"
        },
        {
            "type": "memory"
        },
        {
            "type": "cpu"
        },
        {
            "type": "diskLatency"
        },
        {
            "type": "memoryTotal"
        }
    ],
    "query": {
        "bool": {
            "must": [],
            "filter": [],
            "should": [],
            "must_not": []
        }
    },
    "range": {
        "from": "2023-04-18T11:15:31.407Z",
        "to":   "2023-04-18T11:30:31.407Z"
    },
    "sourceId": "default"
}'
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-20 16:31:27 -03:00
Spencer
afb09ccf8a
Transpile packages on demand, validate all TS projects (#146212)
## Dearest Reviewers 👋 

I've been working on this branch with @mistic and @tylersmalley and
we're really confident in these changes. Additionally, this changes code
in nearly every package in the repo so we don't plan to wait for reviews
to get in before merging this. If you'd like to have a concern
addressed, please feel free to leave a review, but assuming that nobody
raises a blocker in the next 24 hours we plan to merge this EOD pacific
tomorrow, 12/22.

We'll be paying close attention to any issues this causes after merging
and work on getting those fixed ASAP. 🚀

---

The operations team is not confident that we'll have the time to achieve
what we originally set out to accomplish by moving to Bazel with the
time and resources we have available. We have also bought ourselves some
headroom with improvements to babel-register, optimizer caching, and
typescript project structure.

In order to make sure we deliver packages as quickly as possible (many
teams really want them), with a usable and familiar developer
experience, this PR removes Bazel for building packages in favor of
using the same JIT transpilation we use for plugins.

Additionally, packages now use `kbn_references` (again, just copying the
dx from plugins to packages).

Because of the complex relationships between packages/plugins and in
order to prepare ourselves for automatic dependency detection tools we
plan to use in the future, this PR also introduces a "TS Project Linter"
which will validate that every tsconfig.json file meets a few
requirements:

1. the chain of base config files extended by each config includes
`tsconfig.base.json` and not `tsconfig.json`
1. the `include` config is used, and not `files`
2. the `exclude` config includes `target/**/*`
3. the `outDir` compiler option is specified as `target/types`
1. none of these compiler options are specified: `declaration`,
`declarationMap`, `emitDeclarationOnly`, `skipLibCheck`, `target`,
`paths`

4. all references to other packages/plugins use their pkg id, ie:
	
	```js
    // valid
    {
      "kbn_references": ["@kbn/core"]
    }
    // not valid
    {
      "kbn_references": [{ "path": "../../../src/core/tsconfig.json" }]
    }
    ```

5. only packages/plugins which are imported somewhere in the ts code are
listed in `kbn_references`

This linter is not only validating all of the tsconfig.json files, but
it also will fix these config files to deal with just about any
violation that can be produced. Just run `node scripts/ts_project_linter
--fix` locally to apply these fixes, or let CI take care of
automatically fixing things and pushing the changes to your PR.

> **Example:** [`64e93e5`
(#146212)](64e93e5806)
When I merged main into my PR it included a change which removed the
`@kbn/core-injected-metadata-browser` package. After resolving the
conflicts I missed a few tsconfig files which included references to the
now removed package. The TS Project Linter identified that these
references were removed from the code and pushed a change to the PR to
remove them from the tsconfig.json files.

## No bazel? Does that mean no packages??
Nope! We're still doing packages but we're pretty sure now that we won't
be using Bazel to accomplish the 'distributed caching' and 'change-based
tasks' portions of the packages project.

This PR actually makes packages much easier to work with and will be
followed up with the bundling benefits described by the original
packages RFC. Then we'll work on documentation and advocacy for using
packages for any and all new code.

We're pretty confident that implementing distributed caching and
change-based tasks will be necessary in the future, but because of
recent improvements in the repo we think we can live without them for
**at least** a year.

## Wait, there are still BUILD.bazel files in the repo
Yes, there are still three webpack bundles which are built by Bazel: the
`@kbn/ui-shared-deps-npm` DLL, `@kbn/ui-shared-deps-src` externals, and
the `@kbn/monaco` workers. These three webpack bundles are still created
during bootstrap and remotely cached using bazel. The next phase of this
project is to figure out how to get the package bundling features
described in the RFC with the current optimizer, and we expect these
bundles to go away then. Until then any package that is used in those
three bundles still needs to have a BUILD.bazel file so that they can be
referenced by the remaining webpack builds.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-12-22 19:00:29 -06:00
Carlos Crespo
4a3af9c97b
[Infrastructure UI] Add parameter Snapshot API to not query using histogram (#146573)
## Summary

closes #146517 

This PR expands the current `includeTimeseries` parameter behaviour, by
not using the `date_histogram` in the `composite` aggregation when it is
set to `false`.

This way, not only the API won't return a `timeseries` object, but the
query will calculate the aggregations on ES side as opposed to when
`includeTimeseries` is true, that does an extra `avg` and `max`
calculation on TS side using the histogram buckets.

The main motivation behind this change is to run the snapshot query
without the need of returning buckets, to avoid the max bucket error.

### How to test
- Enable the system module on metricbeat
- Start a local Kibana 
- Start metricbeat
- Explore `Infrastructure > Metrics`, `Infrastructure > Inventory` and
`Infrastructure > Hosts` and play with the filters

#### cURL

##### Run a query with Composite aggregation
###### With timeseries
```bash
curl -XPOST -f 'http://0.0.0.0:5601/ftw/api/metrics/snapshot'  \
  -H 'kbn-xsrf:localhost' \
  -H 'Content-Type: application/json'  \
  --data-raw '{"filterQuery":"{\"bool\":{\"must\":[],\"filter\":[],\"should\":[],\"must_not\":[]}}","metrics":[{"type":"memory"}],"groupBy":[],"nodeType":"host","sourceId":"default","accountId":"","region":"","timerange":{"from":1670859470896,"to":1670861030896,"interval":"1m","ignoreLookback":true},"includeTimeseries":true}' \
  -u elastic:changeme
```

###### Without timeseries
```bash
curl -XPOST -f 'http://0.0.0.0:5601/ftw/api/metrics/snapshot'  \
  -H 'kbn-xsrf:localhost' \
  -H 'Content-Type: application/json'  \
  --data-raw '{"filterQuery":"{\"bool\":{\"must\":[],\"filter\":[],\"should\":[],\"must_not\":[]}}","metrics":[{"type":"memory"}],"groupBy":[],"nodeType":"host","sourceId":"default","accountId":"","region":"","timerange":{"from":1670859470896,"to":1670861030896,"interval":"1m","ignoreLookback":true},"includeTimeseries":false}' \
  -u elastic:changeme
```

##### Run a query with just Date Histogram
###### With timeseries
```bash
curl -XPOST -f 'http://0.0.0.0:5601/ftw/api/metrics/snapshot'  \
  -H 'kbn-xsrf:localhost' \
  -H 'Content-Type: application/json'  \
  --data-raw '{"filterQuery":"{\"bool\":{\"must\":[],\"filter\":[],\"should\":[],\"must_not\":[]}}","metrics":[{"type":"memory"}],"groupBy":null,"nodeType":"host","sourceId":"default","accountId":"","region":"","timerange":{"from":1670859470896,"to":1670861030896,"interval":"1m","ignoreLookback":true},"includeTimeseries":true}' \
  -u elastic:changeme
```
##### Without timeseries
```bash
curl -XPOST -f 'http://0.0.0.0:5601/ftw/api/metrics/snapshot'  \
  -H 'kbn-xsrf:localhost' \
  -H 'Content-Type: application/json'  \
  --data-raw '{"filterQuery":"{\"bool\":{\"must\":[],\"filter\":[],\"should\":[],\"must_not\":[]}}","metrics":[{"type":"memory"}],"groupBy":null,"nodeType":"host","sourceId":"default","accountId":"","region":"","timerange":{"from":1670859470896,"to":1670861030896,"interval":"1m","ignoreLookback":true},"includeTimeseries":false}' \
  -u elastic:changeme
```

### For maintainers
The `logRate` metric type <b>doesn't</b> work without being in a date
histogram, because it uses [cumulative
sum](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-cumulative-sum-aggregation.html).
Therefore `includeTimeseries` false in a `composite` aggregation will
return a 400 error. I haven't found anywhere that would make a request
like below.

#### 400 error

```bash
curl -XPOST -f 'http://0.0.0.0:5601/ftw/api/metrics/snapshot'  \
  -H 'kbn-xsrf:localhost' \
  -H 'Content-Type: application/json'  \
  --data-raw '{"filterQuery":"{\"bool\":{\"must\":[],\"filter\":[],\"should\":[],\"must_not\":[]}}","metrics":[{"type":"logRate"}],"groupBy":[],"nodeType":"host","sourceId":"default","accountId":"","region":"","timerange":{"from":1670859470896,"to":1670861030896,"interval":"1m","ignoreLookback":true},"includeTimeseries":false}' \
  -u elastic:changeme
```

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-12-16 14:34:29 +01:00
Marco Antonio Ghiani
ddcbf73284
[Infrastructure UI] Improve metrics settings error handling (#146272)
Closes [#145238](https://github.com/elastic/kibana/issues/145238)

## Summary

These changes add validation to the Metric Indices passed into the
Metrics settings page.
New validation is added both in the UI and in the endpoint, performing
the following checks:
- Index pattern is not an empty string
- Index pattern does not contain empty spaces (start, middle, end) (the
pattern is not trimmed)
- Index pattern does not contain empty entries, comma-separated values
should have an acceptable value.

In case the value is not valid, the UI will render an appropriate error
message.
If the `PATCH /api/metrics/source/{sourceId}` request to update the
value is manually sent with an invalid value, the server will respond
with a 400 status code and an error message.

Also, for retro compatibility and to not block the user when the
configuration can't be successfully retrieved, in case of internal error
the `GET /api/metrics/source/{sourceId}` will return a 404 and on the
UI, instead of rendering a blank page, the user will see the empty form
and will be able to re-insert the right values.

## Testing

Navigate to `Inventory`-> Click on `Settings` on the topbar -> Start
writing different metric indices in the Metric Indices field.

### Editing Metric Indices validation


https://user-images.githubusercontent.com/34506779/203763021-0f4d8926-ffa4-448a-a038-696732158f4e.mov

### Missing/Broken configuration response


https://user-images.githubusercontent.com/34506779/203763120-ffc91cd3-9bf4-43da-a04f-5561ceabf591.mov

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-30 11:54:37 +01:00
Tiago Costa
e41569b4a6
fix(NA): wrongly spread stripInternal and rootDir configs across packages (#144463)
* chore(NA): remove overrides for rootDir on packages

* chore(NA): replace './target_types' with 'target_types' on packages

* chore(NA): removes stripInternal false configs

* chore(NA): remove unused strip internals
2022-11-03 01:04:55 +00:00
spalger
52f2b33a07
[auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
spalger
42879f7656
[bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05:00
Kevin Delemme
c31c400174
feat(slo): Introduce calendar aligned time window (#143190) 2022-10-19 07:40:10 -04:00
Spencer
32491462a9
add kibana.jsonc files to existing packages (#138965)
* [packages] add kibana.jsonc files

* auto-migrate to kibana.jsonc

* support interactive pkg id selection too

* remove old codeowners entry

* skip codeowners generation when .github/CODEOWNERS doesn't exist

* fall back to format validation if user is offline

* update question style

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-08 13:31:57 -07:00
Tiago Costa
1cbf83f73c
chore(NA): remove src folder requirement from packages (part 2) (#138476)
* refact(NA): apply root_input_dir=src to each already created pkg

* refact(NA): update package generator

* fix(NA): correctly use rootDir

* fix(NA): use root input dir on latest introduced pkgs for jsts_transpiler macro

* chore(NA): merge with main

* chore(NA): first attempt to complete removal of src folder on a small group of pkgs

* Revert "chore(NA): first attempt to complete removal of src folder on a small group of pkgs"

This reverts commit b6f34b7530.

* chore(NA): remove src folder requirement from xpack pkgs

* chore(NA): remove src folder from analytics pkgs

* chore(NA): remove src folder from home pkgs

* chore(NA): remove src folder from shared_ux pkgs

* fix(NA): remove missing src folder inputs on sharedux pkg

* chore(NA): remove src folder from kbn-a* pkgs

* chore(NA): remove src folder from kbn-b* pkgs

* chore(NA): remove src folder from kbn-c* pkgs

* chore(NA): correct exclude pattern for each changed pkg

* chore(NA): remove src folder from kbn-y* pkgs

* chore(NA): remove src folder from kbn-e* pkgs

* chore(NA): remove src folder from kbn-f* and kbn-g* pkgs

* chore(NA): remove src folder from kbn-f* and kbn-g* pkgs

* chore(NA): remove src folder from kbn-h** pkgs

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Revert "chore(NA): remove src folder from kbn-h** pkgs"

This reverts commit dcdf72bcc1.

* fix(NA): grammar location

* test(NA): fix tests for kbn/config-schema

* test(NA): fix tests for kbn/config-schema

* chore(NA): multiple errors fixed

* chore(NA): remove kuery grammar fix

* fix(NA): @kbn/ace imports

* fix(NA): grammar location

* fix(NA): add missing files to tsconfigs

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* chore(NA): complete tsconfigs

* Revert "chore(NA): complete tsconfigs"

This reverts commit f48c616864.

* chore(NA): remove src folder from kbn-core* pkgs

* chore(NA): remove src folder from kbn-u* pkgs

* chore(NA): remove src folder from kbn-ui-shared-deps* pkgs

* chore(NA): fix problems on core pkgs

* chore(NA): fix problems on core pkgs

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* fix(NA): shared_built_assets correct location'

* test(NA): update @kbn/optimizer integration snapshots

* chore(NA): remove src folder from kbn-t* p1 pkgs

* chore(NA): remove src folder from kbn-t* p2 pkgs

* chore(NA): update rootDir on utility types pkg

* chore(NA): include missing files on @kbn/test

* chore(NA): include missing files on @kbn/test

* fix(NA): new jest preset paths on @kbn/test

* chore(NA): fix eslint

* fix(NA): new jest preset paths on @kbn/test

* chore(NA): remove exclusion for mocks folde on @kbn/test

* fix(NA): several imports from target_node

* fix(NA): @kbn/test mocha and jest types clash

* chore(NA): remove src folder from kbn-storybook pkg

* chore(NA): remove src folder from kbn-stdio-dev-helpers pkg

* chore(NA): remove src folder from kbn-std pkg

* chore(NA): remove src folder from kbn-sort-pkg-json pkg

* chore(NA): remove src folder from kbn-some-dev-log and kbn-shared-ux-utility pkgs

* chore(NA): remove src folder from kbn-ux-storybook pkg

* chore(NA): remove src folder from kbn-shared-ux-services pkg

* chore(NA): remove src folder from kbn-shared-ux-components pkg

* chore(NA): remove src folder from kbn-shared-svg pkg

* chore(NA): remove src folder from kbn-server-http-tools pkg

* chore(NA): remove src folder from kbn-securitysolution-* pkgs

* chore(NA): remove src folder from kbn-r-* pkgs

* chore(NA): remove src folder from kbn-p* pkgs

* chore(NA): remove src folder from kbn-o* pkgs

* chore(NA): remove src folder from kbn-m* pkgs

* chore(NA): remove src folder from kbn-j,k,l* pkgs

* chore(NA): remove src folder from kbn-j,k,l* pkgs

* chore(NA): remove src folder from kbn-io-ts-utils* pkgs

* chore(NA): remove src folder from kbn-* pkgs except a few

* chore(NA): update @kbn/generate

* fix(NA): wrong exclusion on kbn-storybook

* chore(NA): remove src folder from kbn-monaco pkg

* chore(NA): remove src folder from kbn-interpreter pkg

* fix(NA): wrong exclusion on kbn-storybook

* chore(NA): update every require for target_*/src

* chore(NA): remover src folder from @kbn/handlebars

* fix(NA): license for @kbn/handlebars

* chore(NA): copy templates as part of the jsts_transpiler macro for @kbn/storybook

* chore(NA): update handlebars

* fix(NA): @kbn/plugin-generator import paths

* fix(NA): bundle sizes

* fix(NA): web bundle for @kbn/i18n-react

* Revert "fix(NA): bundle sizes"

This reverts commit 8aefe84fbc.

* Revert "Revert "fix(NA): bundle sizes""

This reverts commit e9d87d72a4.

* fix(NA): @kbn/docs-utils index.ts path expectation

* chore(NA): merge and solve conflicts with main

* fix(NA): relative import to index

* chore(NA): merge and solve conflicts with main

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* chore(NA): apply eslint fix

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-08-30 15:57:35 +01:00
Tiago Costa
df8b62aa98
chore(NA): allow packages to not have an obligation for a src folder on packages (#138038)
* refact(NA): apply root_input_dir=src to each already created pkg

* refact(NA): update package generator

* fix(NA): correctly use rootDir

* fix(NA): use root input dir on latest introduced pkgs for jsts_transpiler macro

* chore(NA): merge with main

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-08-08 15:54:05 +01:00
Spencer
a3b2757e4e
[type-summarizer] reimplement for broader support (#135163)
* [type-summarizer] reimplement for broader support

* Enable sourceMaps in all packages

* include naming collision in summarizePackage test

* fix readmes

* remove unnecessary transient dependency

* remove code that was commented out

* remove outdated todo comment

* ensure errors triggered by untyped-exports are ligible

* remove unused import

* break out snippet generation from AstIndexer

* refactor several massive files into smaller pieces and add more inline docs

* fix typos

* update jest snapshots

* add sections to readme that points people to the useful parts of the source code along with a high-level overview of how the type-summarizer works

* remove --dump flag, it doesn't work

* use decName instead of calling names.get a second time

* include `export` as invalid name
2022-07-06 13:48:45 -05:00
Alejandro Fernández Haro
f7a1739dc0
Use target_web to ensure browser compatibility (#130874) 2022-05-05 21:20:51 +02:00
spalger
3730dd0779 fix all violations 2022-04-16 01:37:30 -05:00
Spencer
614139b8e5
[bazel] avoid a little boilerplate in packages (#126309)
* [bazel] avoid a little boilerplate for @types packages

* [bazel/ts] stop building sourcemaps since they're ignored
2022-02-24 12:43:12 -06:00
Tiago Costa
735948de4d
chore(NA): splits types from code on @kbn/io-ts-utils (#123431)
* chore(NA): splits types from code on @kbn/io-ts-utils

* chore(NA): missing import keys

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-21 00:17:38 +00:00
Tiago Costa
9d6955ce35
chore(NA): splits types from code on @kbn/config-schema (#120385)
* chore(NA): splits types from code on @kbn/config-schema

* chore(NA): expose needed type

* chore(NA): fix api changes

* chore(NA): expose needed type
2021-12-03 21:30:26 +00:00
Spencer
4e443cca4f
[kbn/io-ts] export and require importing individual functions (#117958) 2021-11-09 11:42:39 -07:00
Tyler Smalley
4681a80317
[DX] Upgrade prettier to v2.4.0 (#112359)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-09-19 22:34:30 -07:00
Tiago Costa
7c4e4f507b
chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620)
* chore(NA): replace babel config files by inline presets by default in the js_ts_transpiler rule

* chore(NA): update @kbn/ace build to exclude worker file

* chore(NA): remove config file support

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 21:17:46 +01:00
Tiago Costa
79f1e18686
chore(NA): moving @kbn/io-ts-utils to babel transpiler (#108517)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-13 18:39:35 +01:00
Dario Gieselaar
a474a63a7f
[APM] Make environment & kuery required (#108338) 2021-08-13 09:50:14 -04:00
Spencer
c0395c9ef6
[build_ts_refs] improve caches, allow building a subset of projects (#107981)
* [build_ts_refs] improve caches, allow building a subset of projects

* cleanup project def script and update refs in type check script

* rename browser_bazel config to avoid kebab-case

* remove execInProjects() helper

* list references for tsconfig.types.json for api-extractor workload

* disable composite features of tsconfig.types.json for api-extractor

* set declaration: true to avoid weird debug error

* fix jest tests

Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-08-10 22:12:45 -07:00
Dario Gieselaar
821aeb1ff4
[APM] Typed client-side routing (#104274)
* [APM] @kbn/typed-router-config

* [APM] typed route config

* Breadcrumbs, wildcards

* Migrate settings, home

* Migrate part of service detail page

* Migrate remaining routes, tests

* Set maxWorkers for precommit script to 4

* Add jest types to tsconfigs

* Make sure transaction distribution data is fetched

* Fix typescript errors

* Remove usage of react-router's useParams

* Add route() utility function

* Don't use ApmServiceContext for alert flyouts

* Don't add onClick handler for breadcrumb

* Clarify ts-ignore

* Remove unused things

* Update documentation

* Use useServiceName() in ServiceMap component
2021-07-15 11:30:59 +02:00
Dario Gieselaar
b51af01adc
[APM] Support records in strict_keys_rt (#103391)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-28 20:03:30 +02:00
Tiago Costa
b575a4545f
chore(NA): moving @kbn/io-ts-utils into bazel (#100810) 2021-05-28 15:02:44 +01:00
Dario Gieselaar
5bb9eecd26
[RAC] Populate Observability alerts table with data from alerts indices (#96692)
* Set up Observability rule APIs

* Populate alerts table with data from API

* Move field map types/utils to common

* Format reason/link in alert type

* Format reason/link in alert type

* Fix issues with tsconfigs

* Storybook cleanup for example alerts

* Use `MemoryRouter` in the stories and `useHistory` in the component to get the history
* Replace examples with ones from "real" data
* Use `() => {}` instead of `jest.fn()` in mock registry data

* Store/display evaluations, add active/recovered badge

* Some more story fixes

* Decode rule data with type from owning registry

* Use transaction type/environment in link to app

* Fix type issues

* Fix API tests

* Undo changes in task_runner.ts

* Remove Mutable<> wrappers for field map

* Remove logger.debug calls in alerting es client

* Add API test for recovery of alerts

* Revert changes to src/core/server/http/router

* Use type imports where possible

* Update limits

* Set limit to 100kb

Co-authored-by: Nathan L Smith <smith@nlsmith.com>
2021-04-15 18:25:50 +02:00
Dario Gieselaar
bfc940c146
[APM] Extract server type utils to package (#96349) 2021-04-08 13:26:43 +02:00