Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elastic/kibana into 161754-infra-ui…
Browse files Browse the repository at this point in the history
…-replace-node-details-flyout-with-asset-details-flyout-in-the-inventory-page
  • Loading branch information
jennypavlova committed Sep 28, 2023
2 parents 07e47c2 + 67cc63a commit b7363d8
Show file tree
Hide file tree
Showing 312 changed files with 7,900 additions and 4,328 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,7 @@ module.exports = {
},
{
files: [
'x-pack/plugins/aiops/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/apm/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/exploratory_view/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/infra/**/*.{js,mjs,ts,tsx}',
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ packages/kbn-ci-stats-performance-metrics @elastic/kibana-operations
packages/kbn-ci-stats-reporter @elastic/kibana-operations
packages/kbn-ci-stats-shipper-cli @elastic/kibana-operations
packages/kbn-cli-dev-mode @elastic/kibana-operations
packages/cloud @elastic/kibana-core
x-pack/plugins/cloud_integrations/cloud_chat @elastic/kibana-core
x-pack/plugins/cloud_integrations/cloud_chat_provider @elastic/kibana-core
x-pack/plugins/cloud_integrations/cloud_data_migration @elastic/platform-onboarding
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-deploy-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
"<https://github.com/elastic/kibana/actions/runs/${{ github.run_id }}|GitHub Workflow run>",
"<https://buildkite.com/elastic/kibana-serverless-release/builds?branch=${{ env.TAG_NAME }}|Kibana Serverless Release pipeline>",
"<https://argo-workflows.us-central1.gcp.qa.cld.elstc.co/workflows?label=hash%3D${{ env.COMMIT }}|Argo Workflow> (use Elastic Cloud Staging VPN)",
"<https://platform-logging.kb.us-central1.gcp.foundit.no/app/dashboards#/view/f710d7d0-00b9-11ee-93d2-8df4bca5a4c9?_g=(refreshInterval:(pause:!t,value:0),time:(from:now-1d,to:now))&service-name=kibana&_a=(controlGroupInput:(chainingSystem:HIERARCHICAL,controlStyle:oneLine,ignoreParentSettings:(ignoreFilters:!f,ignoreQuery:!f,ignoreTimerange:!f,ignoreValidations:!f),panels:('18201b8e-3aae-4459-947d-21e007b6a3a5':(explicitInput:(dataViewId:'logs-*',enhancements:(),fieldName:commit-hash,id:'18201b8e-3aae-4459-947d-21e007b6a3a5',selectedOptions:!('${{ env.COMMIT }}'),title:commit-hash),grow:!t,order:1,type:optionsListControl,width:medium),'41060e65-ce4c-414e-b8cf-492ccb19245f':(explicitInput:(dataViewId:'logs-*',enhancements:(),fieldName:service-name,id:'41060e65-ce4c-414e-b8cf-492ccb19245f',selectedOptions:!(kibana),title:service-name),grow:!t,order:0,type:optionsListControl,width:medium),ed96828e-efe9-43ad-be3f-0e04218f79af:(explicitInput:(dataViewId:'logs-*',enhancements:(),fieldName:to-env,id:ed96828e-efe9-43ad-be3f-0e04218f79af,selectedOptions:!(qa),title:to-env),grow:!t,order:2,type:optionsListControl,width:medium))))|GPCTL Deployment Status dashboard>",
"<https://overview.qa.cld.elstc.co/app/dashboards#/view/serverless-tooling-gpctl-deployment-status?_g=(refreshInterval:(pause:!t,value:0),time:(from:now-1d,to:now))&service-name=kibana&_a=(controlGroupInput:(chainingSystem:HIERARCHICAL,controlStyle:oneLine,ignoreParentSettings:(ignoreFilters:!f,ignoreQuery:!f,ignoreTimerange:!f,ignoreValidations:!f),panels:('18201b8e-3aae-4459-947d-21e007b6a3a5':(explicitInput:(dataViewId:'serverless.logs-*',enhancements:(),fieldName:commit-hash,id:'18201b8e-3aae-4459-947d-21e007b6a3a5',selectedOptions:!('${{ env.COMMIT }}'),title:commit-hash),grow:!t,order:1,type:optionsListControl,width:medium),'41060e65-ce4c-414e-b8cf-492ccb19245f':(explicitInput:(dataViewId:'serverless.logs-*',enhancements:(),fieldName:service-name,id:'41060e65-ce4c-414e-b8cf-492ccb19245f',selectedOptions:!(kibana),title:service-name),grow:!t,order:0,type:optionsListControl,width:medium),ed96828e-efe9-43ad-be3f-0e04218f79af:(explicitInput:(dataViewId:'serverless.logs-*',enhancements:(),fieldName:to-env,id:ed96828e-efe9-43ad-be3f-0e04218f79af,selectedOptions:!(qa),title:to-env),grow:!t,order:2,type:optionsListControl,width:medium))))|GPCTL Deployment Status dashboard>",
"<https://buildkite.com/elastic/kibana-tests/builds?branch=main|Quality Gate pipeline>"
]
- name: Post Slack failure message
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"customIntegrations": "src/plugins/custom_integrations",
"customIntegrationsPackage": "packages/kbn-custom-integrations",
"dashboard": "src/plugins/dashboard",
"cloud": "packages/cloud",
"domDragDrop": "packages/kbn-dom-drag-drop",
"controls": "src/plugins/controls",
"data": "src/plugins/data",
Expand Down
1 change: 1 addition & 0 deletions config/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ xpack.fleet.internal.disableILMPolicies: true
xpack.fleet.internal.disableProxies: true
xpack.fleet.internal.activeAgentsSoftLimit: 25000
xpack.fleet.internal.onlyAllowAgentUpgradeToKnownVersions: true
xpack.fleet.internal.retrySetupOnBoot: true

# Cloud links
xpack.cloud.base_url: 'https://cloud.elastic.co'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tags: ['kibana', 'onboarding', 'setup', 'performance', 'development', 'telemetry
As a way to better understand user experience with Kibana in cloud, we support running performance journeys against
Cloud deployments.
The process takes a few steps:
- Create a cloud deployment
- Create a cloud deployment (8.11.0+ is supported)
- Re-configure deployment with APM enabled and reporting metrics to the monitoring cluster
- Create a user with `superuser` role to run tests with
- Checkout the branch that matches your cloud deployment version
Expand All @@ -35,7 +35,7 @@ Navigate to `Advanced Edit` page and change `Deployment Configuration` by adding
```
"user_settings_override_json": {
"tracing.apm.enabled": "true",
"tracing.apm.environment": "development",
"tracing.apm.agent.environment": "development",
"tracing.apm.agent.service_name": "elasticsearch",
"tracing.apm.agent.server_url": "<SERVER_URL>",
"tracing.apm.agent.metrics_interval": "120s",
Expand All @@ -50,6 +50,7 @@ Navigate to `Advanced Edit` page and change `Deployment Configuration` by adding

```
"user_settings_override_json": {
"coreApp.allowDynamicConfigOverrides": true,
"elastic.apm.active": true,
"elastic.apm.breakdownMetrics": false,
"elastic.apm.captureBody": "all",
Expand All @@ -74,8 +75,28 @@ Note: DEPLOYMENT_ID and YOUR_JOURNEY_NAME values are optional labels to find the

Save changes and make sure cluster is restarted successfully.

### Use QAF to prepare the deployment
The quickest way to prepare ESS deployment is to use [QAF](https://github.com/elastic/qaf):

- Make sure to add `~/.elastic/cloud.json` and ~/.elastic/cloud-admin.json with Cloud API (to create deployment) & Cloud Admin API (to modify it) keys
```
{
"api_key": {
"production": "<PROD KEY>",
"staging": "<STAGING KEY>",
"qa": "<QA KEY>"
}
}
```
- Create deployment and modify it
```
export EC_DEPLOYMENT_NAME=kibana-perf-8.11
qaf elastic-cloud deployments create --stack-version 8.11.0-SNAPSHOT --environment staging --region gcp-us-central1
qaf elastic-cloud deployments configure-for-performance-journeys
```

### Run the journey
Make sure you have created user with `superuser` role and the Kibana repo branch is matching your deployment version.
Make sure the Kibana repo branch is matching your deployment version.
Set env variables to run FTR against your cloud deployment:

```
Expand All @@ -90,4 +111,6 @@ Run your journey with the command:
node scripts/functional_test_runner.js --config x-pack/performance/journeys/$YOUR_JOURNEY_NAME.ts`
```

APM & Telemetry labels will be updated on the fly and metrics/traces should be available in Telemetry Staging and kibana-ops-e2e-perf cluster.


3 changes: 2 additions & 1 deletion docs/setup/connect-to-elasticsearch.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ Details for each programming language library that Elastic provides are in the
https://www.elastic.co/guide/en/elasticsearch/client/index.html[{es} Client documentation].

If you are running {kib} on our hosted {es} Service,
click *View deployment details* on the *Integrations* view
click *Endpoints* on the *Integrations* view
to verify your {es} endpoint and Cloud ID, and create API keys for integration.
Alternatively, the *Endpoints* are also accessible through the top bar help menu.

[float]
=== Add sample data
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
"@kbn/chart-expressions-common": "link:src/plugins/chart_expressions/common",
"@kbn/chart-icons": "link:packages/kbn-chart-icons",
"@kbn/charts-plugin": "link:src/plugins/charts",
"@kbn/cloud": "link:packages/cloud",
"@kbn/cloud-chat-plugin": "link:x-pack/plugins/cloud_integrations/cloud_chat",
"@kbn/cloud-chat-provider-plugin": "link:x-pack/plugins/cloud_integrations/cloud_chat_provider",
"@kbn/cloud-data-migration-plugin": "link:x-pack/plugins/cloud_integrations/cloud_data_migration",
Expand Down Expand Up @@ -887,6 +888,7 @@
"email-addresses": "^5.0.0",
"execa": "^5.1.1",
"expiry-js": "0.1.7",
"exponential-backoff": "^3.1.1",
"extract-zip": "^2.0.1",
"fast-deep-equal": "^3.1.1",
"fflate": "^0.6.9",
Expand Down
3 changes: 3 additions & 0 deletions packages/cloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @kbn/cloud

Empty package generated by @kbn/generate
81 changes: 81 additions & 0 deletions packages/cloud/deployment_details/deployment_details.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import React from 'react';

import {
EuiForm,
EuiFlexGroup,
EuiFlexItem,
EuiLink,
EuiButtonEmpty,
EuiSpacer,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useDeploymentDetails } from './services';
import { DeploymentDetailsEsInput } from './deployment_details_es_input';
import { DeploymentDetailsCloudIdInput } from './deployment_details_cloudid_input';

const hasActiveModifierKey = (event: React.MouseEvent): boolean => {
return event.metaKey || event.altKey || event.ctrlKey || event.shiftKey;
};

export const DeploymentDetails = ({ closeModal }: { closeModal?: () => void }) => {
const { cloudId, elasticsearchUrl, managementUrl, learnMoreUrl, navigateToUrl } =
useDeploymentDetails();
const isInsideModal = !!closeModal;

if (!cloudId) {
return null;
}

return (
<EuiForm component="div">
{/* Elastic endpoint */}
{elasticsearchUrl && <DeploymentDetailsEsInput elasticsearchUrl={elasticsearchUrl} />}

{/* Cloud ID */}
<DeploymentDetailsCloudIdInput cloudId={cloudId} />

<EuiSpacer size="m" />

{managementUrl && (
<EuiFlexGroup gutterSize="m" justifyContent="spaceBetween" alignItems="center">
<EuiFlexItem grow={false}>
{/* eslint-disable-next-line @elastic/eui/href-or-on-click */}
<EuiButtonEmpty
href={managementUrl}
onClick={(e: React.MouseEvent) => {
if (!hasActiveModifierKey(e)) {
e.preventDefault();
navigateToUrl(managementUrl);
}
if (closeModal) {
closeModal();
}
}}
flush="left"
>
{i18n.translate('cloud.deploymentDetails.createManageApiKeysButtonLabel', {
defaultMessage: 'Create and manage API keys',
})}
</EuiButtonEmpty>
</EuiFlexItem>
{!isInsideModal && (
<EuiFlexItem grow={false}>
<EuiLink external href={learnMoreUrl} target="_blank">
{i18n.translate('cloud.deploymentDetails.learnMoreButtonLabel', {
defaultMessage: 'Learn more',
})}
</EuiLink>
</EuiFlexItem>
)}
</EuiFlexGroup>
)}
</EuiForm>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import React, { type FC } from 'react';
import {
EuiFormRow,
EuiFieldText,
EuiCopy,
EuiButtonIcon,
EuiFlexGroup,
EuiFlexItem,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';

export const DeploymentDetailsCloudIdInput: FC<{ cloudId: string }> = ({ cloudId }) => {
return (
<EuiFormRow
label={i18n.translate('cloud.deploymentDetails.cloudIDLabel', {
defaultMessage: 'Cloud ID',
})}
fullWidth
>
<EuiFlexGroup gutterSize="s">
<EuiFlexItem>
<EuiFieldText
value={cloudId}
fullWidth
disabled
data-test-subj="deploymentDetailsCloudID"
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiCopy textToCopy={cloudId}>
{(copy) => (
<EuiButtonIcon onClick={copy} iconType="copyClipboard" display="base" size="m" />
)}
</EuiCopy>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFormRow>
);
};
48 changes: 48 additions & 0 deletions packages/cloud/deployment_details/deployment_details_es_input.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import React, { type FC } from 'react';
import {
EuiFormRow,
EuiFieldText,
EuiCopy,
EuiButtonIcon,
EuiFlexGroup,
EuiFlexItem,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';

export const DeploymentDetailsEsInput: FC<{ elasticsearchUrl: string }> = ({
elasticsearchUrl,
}) => {
return (
<EuiFormRow
label={i18n.translate('cloud.deploymentDetails.elasticEndpointLabel', {
defaultMessage: 'Elastic endpoint',
})}
fullWidth
>
<EuiFlexGroup gutterSize="s">
<EuiFlexItem>
<EuiFieldText
value={elasticsearchUrl}
fullWidth
disabled
data-test-subj="deploymentDetailsEsEndpoint"
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiCopy textToCopy={elasticsearchUrl}>
{(copy) => (
<EuiButtonIcon onClick={copy} iconType="copyClipboard" display="base" size="m" />
)}
</EuiCopy>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFormRow>
);
};
69 changes: 69 additions & 0 deletions packages/cloud/deployment_details/deployment_details_modal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import React, { type FC } from 'react';
import { i18n } from '@kbn/i18n';
import {
EuiButton,
EuiFlexGroup,
EuiFlexItem,
EuiLink,
EuiModal,
EuiModalBody,
EuiModalFooter,
EuiModalHeader,
EuiModalHeaderTitle,
} from '@elastic/eui';
import { useDeploymentDetails } from './services';
import { DeploymentDetails } from './deployment_details';

interface Props {
closeModal: () => void;
}

export const DeploymentDetailsModal: FC<Props> = ({ closeModal }) => {
const { learnMoreUrl } = useDeploymentDetails();

return (
<EuiModal
onClose={() => {
closeModal();
}}
style={{ width: 600 }}
data-test-subj="deploymentDetailsModal"
>
<EuiModalHeader>
<EuiModalHeaderTitle>
{i18n.translate('cloud.deploymentDetails.helpMenuLinks.endpoints', {
defaultMessage: 'Endpoints',
})}
</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody>
<DeploymentDetails closeModal={closeModal} />
</EuiModalBody>
<EuiModalFooter>
<EuiFlexGroup alignItems="baseline" justifyContent="flexEnd">
<EuiFlexItem grow={false}>
<EuiLink external href={learnMoreUrl} target="_blank">
{i18n.translate('cloud.deploymentDetails.modal.learnMoreButtonLabel', {
defaultMessage: 'Learn more',
})}
</EuiLink>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton onClick={closeModal} fill>
{i18n.translate('cloud.deploymentDetails.modal.closeButtonLabel', {
defaultMessage: 'Close',
})}
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</EuiModalFooter>
</EuiModal>
);
};
11 changes: 11 additions & 0 deletions packages/cloud/deployment_details/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export { DeploymentDetailsKibanaProvider, DeploymentDetailsProvider } from './services';
export { DeploymentDetails } from './deployment_details';
export { DeploymentDetailsModal } from './deployment_details_modal';
Loading

0 comments on commit b7363d8

Please sign in to comment.