Skip to content

Commit

Permalink
Merge branch 'master' into import-export-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jun 9, 2020
2 parents 4b37585 + 835964b commit 090fdba
Show file tree
Hide file tree
Showing 48 changed files with 5,370 additions and 305 deletions.
17 changes: 11 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -661,18 +661,23 @@ To build the docs, you must clone the [elastic/docs](https://github.com/elastic/
repo as a sibling of your kibana repo. Follow the instructions in that project's
README for getting the docs tooling set up.

**To build the docs and open them in your browser:**
**To build the Kibana docs and open them in your browser:**

```bash
./docs/build_docs --doc kibana/docs/index.asciidoc --chunk 1 --open
```
or

```bash
node scripts/docs.js --open
```

### Release Notes Process
### Release Notes process

Part of this process only applies to maintainers, since it requires access to GitHub labels.

Kibana publishes major, minor and patch releases periodically through the year. During this process we run a script against this repo to collect the applicable PRs against that release and generate [Release Notes](https://www.elastic.co/guide/en/kibana/current/release-notes.html).
To include your change in the Release Notes:
Kibana publishes [Release Notes](https://www.elastic.co/guide/en/kibana/current/release-notes.html) for major and minor releases. To generate the Release Notes, the writers run a script against this repo to collect the merged PRs against the release.
To include your PRs in the Release Notes:

1. In the title, summarize what the PR accomplishes in language that is meaningful to the user. In general, use present tense (for example, Adds, Fixes) in sentence case.
2. Label the PR with the targeted version (ex: `v7.3.0`).
Expand All @@ -681,9 +686,9 @@ To include your change in the Release Notes:
* For an external-facing fix, use `release_note:fix`. Exception: docs, build, and test fixes do not go in the Release Notes. Neither fixes for issues that were only on `master` and never have been released.
* For a deprecated feature, use `release_note:deprecation`.
* For a breaking change, use `release_note:breaking`.
* To **NOT** include your changes in the Release Notes, please use `release_note:skip`.
* To **NOT** include your changes in the Release Notes, use `release_note:skip`.

We also produce a blog post that details more important breaking API changes every minor and major release. If the PR includes a breaking API change, apply the label `release_note:dev_docs`. Additionally add a brief summary of the break at the bottom of the PR using the format below:
We also produce a blog post that details more important breaking API changes in every major and minor release. When your PR includes a breaking API change, add the `release_note:dev_docs` label, and add a brief summary of the break at the bottom of the PR using the format below:

```
# Dev Docs
Expand Down
108 changes: 108 additions & 0 deletions docs/drilldowns/drilldowns.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
[[drilldowns]]
== Use drilldowns for dashboard actions

Drilldowns, also known as custom actions, allow you to configure a
workflow for analyzing and troubleshooting your data.
Using a drilldown, you can navigate from one dashboard to another,
taking the current time range, filters, and other parameters with you,
so the context remains the same. You can continue your analysis from a new perspective.

For example, you might have a dashboard that shows the overall status of multiple data centers.
You can create a drilldown that navigates from this dashboard to a dashboard
that shows a single data center or server.

[float]
[[how-drilldowns-work]]
=== How drilldowns work

Drilldowns are {kib} actions that you configure and store
in the dashboard saved object. Drilldowns are specific to the dashboard panel
for which you create them—they are not shared across panels.
A panel can have multiple drilldowns.

This example shows a dashboard panel that contains a pie chart.
Typically, clicking a pie slice applies the current filter.
When a panel has a drilldown, clicking a pie slice opens a menu with
the default action and your drilldowns. Refer to the <<drilldowns-example, Try it section>>
for instructions on how to create this drilldown.

[role="screenshot"]
image::images/drilldown_on_piechart.gif[Drilldown on pie chart that navigates to another dashboard]

Third-party developers can create drilldowns.
Refer to https://github.com/elastic/kibana/tree/master/x-pack/examples/ui_actions_enhanced_examples[this example plugin]
to learn how to code drilldowns.

[float]
[[create-manage-drilldowns]]
=== Create and manage drilldowns

Your dashboard must be in *Edit* mode to create a drilldown.
Once a panel has at least one drilldown, the menu also includes a *Manage drilldowns* action
for editing and deleting drilldowns.

[role="screenshot"]
image::images/drilldown_menu.png[Panel menu with Create drilldown and Manage drilldown actions]

[float]
[[drilldowns-example]]
=== Try it: Create a drilldown

This example shows how to create the *Host Overview* drilldown shown earlier in this doc.

[float]
==== Set up the dashboards

. Add the <<get-data-in, sample web logs>> data set.

. Create a new dashboard, called `Host Overview`, and include these visualizations
from the sample data set:
+
[%hardbreaks]
*[Logs] Heatmap*
*[Logs] Visitors by OS*
*[Logs] Host, Visits, and Bytes Table*
*[Logs] Total Requests and Bytes*
+
TIP: If you don’t see data for a panel, try changing the time range.

. Open the *[Logs] Web traffic* dashboard.

. Set a search and filter.
+
[%hardbreaks]
Search: `extension.keyword:( “gz” or “css” or “deb”)`
Filter: `geo.src : CN`

[float]
==== Create the drilldown


. In the dashboard menu bar, click *Edit*.

. In *[Logs] Visitors by OS*, open the panel menu, and then select *Create drilldown*.

. Give the drilldown a name.

. Select *Host Overview* as the destination dashboard.

. Keep both filters enabled so that the drilldown carries over the global filters and date range.
+
Your input should look similar to this:
+
[role="screenshot"]
image::images/drilldown_create.png[Create drilldown with entries for drilldown name and destination]

. Click *Create drilldown.*

. Save the dashboard.
+
If you don’t save the drilldown, and then navigate away, the drilldown is lost.

. In *[Logs] Visitors by OS*, click the `win 8` slice of the pie, and then select the name of your drilldown.
+
[role="screenshot"]
image::images/drilldown_on_panel.png[Drilldown on pie chart that navigates to another dashboard]
+
You are navigated to your destination dashboard. Verify that the search query, filters,
and time range are carried over.
Binary file added docs/drilldowns/images/drilldown_create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/drilldowns/images/drilldown_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/drilldowns/images/drilldown_on_panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/drilldowns/images/drilldown_on_piechart.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/settings/telemetry-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ See our https://www.elastic.co/legal/privacy-statement[Privacy Statement] to lea
| Set to `'server'` to report the cluster statistics from the {kib} server.
If the server fails to connect to our endpoint at https://telemetry.elastic.co/, it assumes
it is behind a firewall and falls back to `'browser'` to send it from users' browsers
when they are navigating through {kib}. Defaults to 'browser'.
when they are navigating through {kib}. Defaults to `'server'`.

| `telemetry.optIn`
| Set to `true` to automatically opt into reporting cluster statistics. You can also opt out through
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ two out-of-the box connectors: <<slack-action-type, Slack>> and <<webhook-action
my-slack1: <1>
actionTypeId: .slack <2>
name: 'Slack #xyz' <3>
config: <4>
secrets: <4>
webhookUrl: 'https://hooks.slack.com/services/abcd/efgh/ijklmnopqrstuvwxyz'
webhook-service:
actionTypeId: .webhook
Expand Down
2 changes: 2 additions & 0 deletions docs/user/dashboard.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ When you're finished adding and arranging the panels, save the dashboard.

. Enter the dashboard *Title* and optional *Description*, then *Save* the dashboard.

include::{kib-repo-dir}/drilldowns/drilldowns.asciidoc[]

[[sharing-dashboards]]
== Share the dashboard

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/telemetry/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const configSchema = schema.object({
})
),
sendUsageFrom: schema.oneOf([schema.literal('server'), schema.literal('browser')], {
defaultValue: 'browser',
defaultValue: 'server',
}),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type HttpResponse = Record<string, any> | any[];
// Register helpers to mock HTTP Requests
const registerHttpRequestMockHelpers = (server: SinonFakeServer) => {
const setLoadTemplatesResponse = (response: HttpResponse = []) => {
server.respondWith('GET', `${API_BASE_PATH}/index-templates`, [
server.respondWith('GET', `${API_BASE_PATH}/index_templates`, [
200,
{ 'Content-Type': 'application/json' },
JSON.stringify(response),
Expand All @@ -28,7 +28,7 @@ const registerHttpRequestMockHelpers = (server: SinonFakeServer) => {
};

const setDeleteTemplateResponse = (response: HttpResponse = []) => {
server.respondWith('POST', `${API_BASE_PATH}/delete-index-templates`, [
server.respondWith('POST', `${API_BASE_PATH}/delete_index_templates`, [
200,
{ 'Content-Type': 'application/json' },
JSON.stringify(response),
Expand All @@ -39,7 +39,7 @@ const registerHttpRequestMockHelpers = (server: SinonFakeServer) => {
const status = error ? error.status || 400 : 200;
const body = error ? error.body : response;

server.respondWith('GET', `${API_BASE_PATH}/index-templates/:id`, [
server.respondWith('GET', `${API_BASE_PATH}/index_templates/:id`, [
status,
{ 'Content-Type': 'application/json' },
JSON.stringify(body),
Expand All @@ -50,7 +50,7 @@ const registerHttpRequestMockHelpers = (server: SinonFakeServer) => {
const status = error ? error.body.status || 400 : 200;
const body = error ? JSON.stringify(error.body) : JSON.stringify(response);

server.respondWith('POST', `${API_BASE_PATH}/index-templates`, [
server.respondWith('POST', `${API_BASE_PATH}/index_templates`, [
status,
{ 'Content-Type': 'application/json' },
body,
Expand All @@ -61,7 +61,7 @@ const registerHttpRequestMockHelpers = (server: SinonFakeServer) => {
const status = error ? error.status || 400 : 200;
const body = error ? JSON.stringify(error.body) : JSON.stringify(response);

server.respondWith('PUT', `${API_BASE_PATH}/index-templates/:name`, [
server.respondWith('PUT', `${API_BASE_PATH}/index_templates/:name`, [
status,
{ 'Content-Type': 'application/json' },
body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('Index Templates tab', () => {

expect(server.requests.length).toBe(totalRequests + 1);
expect(server.requests[server.requests.length - 1].url).toBe(
`${API_BASE_PATH}/index-templates`
`${API_BASE_PATH}/index_templates`
);
});

Expand Down Expand Up @@ -318,7 +318,7 @@ describe('Index Templates tab', () => {
const latestRequest = server.requests[server.requests.length - 1];

expect(latestRequest.method).toBe('POST');
expect(latestRequest.url).toBe(`${API_BASE_PATH}/delete-index-templates`);
expect(latestRequest.url).toBe(`${API_BASE_PATH}/delete_index_templates`);
expect(JSON.parse(JSON.parse(latestRequest.requestBody).body)).toEqual({
templates: [{ name: legacyTemplates[0].name, isLegacy }],
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ export async function loadIndexData(type: string, indexName: string) {

export function useLoadIndexTemplates() {
return useRequest<{ templates: TemplateListItem[]; legacyTemplates: TemplateListItem[] }>({
path: `${API_BASE_PATH}/index-templates`,
path: `${API_BASE_PATH}/index_templates`,
method: 'get',
});
}

export async function deleteTemplates(templates: Array<{ name: string; isLegacy?: boolean }>) {
const result = sendRequest({
path: `${API_BASE_PATH}/delete-index-templates`,
path: `${API_BASE_PATH}/delete_index_templates`,
method: 'post',
body: { templates },
});
Expand All @@ -232,7 +232,7 @@ export async function deleteTemplates(templates: Array<{ name: string; isLegacy?

export function useLoadIndexTemplate(name: TemplateDeserialized['name'], isLegacy?: boolean) {
return useRequest<TemplateDeserialized>({
path: `${API_BASE_PATH}/index-templates/${encodeURIComponent(name)}`,
path: `${API_BASE_PATH}/index_templates/${encodeURIComponent(name)}`,
method: 'get',
query: {
legacy: isLegacy,
Expand All @@ -242,7 +242,7 @@ export function useLoadIndexTemplate(name: TemplateDeserialized['name'], isLegac

export async function saveTemplate(template: TemplateDeserialized, isClone?: boolean) {
const result = await sendRequest({
path: `${API_BASE_PATH}/index-templates`,
path: `${API_BASE_PATH}/index_templates`,
method: 'post',
body: JSON.stringify(template),
});
Expand All @@ -257,7 +257,7 @@ export async function saveTemplate(template: TemplateDeserialized, isClone?: boo
export async function updateTemplate(template: TemplateDeserialized) {
const { name } = template;
const result = await sendRequest({
path: `${API_BASE_PATH}/index-templates/${encodeURIComponent(name)}`,
path: `${API_BASE_PATH}/index_templates/${encodeURIComponent(name)}`,
method: 'put',
body: JSON.stringify(template),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const bodySchema = templateSchema;

export function registerCreateRoute({ router, license, lib }: RouteDependencies) {
router.post(
{ path: addBasePath('/index-templates'), validate: { body: bodySchema } },
{ path: addBasePath('/index_templates'), validate: { body: bodySchema } },
license.guardApiRoute(async (ctx, req, res) => {
const { callAsCurrentUser } = ctx.core.elasticsearch.legacy.client;
const template = req.body as TemplateDeserialized;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const bodySchema = schema.object({
export function registerDeleteRoute({ router, license }: RouteDependencies) {
router.post(
{
path: addBasePath('/delete-index-templates'),
path: addBasePath('/delete_index_templates'),
validate: { body: bodySchema },
},
license.guardApiRoute(async (ctx, req, res) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { addBasePath } from '../index';

export function registerGetAllRoute({ router, license }: RouteDependencies) {
router.get(
{ path: addBasePath('/index-templates'), validate: false },
{ path: addBasePath('/index_templates'), validate: false },
license.guardApiRoute(async (ctx, req, res) => {
const { callAsCurrentUser } = ctx.core.elasticsearch.legacy.client;
const managedTemplatePrefix = await getManagedTemplatePrefix(callAsCurrentUser);
Expand Down Expand Up @@ -55,7 +55,7 @@ const querySchema = schema.object({
export function registerGetOneRoute({ router, license, lib }: RouteDependencies) {
router.get(
{
path: addBasePath('/index-templates/{name}'),
path: addBasePath('/index_templates/{name}'),
validate: { params: paramsSchema, query: querySchema },
},
license.guardApiRoute(async (ctx, req, res) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const paramsSchema = schema.object({
export function registerUpdateRoute({ router, license, lib }: RouteDependencies) {
router.put(
{
path: addBasePath('/index-templates/{name}'),
path: addBasePath('/index_templates/{name}'),
validate: { body: bodySchema, params: paramsSchema },
},
license.guardApiRoute(async (ctx, req, res) => {
Expand Down
Loading

0 comments on commit 090fdba

Please sign in to comment.