Commit graph

564 commits

Author SHA1 Message Date
Pierre Gayvallet
808c28dd8e
Migrate from deprecated EUI components (#161548)
## Summary

Fix https://github.com/elastic/kibana/issues/161424

Migrate away from deprecated EUI components for Core-owned code.

Note: I only tested the production (and examples) pages properly, I
didn't make sure the test plugins where displayed correctly, as long as
the data structure was still here for the tests to pass.

### Screenshots

#### Status page

<img width="1388" alt="Screenshot 2023-07-10 at 17 14 24" 

src="d15adffa-d4fb-4dab-ad91-691a4c103541">

#### AppNotFound page

<img width="1352" alt="Screenshot 2023-07-10 at 17 14 40"
src="77dcc958-db53-4ec8-9a7f-af4ea0804a96">

#### Generated plugin landing page

<img width="1906" alt="Screenshot 2023-07-10 at 17 15 44"
src="7a45d1a3-181d-44c5-a4a1-d3bdb2ba6ee9">

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-13 03:22:02 -07:00
Ignacio Rivas
7c333cdc33
[Index Management] Disable certain actions for serverless (#161528) 2023-07-13 07:27:13 +02:00
Dario Gieselaar
4ae94c3502
[Observability] Add feedback buttons for prompts (#160351)
Co-authored-by: Sean Heelan <sean@optimyze.cloud>
2023-07-12 15:58:13 -04:00
Ignacio Rivas
68b3baec93
[Deployment management] Mark devtools and management sidenav deeplinks as visible on serverless (#161227) 2023-07-11 10:31:21 +02:00
Nicolas Chaulet
7709670d92
[Fleet] Implement active agent soft limit (#161289) 2023-07-06 14:50:33 -04:00
Thom Heymann
6b02be4488
Restrict ability to disable features within a Space (#160416)
Resolves https://github.com/elastic/kibana/issues/159392

## Summary

This PR hides the feature visibility section on the space management
screen and disables adding `disabledFeatures` when creating or updating
spaces using the REST API or spaces client on serverless.

## Screenshot

![Spaces-Elastic
(2)](14d4900b-989d-420c-bddf-5ff70d305934)

## Testing

1. Start Kibana in serverless mode: `yarn start --serverless`
2. Edit default space and observe that the feature visibility section is
not rendered
3. Quit Kibana and restart using classic mode: `yarn start`
4. Edit default space and observe that the feature visibility section is
rendered correctly
5. Other considerations:
- Disabling feature visibility in the classic offering should throw an
error (`xpack.spaces.allowFeatureVisibility: false`)
- Enabling feature visibility on serverless should throw an error
(`xpack.spaces.allowFeatureVisibility: true`)
2023-07-03 21:02:31 +01:00
Sébastien Loix
dea3423b2f
[Cloud] Update support and user profile header menus (#160535) 2023-07-02 20:29:07 +01:00
Katerina Patticha
1a21965403
[Serverless] Observability side navigation (#160620)
fixes: https://github.com/elastic/kibana/issues/159681
fixes: https://github.com/elastic/kibana/issues/153777


<img width="1470" alt="image"
src="eb810c65-c780-4597-9570-4b30cf2e1b09">


### Related
ML deep links won't show until it's merged
https://github.com/elastic/kibana/pull/159433

### Test
- e2e will be covered https://github.com/elastic/kibana/pull/160674
2023-06-28 16:55:35 +02:00
Nicolas Chaulet
c3b8ed278d
[Fleet] Disable proxies feature in serverless (#160317) 2023-06-23 14:53:23 -04:00
Patryk Kopyciński
a1d02824f1
[shared-ux-router] Add Router and Routes components (#159834)
## Summary

Why?

To simplify the process of migration to react-router@6.
https://github.com/remix-run/react-router/discussions/8753

What problems exactly it solves?

- In my previous PR I added `CompatRouter`
https://github.com/elastic/kibana/pull/159173, which caused changes in
~50 files and pinged 15 Teams. And this is just meant to be a temporary
change, so when we're done with the migration I would have to revert
these changes and engage everyone to review the PR again. And it is just
a single step in the migration strategy. So to make our lives easier I
think it would be better to have a common place where we do import our
router components because it will allow us to surface some extra logic
in single place instead of going through the whole source code again.

- `react-router@6` doesn't support a custom `Route` component, so that
means our custom `Route` component that we're using almost everywhere
today, will need to be replaced by a different solution. I have decided
to add `Routes` component, which will be responsible for rendering the
proper component (`react-router@6` renamed `Switch` to `Routes`, so I
have named this component to align with the dictionary of the new
router) and also is going to add the logic that today is done in `Route`
(moving logic to `Routes` will be done in the follow-up PR, here I just
wanted to focus on using the common router components to make the review
process easier)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-23 10:02:06 -05:00
Dario Gieselaar
c5dace2e3b
[Observability] Rename coPilot settings to aiAssistant (#160144) 2023-06-21 08:33:07 -07:00
Alejandro Fernández Haro
0b91e6db9b
[Snapshot Telemetry] Use Serveless-specific channels (#159677)
## Summary

Resolves #159234.

It changes the Snapshot Telemetry channels to be different when running
on Serverless. They have the suffix `{channel}-serverless` as agreed
with the Platform Analytics team.

### 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

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-21 00:31:36 -07:00
Alejandro Fernández Haro
e72da6dd3c
[Telemetry] Flaky test 159929 (#159950)
Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-20 16:04:11 -07:00
Kibana Machine
077452e374 skip failing test suite (#159929) 2023-06-20 14:12:46 -04:00
Kibana Machine
b88c11d708 skip failing test suite (#159929) 2023-06-20 04:40:47 -04:00
Miriam
56ac338d11
add feature flags to apm config and serverless.oblt.yml (#159136)
Closes https://github.com/elastic/kibana/issues/159040

Add configuration values to hide UI components and block api in
serverless.oblt.yml

Examples

Non Serverless
<img width="1791" alt="image"
src="6657830c-7c0c-460d-bd57-e63eb8b72d6f">

Serverless
<img width="1273" alt="image"
src="be437d99-91fc-43f5-b344-c49593a33f30">
2023-06-19 11:18:00 +01:00
Alejandro Fernández Haro
195216f0ec
[Serverless Telemetry] Add serverless label to inform of the project type (#159549)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-14 18:05:04 +02:00
Faisal Kanout
2d4f19e2ac
[AO] Create a new rule under Observability plugin based on the metrics threshold rule (#158665)
## Summary
### NOTE: This is a draft PR to MVP the new rule combination
(Threshold). More PRs to follow up
It fixes https://github.com/elastic/kibana/issues/158260 by providing
the _new_ **Threshold rule**
It fixes https://github.com/elastic/kibana/issues/159326

<img width="586" alt="Screenshot 2023-05-30 at 17 55 32"
src="0e485266-d93f-442e-81f4-77aa673ed497">


##  Done 

- [x] Clone the Metric threshold and update the imports 
- [x] The rule is listed in the rule creation flyout with its params and
preview charts
- [x] Working Rule registry
- [x] Working Rule executor 
- [x] Working feature id in the rule registry 
- [x] Working alerts table and alert summary
- [x] Use DataView instead of the Metrics indices under settings
- [x] Update the i18n keys 
- [x] Fix/Update failing checks/tests. Green CI  
- [x] Hide it behind a feature flag
`xpack.observability.unsafe.thresholdRule.enabled`




## 🏗️ To be done (could be irrelevant, or create a separate issue for
it):
- [ ] <del> Remove the `metrics` word </del>
- [ ] <del> Update file and variable names to match the new rule
context.</del>
- [ ] <del> Rearrange files, constants, and exports </del>

## 🎯 DoD 
Having the rule working like the Metric threshold one and seeing its
related alerts.

---------
2023-06-09 17:59:55 +02:00
Achyut Jhunjhunwala
ac2fc4c3be
[APM] Serverless Onboarding with Custom Tutorials (#158228)
Closes https://github.com/elastic/kibana/issues/155371
## Summary

PR adds Serverless Onboarding flow using Custom Integration. This would
also lay the foundation for us to complete get rid of Home Tutorial App
and move the remaining `onPrem` and `cloud` tutorials which are
currently still loaded using Home Tutorial App.

1. Adds new Custom Integration for Serverless Onboarding (Toggling Home
AApp Tutorial Integration)
2. Since we are migrating away from the Home App Tutorials, lot of
existing code has been duplicated and refactored for the custom
implementation. Home App Tutorial would require the Server to register
all the steps and the client to only register a custom component which
then would be loaded by Home App Tutorial component. We don't need to
follow this approach any more. All the UX logic has now been moved to
the Public folder with only Custom Integration done on the
`server/plugin.ts`.
3. As we are not sure how the solutions will be informed about being
running on Serverless or not, I have introduced a new variable in
`serverless.oblt.yml` file called `xpack.apm.serverlessOnboarding:
true`. With this the development has been done. This can be changed to
actual logic once we know more.

4. A new configuration `xpack.apm.managedServiceUrl` for accessing
Managed Service URL is also being added by Control Plane team as part of
https://elasticco.atlassian.net/browse/CP-2403. Hence this PR expects
this property to be present for Serverless.

5. Unit tests to toggle between `secret_token` and `api_key` depending
on availability has been added. No API Tests were added as no new API
created. Cypress Tests cannot be added due to Serverless

## Need help reviewing the PR ?

1. `config/serverless.oblt.yml` - Adds the new flag which would enable
this flow
2. `x-pack/plugins/apm/common/tutorial/tutorials.ts` - Defines the
configuration required to register the APM's Tutorial Custom Integration
3. `x-pack/plugins/apm/public/components/app/tutorials/commands` - This
directory contains all the agent specific data required to load the
TABLE with settings required for configuring APM MIS.
4. `x-pack/plugins/apm/public/components/app/tutorials/instructions` -
This folder contains all the individual agent specific instructions in
the format used by
[EuiSteps](https://eui.elastic.co/#/navigation/steps#complex-steps)
5. `x-pack/plugins/apm/public/components/routing` - Here we register our
custom route
6. Changes on the server side a quite small and they only register the
custom integration.
7.
`x-pack/plugins/apm/public/components/app/tutorials/serverless_instructions.tsx`
- This file currently defines all the logic for registering Serverless
instructions. We will soon have similar files for `onPrem` and `cloud`
instructions

### Risk Matrix


| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| The flow depends on presence of a flag in `kibana.yml` file. | Low |
High | By default this flow will be disabled and would fallback to
traditional onboarding in absence of the flag. |

### Demo



d60f0610-1fea-4540-86f5-2d72ab97f640

### Updated Demo with Create API Button inside the table


e84d8d6c-a048-4638-9b63-45080feca90b

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-07 07:20:50 -07:00
Thom Heymann
0f6eca7aa0
Hide create spaces button when limit is reached (#159102)
Resolves #159028 
Resolves #159047

## Summary

Hide create spaces button when limit is reached. 

## Screenshot


![Spaces-Management-Disabled](587dc47b-0377-4f72-8faa-7e6652cdab96)

## Testing

1. Set the maximum number of allowed spaces to 1

```yml
xpack.spaces.maxSpaces: 1
```

2. Verify that the create spaces button is hidden and that a callout is
displayed

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-07 13:24:55 +01:00
Dario Gieselaar
4a5dcbdea8
[Observability] Co-pilot (tech preview) (#158678) 2023-06-07 04:42:03 -07:00
Nathan Reese
0eab3fbea3
input control read only (#158853)
Part of https://github.com/elastic/kibana/issues/154307

### Test
* Start kibana with `yarn start --serverless=es`
* set the following yaml configuration values
    ```
    input_control_vis.readOnly: true
    ```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-02 09:08:06 -06:00
Alejandro Fernández Haro
312ba3a758
[Telemetry] Update notice message (#158669)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
2023-06-01 17:53:02 +02:00
Marco Antonio Ghiani
1c1f016010
[Logs UI] Limit target_app config usage to serverless env (#158649)
## 📓 Summary

Closes #157042 

After the implementation of
https://github.com/elastic/kibana/pull/156837, we are now able to limit
the `logs.app_target` configuration to be accepted only in a serverless
environment, otherwise, it'll not be accepted.

Since we still need to use a default fallback value for the logs UI app,
the fallback will be applied internally when looking for this config, to
keep the original behaviour unchanged.

## 🧪 Testing

### Serverless environment
- Start Elasticsearch with `yarn es snapshot` and Kibana with `yarn
serverless-oblt`
- Verify that when navigating to Logs pages through the sidebar links or
directly accessing the url `/app/logs` it redirects to discover.

### Normal environment
- Start Elasticsearch with `yarn es snapshot` and Kibana with `yarn
start`
- Verify that when navigating to Logs pages through the sidebar links or
directly accessing the url `/app/logs` the log stream is rendered
correctly.

### Limited to serverless env
To verify that the configuration is only accepted under a serverless
context, set into your kibana.yml or `kibana.dev.yml` the configuration
```yml
xpack.infra.logs.app_target: discover
```
and verify that it triggers a validation error when running Kibana.

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-31 06:48:38 -07:00
Julia Rechkunova
8d399fe3aa
[UnifiedFieldList] Remove redundant server routes. Create new example plugin for unified field list components and migrate tests. (#158377)
- Closes https://github.com/elastic/kibana/issues/147885
- Closes https://github.com/elastic/kibana/issues/157109

## Summary

**Before:**

Unified Field List plugin has internal routes (wrappers for client code)
which exist only to run api functional tests against them:
 - `/api/unified_field_list/existing_fields/{dataViewId}`
 - `/api/unified_field_list/field_stats`

Client code does not call these routes directly. So there is no reason
in keeping and versioning them.

**After:**
- Internal routes are removed 
- A new "Unified Field List Examples" page was created
http://localhost:5601/app/unifiedFieldListExamples
- API functional tests (which used the routes) were converted to
functional tests against this new example page
- Created a new `unifiedFieldList` page object which is used now in
functional tests (methods are extracted from existing `discover` page
object).

**For testing:**

Steps:
1. Run Kibana with examples: `yarn start --run-examples` 
2. Install sample data
3. And navigate to Developer Examples > Unified Field List Examples
page.

![May-26-2023
13-24-03](5a2149f7-beb8-40a5-b7d5-9eeaabfd42ca)


### 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-05-31 13:25:47 +02:00
Nicolas Chaulet
0ff50e14cd
[Fleet] Disable requirement for Fleet server with standalone fleet server (#158633) 2023-05-30 15:13:50 -04:00
Nathan Reese
21151dd39f
[visualizations] read only config flag for vis_types (#158507)
Part of https://github.com/elastic/kibana/issues/154307

### Overview
PR adds `readOnly` configuration to all vis_type plugins.

### Test
* Start kibana with `yarn start --serverless=es`
* set the following yaml configuration values
    ```
    vis_type_gauge.readOnly: true
    vis_type_heatmap.readOnly: true
    vis_type_metric.readOnly: true
    vis_type_pie.readOnly: true
    vis_type_table.readOnly: true
    vis_type_tagcloud.readOnly: true
    vis_type_timelion.readOnly: true
    vis_type_timeseries.readOnly: true
    vis_type_vislib.readOnly: true
    vis_type_xy.readOnly: true
    ```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-05-30 12:45:31 -06:00
Nathan Reese
34e26250f0
[tsvb] read only mode (#157920)
part of https://github.com/elastic/kibana/issues/154307

PR adds ability to put TSVB into read only mode - preventing TSVB
visualizations from being created and edited.

To test:
* start kibana with `yarn start --serverless=es`
* add `vis_type_timeseries.readOnly: true` to kibana.yml

Visualization public plugin changes:
* Removes `hideTypes` from VisualizationSetup contract. Used by Maps
plugin to set "hidden" to true for tile_map and region_map visualization
types. In 8.0, tile_map and region_map visualization type registration
moved into maps plugin so `hideTypes` no longer needed.
* Renamed vis type definition `hidden` to `disableCreate`.
* Added `disableEdit` to vis type definition.
* Hide edit link in dashboard panel options when `disableEdit` is true
* Does not display links and edit action in listing table when
`disableEdit` is true

Visualization server plugin changes:
* Add `readOnlyVisType` registry to set up contract
* Update visualization savedObject.management.getInAppUrl to return
undefined when vis type has been registered as readOnly.
* Prevents "readOnly "visualization types from being displayed in global
search results
* Prevents "readOnly "visualization types from having links in saved
object management listing table.

Timeseries server plugin changes:
* Add `readOnly` yaml configuration
* Expose `readOnly` yaml configuration to public
* When `readOnly` is true, call
VisualizationsServerSetup.registerReadOnlyVisType to mark vis type as
read only

Timeseries public plugin changes:
* Set disableCreate and disableEdit to true when `readOnly` is true

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-05-24 15:28:25 -06:00
Elena Stoeva
0a0ead25fd
[Serverless] Disable UI of Users, Roles, and Role Mappings (#158186)
Partially addresses https://github.com/elastic/kibana/issues/157756

## Summary

This PR makes the UI of the following Security apps disable-able for
serverless:
- Users
- Roles
- Role Mappings


**How to test:**

1. Start Elasticsearch with `yarn es snapshot` and Kibana with yarn
`serverless-{mode}` where `{mode}` can be `es`, `security`, or `oblt`.
2. Verify that the Users app is not accessible and its path
(`management/security/users`) leads to the Stack Management landing
page.
3. Verify that the Roles app is not accessible and its path
(`management/security/roles`) leads to the Stack Management landing
page.
4. Verify that the Role Mappings app is not accessible and its path
(`management/security/role_mappings`) leads to the Stack Management
landing page.

Test the Security apps in regular (non-serverless) mode:
1. Start Elasticsearch with `yarn es snapshot` and Kibana with `yarn
start`.
2. Verify that Users, Roles, and Role Mappings apps work as expected.
2023-05-23 18:24:12 +01:00
Tre
d1feb43722
[QA] Fixup flaky test (#156373)
## Summary

Resolves https://github.com/elastic/kibana/issues/136856

- Add async keyword where it should have been.
- Split archive into kbn and es archives...
instigated by Pierre's comment:
https://github.com/elastic/kibana/issues/136856#issuecomment-1253609280
   - Note: Had to use both archive types as 
one archive is "hidden", and cannot be accessed via the kbn client.
 - Unload via Pierre's "new" clean method.
- Add shell fn to print out server's currently loaded so's, with user
and pass hardcoded for local dev.
2023-05-08 11:32:53 +01:00
Christiane (Tina) Heiligers
0858b388f4
[Saved Objects] Adds managed to import options (#155677)
Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-27 11:17:42 -07:00
Clint Andrew Hall
8e37b38417
[serverless] Create the Serverless Plugin (#155582)
> Derived from https://github.com/elastic/kibana/pull/153274 for
production.

## Summary

This PR creates the `serverless` plugin for Kibana Serverless projects.


![image](https://user-images.githubusercontent.com/297604/233892935-b3713575-a2f7-4e82-a9dd-e8c11823683f.png)


It uses the methodology proven out in the proof-of-concept
(https://github.com/elastic/kibana/pull/153274) and prepares it for
production:

- Adds chrome style and related API to the `chrome` services.
- Creates the `serverless` plugin.
- Invokes the new chrome style API for all serverless projects.
- Alters `yarn` scripts to support all project types, and switching
between them.
- Creates the new "Project Switcher" component for use in the new chrome
header for Serverless.
- Creates a Storybook config for this and future components.
- Adds API endpoint to trigger project switching and `Watcher` restarts.

<img width="1598" alt="Screenshot 2023-04-26 at 10 44 01 AM"
src="https://user-images.githubusercontent.com/297604/234612654-fdcf38ea-8c48-4066-bc85-507f40c984aa.png">


## Next steps

- [x] Creating a PR for enabling/disabling related plugins for
Serverless. (https://github.com/elastic/kibana/pull/155583)
- [ ] Creating product plugin PR based on
https://github.com/elastic/kibana/pull/153274.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-26 11:48:23 -07:00
Devon Thomson
049c51093b
[Dashboard] fix custom time ranges not applied to panel until global query context changes (#155458)
Fixes https://github.com/elastic/kibana/issues/155409

https://github.com/elastic/kibana/pull/152516 incorrectly attempted to
resolve https://github.com/elastic/kibana/issues/151221.
https://github.com/elastic/kibana/pull/152516 updated shouldFetch$ to
only check searchSessionId to determine if re-fetching is required. This
logic did not work when custom time ranges are applied to panels since
custom time ranges do not require new search session id yet the time
range changed.

This PR reverts shouldFetch$ logic of only checking searchSessionId to
determine if re-fetching is required.

Instead, this PR moves searchSessionId out of input and into dashboard
instance state. That way, `input` updates, such as query, do not trigger
additional `input` updates. The PR also updates seachSessionId logic
from async to sync so that dashboard can update seachSessionId on input
changes prior to child embeddables updating to parent input changes.
This avoids the double fetch and allows children to only have a single
input update on query state change.

There was a functional test, panel_time_range, that should have caught
the regression but that test had a bug in it. The assertion that the
custom time range was applied looked like `expect(await
testSubjects.exists('emptyPlaceholder'))` which will never fail the test
because the last part of the expect is missing. Instead, the statements
should be `expect(await
testSubjects.exists('emptyPlaceholder')).to.be(true)`. These updates to
the functional test would have caught the regression (I verified this by
making these changes on main and running the test. They do indeed fail).

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: nreese <reese.nathan@elastic.co>
2023-04-26 07:02:59 -06:00
Oliver Gupte
077245606b
[APM] Create plugin for logs onboarding (#154728)
Closes #154733

Creates a new plugin for logs onboarding with wizard to organize steps
into discrete views.

#### TODO:
- [x] rename plugin to observability_onboarding
- [x] configure: UI and server plugin
- [x] enable/disable new plugin
- [x] remove the link to it from Observability nav

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Yngrid Coello <yngrid.coello@elastic.co>
Co-authored-by: Yngrid Coello <yngrdyn@gmail.com>
2023-04-25 11:14:21 -04:00
Marco Antonio Ghiani
b40b89e711
[Logs UI] Redirect Logs UI to Discover when in serverless mode (#154145)
## 📓 Summary

Closes #153890

The implementation creates a new LogsApp service where we should keep
any logic concerned with what `target_app` parameter is configured and
the actions related to a specific configuration. I thought it could be a
good approach to avoid drilling down the global config till we need it
and keep it cleaner by injecting only the service with predefined
actions.

In this first case, we create a redirect to discover using its locator,
and the exposed method can be used anywhere across the app for
triggering the redirect.

## 🧪 Testing

### Normal behaviour

When Kibana is used as always, we want to keep the current behaviour and
the user will stay on the Logs UI pages.
- Launch the Kibana dev environment with `yarn start`
- Navigate to Logs UI
- Verify the navigation works normally and that no redirect to Discover
occurs

### Serverless behaviour

When Kibana is used in serverless mode, we want to redirect any user
landing to Logs UI to the Discover page, configuring the same data view
or creating an ad-hoc one starting from the index pattern
- Launch the Kibana dev environment with `yarn serverless-oblt`
- Navigate to Logs UI
- Verify to be redirected to Discover and a temporary data view is
created from the current index pattern

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-19 08:30:45 -07:00
Yngrid Coello
628db34d8a
[APM] Display latest agent version in agent explorer (#153643)
Closes https://github.com/elastic/kibana/issues/152326.

### Changes
- `fetchWithTimeout` function was added, so we can fetch the external
bucket where the versions are with a timeout. This is mostly useful for
air-gapped environments.
- `fetchAgentsLatestVersion` was introduced an it's in charge of
fetching the bucket and handling the errors accordingly.
- `getAgentsItems` now returns `latestVersion` property for each agent.
- New column was created in the UI to list the latestVersion per agent.

When no timing out


https://user-images.githubusercontent.com/1313018/227519796-e5569475-451d-4c04-8243-d18c8e7126c3.mov

When timing out


https://user-images.githubusercontent.com/1313018/227520011-ae616a07-e87b-4d0f-bd29-4b3338aa5df2.mov

### Pending

- [ ] Replace bucket URL with production bucket url

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-11 14:31:13 +02:00
Jonathan Buttner
234d48d9bc
[Cases] Adding files configuration fields (#154013)
Fixes: https://github.com/elastic/kibana/issues/151935

This PR allows the mime types and max file size for the files
functionality within cases to be configured through the kibana.yml. We
set the defaults maxSize to be 100 mb and if it is not set by the user
we also restrict images to be 10 mb. If the `maxSize` is set by the user
we use it for all mime types including images (or whatever the user has
specified in `allowedMimeTypes`).

The file service changes are just mocks to help with testing some of the
configuration options.

New fields

```
{
  files: {
    allowedMimeTypes: string[]
    maxSize: positive number (minimum 0) <-- exposed to the browser
  }
}
```

## Release Notes
Cases added two configuration options to allow users to control which
files mime types are allowed to be attached to cases and the approved
max size of a file being upload.

`xpack.cases.files.allowedMimeTypes` - An array of strings representing
the allowed mime types to be attached to a case.
`xpack.cases.files.maxSize` - A number representing the file size limit
for files being attached to a case (in bytes).
2023-04-03 15:01:01 -04:00
Chris Cowan
2bd3e8dd20
Remove feature flag for APM Alert Details page (#150475)
## Summary

This PR removes the
`xpack.observability.unsafe.alertDetails.apm.enabled` feature flag to
enable the Alert Detail page for the APM Latency Threshold Rule. I've
also removed the`alertDetailsAppSection` options along with the
`alertDetailsUrl` action context variable for the remaining APM rules
since the APM Alert Detail page should only be available for the APM
Latency Threshold rule.

I also changed`isAlertDetailsEnabledPerApp()` method to allow the
`apm.transaction_duration` rule type to work but not `apm.error_rate`,
`apm.transaction_error_rate`, or `apm.anomaly` rule types. This change
was necessary because the granularity of the feature flag was set to the
solution level and didn't allow to set the flag per rule type.

### Testing

To test this PR you will need to have some APM data in your cluster.
1. Create an APM Latency Threshold Rule with a low threshold so it will
trigger
2. Create an APM Error Count Rule with a low threshold so it will
trigger
3. Click on the "Action Menu" (the ellipses) in the alert (in the Alert
Table) for the latency threshold alert
4. Click on the "View alert details" menu item for the latency threshold
alert
5. Verify it takes you to the new "alert details" page for APM
6. Repeat steps 3 & 4 for the error count alert BUT it should open the
"alert flyout" instead.

---------

Co-authored-by: Faisal Kanout <faisal.kanout@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-03-20 16:32:55 -07:00
Rodney Norris
425c236962
[Enterprise Search] Support pages without ent-search (#152969)
## Summary

Introduces new config properties related to running `enterprise_search`
plugin without the `ent-search` service running. All three default to
`true` and retain the current behavior when they are set to `true`.

`canDeployEntSearch` - Setting to false will result in not showing the
Setup Guide for content pages when `config.host` is not set. Essentially
ungating indices, engines etc. pages.
`hasConnectors` - setting to `false` will result in hiding the connector
ingestion method when creating a new index.
`hasDefaultIngestPipeline` - setting to `false` will result in hiding
the index Pipelines and Content Settings page, until we can migrate
management of default ingest pipeline to the ES module
`hasNativeConnectors` - setting to `false` will result in hiding the
native connector ingestion method when creating a new index.
`hasWebCrawler` - setting to `false` will result in hiding the web
crawler ingestion method when creating a new index.

`hasNativeConnectors` & `hasWebCrawler` are intended to be temporary and
can be removed once we are sure the connectors service and web crawler
will be available in serverless.
2023-03-14 12:09:27 -04:00
Kevin Delemme
a04c420569
feat(slo): remove feature flag (#152834) 2023-03-08 12:45:05 -07:00
Christiane (Tina) Heiligers
527417590f
Removes FindQueryHTTP['fields'] option in Saved Objects Management (#152306)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-28 10:46:08 -07:00
Clint Andrew Hall
00ab82ecd7
[drift] Determine if trial is active (plus buffer) before showing chat. (#151548)
## Summary

In-app chat should only be enabled in Cloud if a trial is still active.
https://github.com/elastic/kibana/pull/143002 added metadata including
`trial_end_date`. This PR:

- adds a config key to `cloud_integrations` for a `trialBuffer`, in
days, which defaults to ~~`30`~~ `60`.
- adds logic to not display chat if the trial end date + buffer exceeds
the current date.
- adds logic to not add a server route if the trial end date + buffer
exceeds the current date.

## Testing Locally

Add the following config to `kibana.dev.yml`:

```
xpack.cloud.id: "some-id"
xpack.cloud.trial_end_date: "2023-02-21T00:00:00.000Z"

xpack.cloud_integrations.chat.enabled: true
xpack.cloud_integrations.chat.chatURL: "https://elasticcloud-production-chat-us-east-1.s3.amazonaws.com/drift-iframe.html"
xpack.cloud_integrations.chat.chatIdentitySecret: "some-secret"
```

And start Kibana. You can optionally change the default of `30` days by
adding `xpack.cloud_integrations.chat.trialBuffer`.

## Storybook

Run `yarn storybook cloud_chat`.

## Testing in Cloud

Set the same config keys as above on a Cloud deployment.
2023-02-22 16:34:44 -05:00
Rachel Shen
50a4fc4916
[Shared UX] Adoption of Shared UX Route component (#150357)
## Summary

This PR removes all imports of Route from react-router-dom and
'@kbn/kibana-react-plugin/public' and instead imports Route from
@kbn/shared-ux-router.

### Context
Based on
https://github.com/elastic/kibana/issues/132629#issue-1243243678 This PR
executes steps 2 - 4:

> 2. To make the transition easier, we want to re-export other
react-router-dom exports alongside the modified' Route'.
> 3. Solutions should start using that Route component in place of the
one from react-router-dom. I.e. replace all occurrences of import { ...
} from 'react-router-dom' with import { ... } from
'@kbn/shared-ux-router'.
> 4. All manual calls to useExecutionContext are not needed anymore and
should be removed.

### Future PR

Looks like this might be getting worked on in:
https://github.com/elastic/kibana/pull/145863 (thanks!)

> Introduce an ESlint rule that ensures that react-router-dom is not
used directly in Kibana and that imports go through the new
@kbn/shared-ux-router package.

This is tangentially accomplished through
https://github.com/elastic/kibana/pull/150340 but only addresses using
Route through @kbn/kibana-react-plugin/public'


### Checklist

Delete any items that are not applicable to this PR.

- [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>
Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
2023-02-14 19:25:04 +00:00
Mark Hopkin
687294d4d3
[Fleet] Bugfix: prevent status runtime query going over character limit (#150910)
## Summary

Closes #150577 

if there are too many agent policies in a system, we were creating too
big a runtime query for elastic and the query would be rejected.

This PR adds a limit, if the user has more than 750 agent policies then
agents will not be marked as inactive anymore. If the user reaches the
limit then a warning badge is displayed (the text underlined has also
been added):

<img width="968" alt="Screenshot 2023-02-13 at 20 14 31"
src="https://user-images.githubusercontent.com/3315046/218565456-f5758e4b-74f6-4e7c-9b49-22f0fd6f9102.png">


Integration test added.
2023-02-14 07:05:34 -07:00
Alejandro Fernández Haro
58c68c94d4
[Telemetry] Fix OptedOut banner (#151084)
Resolves #135107.
2023-02-14 13:53:55 +01:00
Spencer
1b85815402
[packages] migrate all plugins to packages (#148130)
Fixes https://github.com/elastic/kibana/issues/149344

This PR migrates all plugins to packages automatically. It does this
using `node scripts/lint_packages` to automatically migrate
`kibana.json` files to `kibana.jsonc` files. By doing this automatically
we can simplify many build and testing procedures to only support
packages, and not both "packages" and "synthetic packages" (basically
pointers to plugins).

The majority of changes are in operations related code, so we'll be
having operations review this before marking it ready for review. The
vast majority of the code owners are simply pinged because we deleted
all `kibana.json` files and replaced them with `kibana.jsonc` files, so
we plan on leaving the PR ready-for-review for about 24 hours before
merging (after feature freeze), assuming we don't have any blockers
(especially from @elastic/kibana-core since there are a few core
specific changes, though the majority were handled in #149370).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-08 21:06:50 -06:00
Jean-Louis Leysens
df809bd53a
[Saved objects] Prepare SO management for versionable types (#149495)
## Summary

Part of preparing HTTP APIs and associated interfaces for versioning:

* Add domain-specific interfaces to the saved object management plugin
    * Add a V1 interface of domain types to `common`
    * Remove use of deprecated `SavedObject` type from public
* Follows on from https://github.com/elastic/kibana/pull/148602


Related https://github.com/elastic/kibana/issues/149098

Fixes https://github.com/elastic/kibana/pull/149495

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-02 17:02:38 +01:00
Yngrid Coello
3d3a885ad7
[APM] Show warning if transaction groups are dropped (#148625)
Closes https://github.com/elastic/kibana/issues/146648.

### Changes
- `transaction_detail_link.tsx` prevent navigation to tx details when
bucket name is other and display the warning tooltip
- `xpack.apm.ui.transactionGroupBucketSize` ui setting was removed and
now we have a hardcoded limit of `1000` buckets when querying
transactions.

**After this change**


https://user-images.githubusercontent.com/1313018/214321647-e0ae59d6-0761-4d9e-a0fe-ef21397aeff7.mov


- When kibana limit has been reached
<img width="1391" alt="image"
src="https://user-images.githubusercontent.com/1313018/214321902-05fbfa6c-7c99-4b21-a67b-7e134c14ab73.png">

- When having only `_other`
<img width="1390" alt="image"
src="https://user-images.githubusercontent.com/1313018/214332887-d6fd59a2-d1ef-4b61-b6ed-79a6d458f0a0.png">

### Test instructions
1. Checkout PR branch
2. Execute Synthtrace scenario
    a. For reaching kibana limit callout
        ```
node scripts/synthtrace --clean other_transaction_group_bucket.ts
--scenarioOpts.txGroups=1001
        ```
    b. For `_other` callout
        ```
node scripts/synthtrace --clean other_transaction_group_bucket.ts
        ```

---------

Co-authored-by: Achyut Jhunjhunwala <achyut.jhunjhunwala@elastic.co>
2023-01-30 15:40:25 +01:00
Christiane (Tina) Heiligers
f7b25f5e46
[Saved Objects] Provide ability to remove SO type from global SO HTTP API without hiding from the client (#149166)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
resolves https://github.com/elastic/kibana/issues/147150
2023-01-23 15:04:24 -07:00
Aleh Zasypkin
422e9444b1
Upgrade cookiejar dependency (2.1.12.1.4). (#149323) 2023-01-23 17:20:38 +01:00