-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '7.x' into backport/7.x/pr-70031
- Loading branch information
Showing
191 changed files
with
4,427 additions
and
1,387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.../server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) > [doc\_values](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md) | ||
|
||
## SavedObjectsComplexFieldMapping.doc\_values property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
doc_values?: boolean; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ore/server/kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) > [doc\_values](./kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md) | ||
|
||
## SavedObjectsCoreFieldMapping.doc\_values property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
doc_values?: boolean; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/plugins/kibana_usage_collection/server/collectors/application_usage/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Application Usage | ||
|
||
This collector reports the number of general clicks and minutes on screen for each registered application in Kibana. | ||
|
||
The final payload matches the following contract: | ||
|
||
```JSON | ||
{ | ||
"application_usage": { | ||
"application_ID": { | ||
"clicks_7_days": 10, | ||
"clicks_30_days": 100, | ||
"clicks_90_days": 300, | ||
"clicks_total": 600, | ||
"minutes_on_screen_7_days": 10.40, | ||
"minutes_on_screen_30_days": 20.0, | ||
"minutes_on_screen_90_days": 110.1, | ||
"minutes_on_screen_total": 112.5 | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Where `application_ID` matches the `id` registered when calling the method `core.application.register`. | ||
This collection occurs by default for every application registered via the mentioned method and there is no need to do anything else to enable it or _opt-in_ for your plugin. | ||
|
||
**Note to maintainers in the Kibana repo:** At the moment of writing, the `usageCollector.schema` is not updated automatically ([#70622](https://github.com/elastic/kibana/issues/70622)) so, if you are adding a new app to Kibana, you'll need to give the Kibana Telemetry team a heads up to update the mappings in the Telemetry Cluster accordingly. | ||
|
||
## Developer notes | ||
|
||
In order to keep the count of the events, this collector uses 2 Saved Objects: | ||
|
||
1. `application_usage_transactional`: It stores each individually reported event (up to 90 days old). Grouped by `timestamp` and `appId`. | ||
2. `application_usage_totals`: It stores the sum of all the events older than 90 days old per `appId`. | ||
|
||
Both of them use the shared fields `appId: 'keyword'`, `numberOfClicks: 'long'` and `minutesOnScreen: 'float'`. `application_usage_transactional` also stores `timestamp: { type: 'date' }`. | ||
but they are currently not added in the mappings because we don't use them for search purposes, and we need to be thoughtful with the number of mapped fields in the SavedObjects index ([#43673](https://github.com/elastic/kibana/issues/43673)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* | ||
* 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 expect from '@kbn/expect'; | ||
import { WebElementWrapper } from 'test/functional/services/lib/web_element_wrapper'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const { common, dashboard, settings, timePicker, visChart } = getPageObjects([ | ||
'common', | ||
'dashboard', | ||
'settings', | ||
'timePicker', | ||
'visChart', | ||
]); | ||
const esArchiver = getService('esArchiver'); | ||
const kibanaServer = getService('kibanaServer'); | ||
const testSubjects = getService('testSubjects'); | ||
const browser = getService('browser'); | ||
const fieldName = 'clientip'; | ||
|
||
const clickFieldAndCheckUrl = async (fieldLink: WebElementWrapper) => { | ||
const fieldValue = await fieldLink.getVisibleText(); | ||
await fieldLink.click(); | ||
const windowHandlers = await browser.getAllWindowHandles(); | ||
expect(windowHandlers.length).to.equal(2); | ||
await browser.switchToWindow(windowHandlers[1]); | ||
const currentUrl = await browser.getCurrentUrl(); | ||
const fieldUrl = common.getHostPort() + '/app/' + fieldValue; | ||
expect(currentUrl).to.equal(fieldUrl); | ||
}; | ||
|
||
describe('Changing field formatter to Url', () => { | ||
before(async function () { | ||
await esArchiver.load('dashboard/current/kibana'); | ||
await kibanaServer.uiSettings.replace({ | ||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', | ||
}); | ||
await common.navigateToApp('settings'); | ||
await settings.clickKibanaIndexPatterns(); | ||
await settings.clickIndexPatternLogstash(); | ||
await settings.filterField(fieldName); | ||
await settings.openControlsByName(fieldName); | ||
await settings.setFieldFormat('url'); | ||
await settings.controlChangeSave(); | ||
}); | ||
|
||
it('applied on dashboard', async () => { | ||
await common.navigateToApp('dashboard'); | ||
await dashboard.loadSavedDashboard('dashboard with everything'); | ||
await dashboard.waitForRenderComplete(); | ||
const fieldLink = await visChart.getFieldLinkInVisTable(`${fieldName}: Descending`, 1); | ||
await clickFieldAndCheckUrl(fieldLink); | ||
}); | ||
|
||
it('applied on discover', async () => { | ||
await common.navigateToApp('discover'); | ||
await timePicker.setAbsoluteRange( | ||
'Sep 19, 2017 @ 06:31:44.000', | ||
'Sep 23, 2018 @ 18:31:44.000' | ||
); | ||
await testSubjects.click('docTableExpandToggleColumn'); | ||
const fieldLink = await testSubjects.find(`tableDocViewRow-${fieldName}-value`); | ||
await clickFieldAndCheckUrl(fieldLink); | ||
}); | ||
|
||
afterEach(async function () { | ||
const windowHandlers = await browser.getAllWindowHandles(); | ||
if (windowHandlers.length > 1) { | ||
await browser.closeCurrentWindow(); | ||
await browser.switchToWindow(windowHandlers[0]); | ||
} | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.