diff --git a/Jenkinsfile b/Jenkinsfile index b6a36c79f877d..763ee95ddde99 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,8 +4,8 @@ library 'kibana-pipeline-library' kibanaLibrary.load() kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true) { - ciStats.trackBuild { - githubPr.withDefaultPrComments { + githubPr.withDefaultPrComments { + ciStats.trackBuild { catchError { retryable.enable() parallel([ @@ -53,10 +53,10 @@ kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true) { ]) } } + } - if (params.NOTIFY_ON_FAILURE) { - slackNotifications.onFailure() - kibanaPipeline.sendMail() - } + if (params.NOTIFY_ON_FAILURE) { + slackNotifications.onFailure() + kibanaPipeline.sendMail() } } diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md index c6359fc268882..6574e7ee37926 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md @@ -9,7 +9,7 @@ Constructs a new instance of the `IndexPattern` class Signature: ```typescript -constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: PatternCache, fieldFormats: FieldFormatsStartCommon, onNotification: OnNotification, onError: OnError); +constructor(id: string | undefined, { getConfig, savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError, }: IndexPatternDeps); ``` ## Parameters @@ -17,11 +17,5 @@ constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObj | Parameter | Type | Description | | --- | --- | --- | | id | string | undefined | | -| getConfig | any | | -| savedObjectsClient | SavedObjectsClientContract | | -| apiClient | IIndexPatternsApiClient | | -| patternCache | PatternCache | | -| fieldFormats | FieldFormatsStartCommon | | -| onNotification | OnNotification | | -| onError | OnError | | +| { getConfig, savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError, } | IndexPatternDeps | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md index 3e67b96cb80ce..8ffa7b6b36f56 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md @@ -14,7 +14,7 @@ export declare class IndexPattern implements IIndexPattern | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(id, getConfig, savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError)](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the IndexPattern class | +| [(constructor)(id, { getConfig, savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError, })](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the IndexPattern class | ## Properties diff --git a/docs/infrastructure/getting-started.asciidoc b/docs/infrastructure/getting-started.asciidoc deleted file mode 100644 index 7122ad5c19f75..0000000000000 --- a/docs/infrastructure/getting-started.asciidoc +++ /dev/null @@ -1,11 +0,0 @@ -[role="xpack"] -[[xpack-metrics-getting-started]] -== Getting started with metrics - -To get started with the Metrics app in Kibana, you need to start collecting metrics data for your infrastructure. - -Kibana provides step-by-step instructions to help you add metrics data. -The {metrics-guide}[Metrics Monitoring Guide] is a good source for more detailed information and instructions. - -[role="screenshot"] -image::infrastructure/images/metrics-add-data.png[Screenshot showing Add metric data to Kibana] diff --git a/docs/infrastructure/images/infra-time-selector.png b/docs/infrastructure/images/infra-time-selector.png deleted file mode 100644 index 181fac4c7b39b..0000000000000 Binary files a/docs/infrastructure/images/infra-time-selector.png and /dev/null differ diff --git a/docs/infrastructure/images/infra-view-metrics.png b/docs/infrastructure/images/infra-view-metrics.png deleted file mode 100644 index 6001f18d283fe..0000000000000 Binary files a/docs/infrastructure/images/infra-view-metrics.png and /dev/null differ diff --git a/docs/infrastructure/images/metrics-add-data.png b/docs/infrastructure/images/metrics-add-data.png deleted file mode 100644 index f96c30f0e1848..0000000000000 Binary files a/docs/infrastructure/images/metrics-add-data.png and /dev/null differ diff --git a/docs/infrastructure/images/metrics-explorer-screen.png b/docs/infrastructure/images/metrics-explorer-screen.png deleted file mode 100644 index 6d56491f7d485..0000000000000 Binary files a/docs/infrastructure/images/metrics-explorer-screen.png and /dev/null differ diff --git a/docs/infrastructure/images/time-filter-calendar.png b/docs/infrastructure/images/time-filter-calendar.png deleted file mode 100644 index d0019c99fe893..0000000000000 Binary files a/docs/infrastructure/images/time-filter-calendar.png and /dev/null differ diff --git a/docs/infrastructure/images/time-filter-clock.png b/docs/infrastructure/images/time-filter-clock.png deleted file mode 100644 index fe8542aad41de..0000000000000 Binary files a/docs/infrastructure/images/time-filter-clock.png and /dev/null differ diff --git a/docs/infrastructure/index.asciidoc b/docs/infrastructure/index.asciidoc index 416e95a8941ce..81a3022436a7e 100644 --- a/docs/infrastructure/index.asciidoc +++ b/docs/infrastructure/index.asciidoc @@ -1,10 +1,9 @@ +[chapter] [role="xpack"] [[xpack-infra]] = Metrics -[partintro] --- -The Metrics app enables you to monitor your infrastructure metrics and identify problems in real time. +The {metrics-app} in {kib} enables you to monitor your infrastructure metrics and identify problems in real time. You start with a visual summary of your infrastructure where you can view basic metrics for common servers, containers, and services. Then you can drill down to view more detailed metrics or other information for that component. @@ -23,14 +22,11 @@ You can optionally save these views and add them to {kibana-ref}/dashboard.html[ * Create alerts based on metric thresholds for one or more components. -To get started, you need to <>. Then you can <>. - [role="screenshot"] image::infrastructure/images/infra-sysmon.png[Infrastructure Overview in Kibana] --- +[float] +=== Get started + +To get started with Metrics, refer to {metrics-guide}/install-metrics-monitoring.html[Install Metrics]. -include::getting-started.asciidoc[] -include::infra-ui.asciidoc[] -include::view-metrics.asciidoc[] -include::metrics-explorer.asciidoc[] diff --git a/docs/infrastructure/infra-ui.asciidoc b/docs/infrastructure/infra-ui.asciidoc deleted file mode 100644 index 9e7459da743a4..0000000000000 --- a/docs/infrastructure/infra-ui.asciidoc +++ /dev/null @@ -1,113 +0,0 @@ -[role="xpack"] -[[infra-ui]] -== Using the Metrics app - -Use the Metrics app in {kib} to monitor your infrastructure metrics and identify problems in real time. -You can explore metrics for hosts, containers, and services. -You can also drill down to view more detailed metrics, or seamlessly switch to view the corresponding logs, application traces, and uptime information. - -Initially, the *Inventory* tab shows an overview of the hosts in of your infrastructure and the current CPU usage for each host. -From here, you can view other metrics or drill down into areas of interest. - -[role="screenshot"] -image::infrastructure/images/infra-sysmon.png[Infrastructure Overview in Kibana] - -[float] -[[infra-cat]] -=== Choose the high-level view of your infrastructure - -Select the high-level view from *Hosts*, *Kubernetes*, or *Docker*. -When you change views, you see the same data through the perspective of a different category. - -The default representation is the *Map view*, which shows your components in a _waffle map_ of one or more rectangular grids. -If the view you select has a large number of components, you can hover over a component to see the details for that component. Alternatively, if you would prefer to see your infrastructure as a table, click *Table view*. - -[float] -[[infra-metric]] -=== Select the metric to view - -Select the metric to view from the *Metric* dropdown list. -The available metrics are those that are most relevant for the high-level view you selected. - -[float] -[[infra-group]] -=== Group components - -Select the way you want to group the infrastructure components from the *Group By* dropdown list. -The available options are specific to your physical, virtual, or container-based infrastructure. -Examples of grouping options include *Availability Zone*, *Machine Type*, *Project ID*, and *Cloud Provider* for hosts, and *Namespace* and *Node* for Kubernetes. - -[float] -[[infra-search]] -=== Use the power of search - -Use the search bar to perform ad hoc searches for specific text. -You can also create structured searches using {kibana-ref}/kuery-query.html[Kibana Query Language]. -For example, enter `host.hostname : "host1"` to see only the information for `host1`. - -[float] -[[infra-date]] -=== Specify the time and date - -Click the time filter image:infrastructure/images/infra-time-selector.png[time filter icon] to choose the timeframe for the metrics. -The values shown are the values for the last minute at the specified time and date. - -[float] -[[infra-refresh]] -=== Auto-refresh metrics - -Select *Auto-refresh* to keep up-to-date metrics information coming in, or *Stop refreshing* to focus on historical data without new distractions. - -[float] -[[infra-configure-source]] -=== Configure the data to use for your metrics - -If your metrics have custom index patterns, or use non-default field settings, you can override the default configuration settings. - -The default source configuration for metrics is specified in the {kibana-ref}/infrastructure-ui-settings-kb.html[Metrics app settings] in the {kibana-ref}/settings.html[Kibana configuration file]. -The default configuration uses the `metricbeat-*` index pattern to query the data. -The default configuration also defines field settings for things like timestamps and container names. - -To change the configuration settings, click the *Settings* tab. - -NOTE: These settings are shared with logs. Changes you make here may also affect the settings used by the *Logs* app. - -In the *Settings* tab, you can change the values in these sections: - -* *Name*: the name of the source configuration -* *Indices*: the index pattern or patterns in the Elasticsearch indices to read metrics data and log data from -* *Fields*: the names of specific fields in the indices that are used to query and interpret the data correctly - -When you have completed your changes, click *Apply*. - -If the fields are greyed out and cannot be edited, you may not have sufficient privileges to change the source configuration. -For more information see <>. - -TIP: If <> are enabled in your Kibana instance, any configuration changes you make here are specific to the current space. -You can make different subsets of data available by creating multiple spaces with different data source configurations. - -[float] -[[infra-metrics-explorer]] -=== Visualize multiple metrics in Metrics Explorer - -<> allows you to visualize and analyze metrics for multiple components in a powerful and configurable way. Click the *Metrics Explorer* tab to get started. - -[float] -[[infra-drill-down]] -=== Drill down for related information - -Hover over a component to see more information about that component. - -Click a component to see the other actions available for that component. -You can: - -* Select *View Metrics* to <>. - -* Select *View Logs* to {logs-guide}/inspect-log-events.html[view the logs] in the *Logs* app. - -Depending on the features you have installed and configured, you may also be able to: - -* Select *View APM* to <> in the *APM* app. - -* Select *View Uptime* to {uptime-guide}/uptime-app-overview.html[view uptime information] in the *Uptime* app. - diff --git a/docs/infrastructure/metrics-explorer.asciidoc b/docs/infrastructure/metrics-explorer.asciidoc deleted file mode 100644 index 793f09ea83b4f..0000000000000 --- a/docs/infrastructure/metrics-explorer.asciidoc +++ /dev/null @@ -1,75 +0,0 @@ -[role="xpack"] -[[metrics-explorer]] -== Metrics Explorer - -Metrics Explorer in the Metrics app in Kibana allows you to group and visualise multiple customisable metrics for one or more components in a graphical format. -This can be a starting point for further investigations. -You can also save your views and add them to {kibana-ref}/dashboard.html[dashboards]. - -[role="screenshot"] -image::infrastructure/images/metrics-explorer-screen.png[Metrics Explorer in Kibana] - -[float] -[[metrics-explorer-requirements]] -=== Metrics Explorer requirements and considerations - -* Metrics Explorer uses data collected from {metricbeat-ref}/metricbeat-overview.html[Metricbeat]. -* You need read permissions on `metricbeat-*` or the metric index specified in the Metrics configuration. -* Metrics Explorer uses the timestamp field from the *Settings* tab. -By default that is set to `@timestamp`. -* The interval for the X Axis is set to `auto`. -The bucket size is determined by the time range. -* To use *Open in Visualize* you need access to the Visualize app. -* To use *Create alert* you need to {kibana-ref}/alerting-getting-started.html#alerting-setup-prerequisites[set up alerting]. - -[float] -[[metrics-explorer-tutorial]] -=== Metrics Explorer tutorial - -In this tutorial we'll use Metrics Explorer to view the system load metrics for each host we're monitoring with Metricbeat. -After that, we'll filter down to a specific host and explore the outbound traffic for each network interface. -Before we start, if you don't have any Metricbeat data, you'll need to head over to our -{metricbeat-ref}/metricbeat-overview.html[Metricbeat documentation] to install Metricbeat and start collecting data. - -1. When you have Metricbeat running and collecting data, open Kibana and navigate to *Metrics*. -The *Inventory* tab shows the host or hosts you are monitoring. - -2. Select the *Metrics Explorer* tab. -The initial configuration has the *Average* aggregation selected, the *of* field populated with some default metrics, and the *graph per* dropdown set to `Everything`. - -3. To select the metrics to view, firstly delete all the metrics currently shown in the *of* field by clicking the *X* by each metric name. -Then, in this field, start typing `system.load.1` and select this metric. -Also add metrics for `system.load.5` and `system.load.15`. -You will see a graph showing the average values of the metrics you selected. -In this step we'll leave the aggregation dropdown set to *Average* but you can try different values later if you like. - -4. In the *graph per* dropdown, enter `host.name` and select this field. -You will see a separate graph for each host you are monitoring. -If you are collecting metrics for multiple hosts, multiple graphics are displayed. -If you only have metrics for a single host, you will see a single graph. -Congratulations! Either way, you've explored your first metric. - -5. Let's explore a bit further. -In the upper right hand corner of the graph for one of the hosts, select the *Actions* dropdown and click *Add Filter* to show only the metrics for that host. -This adds a {kibana-ref}/kuery-query.html[Kibana Query Language] filter for `host.name` in the second row of the Metrics Explorer configuration. -If you only have one host, the graph will not change as you are already exploring metrics for a single host. - -6. Now you can start exploring some host-specific metrics. -First, delete each of the system load metrics in the *of* field by clicking the *X* by the metric name. -Then enter the metric `system.network.out.bytes` to explore the outbound network traffic. -This is a monotonically increasing value, so change the aggregation dropdown to `Rate`. - -7. Since hosts have multiple network interfaces, it is more meaningful to display one graph for each network interface. -To do this, select the *graph per* dropdown, start typing `system.network.name` and select this field. -You will now see a separate graph for each network interface. - -8. If you like, you can put one of these graphs in a dashboard. -Choose a graph, click the *Actions* dropdown and select *Open In Visualize*. -This opens the graph in {kibana-ref}/TSVB.html[TSVB]. -From here you can save the graph and add it to a dashboard as usual. - -9. You can also create an alert based on the metrics in a graph. -Choose a graph, click the *Actions* dropdown and select *Create alert*. -This opens the {kibana-ref}/defining-alerts.html[alert flyout] prefilled with mertrics from the chart. - -Who's the Metrics Explorer now? You are! diff --git a/docs/infrastructure/view-metrics.asciidoc b/docs/infrastructure/view-metrics.asciidoc deleted file mode 100644 index 1bd64dde76ee1..0000000000000 --- a/docs/infrastructure/view-metrics.asciidoc +++ /dev/null @@ -1,32 +0,0 @@ -[role="xpack"] -[[xpack-view-metrics]] - -== Viewing infrastructure metrics - -When you select *View Metrics* for a component in your infrastructure from the <>, you can view detailed metrics for that component, and for any related components. -You can also view additional component metadata. - -[role="screenshot"] -image::infrastructure/images/infra-view-metrics.png[Infrastructure View Metrics in Kibana] - -[float] -[[infra-view-metrics-date]] -=== Specify the time and date range - -Use the time filter to select the time and date range for the metrics. - -To quickly select some popular time range options, click the calendar dropdown image:infrastructure/images/time-filter-calendar.png[]. In this popup you can choose from: - -* *Quick select* to choose a recent time range, and use the back and forward arrows to move through the time ranges -* *Commonly used* to choose a time range from some commonly used options such as *Last 15 minutes*, *Today*, or *Week to date* -* *Refresh every* to specify an auto-refresh rate - -NOTE: When you start auto-refresh from within this dialog, the calendar dropdown changes to a clock image:infrastructure/images/time-filter-clock.png[]. - -For complete control over the start and end times, click the start time or end time shown in the bar beside the calendar dropdown. In this popup, you can choose from the *Absolute*, *Relative* or *Now* tabs, then specify the required options. - -[float] -[[infra-view-refresh-metrics-date]] -=== Refresh the metrics - -You can click *Refresh* to manually refresh the metrics. diff --git a/docs/ingest_manager/index.asciidoc b/docs/ingest_manager/index.asciidoc deleted file mode 100644 index f719c774c7739..0000000000000 --- a/docs/ingest_manager/index.asciidoc +++ /dev/null @@ -1,14 +0,0 @@ -[chapter] -[role="xpack"] -[[xpack-ingest-manager]] -= Ingest Manager - -The {ingest-manager} app in Kibana enables you to add and manage integrations for popular services and platforms, as well as manage {elastic-agent} installations in standalone or {fleet} mode. - -[role="screenshot"] -image::ingest_manager/images/ingest-manager-start.png[Ingest Manager App in Kibana] - -[float] -=== Get started - -To get started with Ingest Management, refer to the LINK_TO_INGEST_MANAGEMENT_GUIDE[Ingest Management Guide]. \ No newline at end of file diff --git a/docs/ingest_manager/ingest-manager.asciidoc b/docs/ingest_manager/ingest-manager.asciidoc new file mode 100644 index 0000000000000..8f6e8036c68cd --- /dev/null +++ b/docs/ingest_manager/ingest-manager.asciidoc @@ -0,0 +1,27 @@ +[chapter] +[role="xpack"] +[[ingest-manager]] += {ingest-manager} + +experimental[] + +{ingest-manager} in {kib} enables you to add and manage integrations for popular +services and platforms, as well as manage {elastic-agent} installations in +standalone or {fleet} mode. + +Standalone mode requires you to manually configure and manage the agent locally. + +{fleet} mode offers several advantages: + +* A central place to configure and monitor your {agent}s. +* An overview of the data ingest in your {es} cluster. +* Multiple integrations to collect and transform data. + +[role="screenshot"] +image::ingest_manager/images/ingest-manager-start.png[{ingest-manager} app in {kib}] + +[float] +== Get started + +To get started with {ingest-management}, refer to the +{ingest-guide}/index.html[Ingest Management Guide]. diff --git a/docs/management/upgrade-assistant/index.asciidoc b/docs/management/upgrade-assistant/index.asciidoc index 9a0dfd25489ea..ab6d0790ffa3f 100644 --- a/docs/management/upgrade-assistant/index.asciidoc +++ b/docs/management/upgrade-assistant/index.asciidoc @@ -2,14 +2,16 @@ [[upgrade-assistant]] == Upgrade Assistant -The Upgrade Assistant helps you prepare for your upgrade to {es} 9.0. -To access the assistant, open the menu, then go to *Stack Management > {es} > 9.0 Upgrade Assistant*. +The Upgrade Assistant helps you prepare for your upgrade to the next major {es} version. +For example, if you are using 6.8, the Upgrade Assistant helps you to upgrade to 7.0. +To access the assistant, open the menu, then go to *Stack Management > {es} > Upgrade Assistant*. The assistant identifies the deprecated settings in your cluster and indices and guides you through the process of resolving issues, including reindexing. -Before upgrading to Elasticsearch 9.0, make sure that you are using the final -8.x minor release to see the most up-to-date deprecation issues. +Before you upgrade, make sure that you are using the latest released minor +version of {es} to see the most up-to-date deprecation issues. +For example, if you want to upgrade to to 7.0, make sure that you are using 6.8. [float] === Reindexing diff --git a/docs/redirects.asciidoc b/docs/redirects.asciidoc index 04959b2627a78..c94c8e5c55f85 100644 --- a/docs/redirects.asciidoc +++ b/docs/redirects.asciidoc @@ -28,7 +28,7 @@ This page has moved. Please see the new section in the {heartbeat-ref}/securing- [role="exclude",id="infra-read-only-access"] == Configure source read-only access -This page has moved. Please see <>. +This page has moved. Please see the new section in the {metrics-guide}/configure-metrics-source.html[Metrics Monitoring Guide]. [role="exclude",id="logs-read-only-access"] == Configure source read-only access @@ -80,28 +80,3 @@ This page was deleted. See <>. == Developing Visualizations This page was deleted. See <>. - -[role="exclude",id="xpack-logs-getting-started"] -== Getting started with logs monitoring - -This page has moved. Please see the new section in the {logs-guide}/install-logs-monitoring.html[Logs Monitoring Guide]. - -[role="exclude",id="xpack-logs-using"] -== Using the Logs app - -This page has moved. Please see the new section in the {logs-guide}/logs-app-overview.html[Logs Monitoring Guide]. - -[role="exclude",id="xpack-logs-configuring"] -== Configuring the Logs data - -This page has moved. Please see the new section in the {logs-guide}/configure-logs-source.html[Logs Monitoring Guide]. - -[role="exclude",id="xpack-logs-analysis"] -== Detecting and inspecting log anomalies - -This page has moved. Please see the new section in the {logs-guide}/detect-log-anomalies.html[Logs Monitoring Guide] - -[role="exclude",id="xpack-logs-alerting"] -== Logs alerting - -This page has moved. Please see the new section in the {logs-guide}/create-log-alert.html[Logs Monitoring Guide] diff --git a/docs/user/index.asciidoc b/docs/user/index.asciidoc index 850ee3e666df2..a07d584b4391d 100644 --- a/docs/user/index.asciidoc +++ b/docs/user/index.asciidoc @@ -12,22 +12,22 @@ include::security/securing-kibana.asciidoc[] include::discover.asciidoc[] -include::visualize.asciidoc[] - include::dashboard.asciidoc[] include::canvas.asciidoc[] -include::graph/index.asciidoc[] +include::{kib-repo-dir}/maps/index.asciidoc[] include::ml/index.asciidoc[] -include::{kib-repo-dir}/maps/index.asciidoc[] +include::graph/index.asciidoc[] -include::{kib-repo-dir}/infrastructure/index.asciidoc[] +include::visualize.asciidoc[] include::{kib-repo-dir}/logs/index.asciidoc[] +include::{kib-repo-dir}/infrastructure/index.asciidoc[] + include::{kib-repo-dir}/apm/index.asciidoc[] include::{kib-repo-dir}/uptime/index.asciidoc[] @@ -40,6 +40,8 @@ include::monitoring/index.asciidoc[] include::management.asciidoc[] +include::{kib-repo-dir}/ingest_manager/ingest-manager.asciidoc[] + include::reporting/index.asciidoc[] include::alerting/index.asciidoc[] diff --git a/docs/user/reporting/index.asciidoc b/docs/user/reporting/index.asciidoc index 19aa9823faaf0..4123912b79237 100644 --- a/docs/user/reporting/index.asciidoc +++ b/docs/user/reporting/index.asciidoc @@ -1,6 +1,6 @@ [role="xpack"] [[reporting-getting-started]] -= Reporting from Kibana += Reporting [partintro] diff --git a/examples/dashboard_embeddable_examples/README.md b/examples/dashboard_embeddable_examples/README.md new file mode 100644 index 0000000000000..e1528e36f4c4b --- /dev/null +++ b/examples/dashboard_embeddable_examples/README.md @@ -0,0 +1 @@ +Example of using dashboard container embeddable outside of dashboard app diff --git a/examples/dashboard_embeddable_examples/kibana.json b/examples/dashboard_embeddable_examples/kibana.json new file mode 100644 index 0000000000000..bb2ced569edb5 --- /dev/null +++ b/examples/dashboard_embeddable_examples/kibana.json @@ -0,0 +1,9 @@ +{ + "id": "dashboardEmbeddableExamples", + "version": "0.0.1", + "kibanaVersion": "kibana", + "server": false, + "ui": true, + "requiredPlugins": ["embeddable", "embeddableExamples", "dashboard", "developerExamples"], + "optionalPlugins": [] +} diff --git a/examples/dashboard_embeddable_examples/public/app.tsx b/examples/dashboard_embeddable_examples/public/app.tsx new file mode 100644 index 0000000000000..b166b8444f080 --- /dev/null +++ b/examples/dashboard_embeddable_examples/public/app.tsx @@ -0,0 +1,112 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React from 'react'; +import ReactDOM from 'react-dom'; +import { BrowserRouter as Router, Route, RouteComponentProps, withRouter } from 'react-router-dom'; + +import { + EuiPage, + EuiPageContent, + EuiPageContentBody, + EuiPageSideBar, + EuiSideNav, +} from '@elastic/eui'; +import 'brace/mode/json'; +import { AppMountParameters } from '../../../src/core/public'; +import { DashboardEmbeddableByValue } from './by_value/embeddable'; +import { DashboardStart } from '../../../src/plugins/dashboard/public'; + +interface PageDef { + title: string; + id: string; + component: React.ReactNode; +} + +type NavProps = RouteComponentProps & { + pages: PageDef[]; +}; + +const Nav = withRouter(({ history, pages }: NavProps) => { + const navItems = pages.map((page) => ({ + id: page.id, + name: page.title, + onClick: () => history.push(`/${page.id}`), + 'data-test-subj': page.id, + })); + + return ( + + ); +}); + +interface Props { + basename: string; + DashboardContainerByValueRenderer: DashboardStart['DashboardContainerByValueRenderer']; +} + +const DashboardEmbeddableExplorerApp = ({ basename, DashboardContainerByValueRenderer }: Props) => { + const pages: PageDef[] = [ + { + title: 'By value dashboard embeddable', + id: 'dashboardEmbeddableByValue', + component: ( + + ), + }, + { + title: 'By ref dashboard embeddable', + id: 'dashboardEmbeddableByRef', + component:
TODO: Not implemented, but coming soon...
, + }, + ]; + + const routes = pages.map((page, i) => ( + page.component} /> + )); + + return ( + + + +