mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Usage Collection] [schema] actions
(#78832)
This commit is contained in:
parent
46af5fcc2d
commit
f398b49200
3 changed files with 100 additions and 2 deletions
|
@ -2,7 +2,6 @@
|
|||
"output": "plugins/telemetry_collection_xpack/schema/xpack_plugins.json",
|
||||
"root": "plugins/",
|
||||
"exclude": [
|
||||
"plugins/actions/server/usage/actions_usage_collector.ts",
|
||||
"plugins/alerts/server/usage/alerts_usage_collector.ts",
|
||||
"plugins/apm/server/lib/apm_telemetry/index.ts"
|
||||
]
|
||||
|
|
|
@ -4,11 +4,26 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
|
||||
import { MakeSchemaFrom, UsageCollectionSetup } from 'src/plugins/usage_collection/server';
|
||||
import { get } from 'lodash';
|
||||
import { TaskManagerStartContract } from '../../../task_manager/server';
|
||||
import { ActionsUsage } from './types';
|
||||
|
||||
const byTypeSchema: MakeSchemaFrom<ActionsUsage>['count_by_type'] = {
|
||||
// TODO: Find out an automated way to populate the keys or reformat these into an array (and change the Remote Telemetry indexer accordingly)
|
||||
DYNAMIC_KEY: { type: 'long' },
|
||||
// Known actions:
|
||||
__email: { type: 'long' },
|
||||
__index: { type: 'long' },
|
||||
__pagerduty: { type: 'long' },
|
||||
'__server-log': { type: 'long' },
|
||||
__slack: { type: 'long' },
|
||||
__webhook: { type: 'long' },
|
||||
__servicenow: { type: 'long' },
|
||||
__jira: { type: 'long' },
|
||||
__resilient: { type: 'long' },
|
||||
};
|
||||
|
||||
export function createActionsUsageCollector(
|
||||
usageCollection: UsageCollectionSetup,
|
||||
taskManager: TaskManagerStartContract
|
||||
|
@ -16,6 +31,12 @@ export function createActionsUsageCollector(
|
|||
return usageCollection.makeUsageCollector<ActionsUsage>({
|
||||
type: 'actions',
|
||||
isReady: () => true,
|
||||
schema: {
|
||||
count_total: { type: 'long' },
|
||||
count_active_total: { type: 'long' },
|
||||
count_by_type: byTypeSchema,
|
||||
count_active_by_type: byTypeSchema,
|
||||
},
|
||||
fetch: async () => {
|
||||
try {
|
||||
const doc = await getLatestTaskState(await taskManager);
|
||||
|
|
|
@ -1,5 +1,83 @@
|
|||
{
|
||||
"properties": {
|
||||
"actions": {
|
||||
"properties": {
|
||||
"count_total": {
|
||||
"type": "long"
|
||||
},
|
||||
"count_active_total": {
|
||||
"type": "long"
|
||||
},
|
||||
"count_by_type": {
|
||||
"properties": {
|
||||
"DYNAMIC_KEY": {
|
||||
"type": "long"
|
||||
},
|
||||
"__email": {
|
||||
"type": "long"
|
||||
},
|
||||
"__index": {
|
||||
"type": "long"
|
||||
},
|
||||
"__pagerduty": {
|
||||
"type": "long"
|
||||
},
|
||||
"__server-log": {
|
||||
"type": "long"
|
||||
},
|
||||
"__slack": {
|
||||
"type": "long"
|
||||
},
|
||||
"__webhook": {
|
||||
"type": "long"
|
||||
},
|
||||
"__servicenow": {
|
||||
"type": "long"
|
||||
},
|
||||
"__jira": {
|
||||
"type": "long"
|
||||
},
|
||||
"__resilient": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"count_active_by_type": {
|
||||
"properties": {
|
||||
"DYNAMIC_KEY": {
|
||||
"type": "long"
|
||||
},
|
||||
"__email": {
|
||||
"type": "long"
|
||||
},
|
||||
"__index": {
|
||||
"type": "long"
|
||||
},
|
||||
"__pagerduty": {
|
||||
"type": "long"
|
||||
},
|
||||
"__server-log": {
|
||||
"type": "long"
|
||||
},
|
||||
"__slack": {
|
||||
"type": "long"
|
||||
},
|
||||
"__webhook": {
|
||||
"type": "long"
|
||||
},
|
||||
"__servicenow": {
|
||||
"type": "long"
|
||||
},
|
||||
"__jira": {
|
||||
"type": "long"
|
||||
},
|
||||
"__resilient": {
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"canvas": {
|
||||
"properties": {
|
||||
"workpads": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue