forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CCR] Instrument CCR and Remote Clusters to track UI metric telemetry (…
- Loading branch information
Showing
23 changed files
with
245 additions
and
38 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
|
||
export { API_STATUS } from './api'; | ||
export { SECTIONS } from './sections'; | ||
export * from './ui_metric'; |
25 changes: 25 additions & 0 deletions
25
x-pack/plugins/cross_cluster_replication/public/app/constants/ui_metric.js
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,25 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export const UIM_APP_NAME = 'cross_cluster_replication'; | ||
|
||
export const UIM_FOLLOWER_INDEX_LIST_LOAD = 'follower_index_list_load'; | ||
export const UIM_FOLLOWER_INDEX_CREATE = 'follower_index_create'; | ||
export const UIM_FOLLOWER_INDEX_UPDATE = 'follower_index_update'; | ||
export const UIM_FOLLOWER_INDEX_PAUSE = 'follower_index_pause'; | ||
export const UIM_FOLLOWER_INDEX_PAUSE_MANY = 'follower_index_pause_many'; | ||
export const UIM_FOLLOWER_INDEX_RESUME = 'follower_index_resume'; | ||
export const UIM_FOLLOWER_INDEX_RESUME_MANY = 'follower_index_resume_many'; | ||
export const UIM_FOLLOWER_INDEX_UNFOLLOW = 'follower_index_unfollow'; | ||
export const UIM_FOLLOWER_INDEX_UNFOLLOW_MANY = 'follower_index_unfollow_many'; | ||
export const UIM_FOLLOWER_INDEX_USE_ADVANCED_OPTIONS = 'follower_index_use_advanced_options'; | ||
export const UIM_FOLLOWER_INDEX_SHOW_DETAILS_CLICK = 'follower_index_show_details_click'; | ||
export const UIM_AUTO_FOLLOW_PATTERN_LIST_LOAD = 'auto_follow_patter_list_load'; | ||
export const UIM_AUTO_FOLLOW_PATTERN_CREATE = 'auto_follow_pattern_create'; | ||
export const UIM_AUTO_FOLLOW_PATTERN_UPDATE = 'auto_follow_pattern_update'; | ||
export const UIM_AUTO_FOLLOW_PATTERN_DELETE = 'auto_follow_pattern_delete'; | ||
export const UIM_AUTO_FOLLOW_PATTERN_DELETE_MANY = 'auto_follow_pattern_delete_many'; | ||
export const UIM_AUTO_FOLLOW_PATTERN_SHOW_DETAILS_CLICK = 'auto_follow_pattern_show_details_click'; |
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
28 changes: 28 additions & 0 deletions
28
x-pack/plugins/cross_cluster_replication/public/app/services/track_ui_metric.js
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,28 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { createUiMetricUri } from '../../../../../common/ui_metric'; | ||
import { UIM_APP_NAME } from '../constants'; | ||
import { getHttpClient } from './api'; | ||
|
||
export function trackUiMetric(actionType) { | ||
const uiMetricUri = createUiMetricUri(UIM_APP_NAME, actionType); | ||
getHttpClient().post(uiMetricUri); | ||
} | ||
|
||
/** | ||
* Transparently return provided request Promise, while allowing us to track | ||
* a successful completion of the request. | ||
*/ | ||
export function trackUserRequest(request, actionType) { | ||
// Only track successful actions. | ||
return request.then(response => { | ||
trackUiMetric(actionType); | ||
// We return the response immediately without waiting for the tracking request to resolve, | ||
// to avoid adding additional latency. | ||
return response; | ||
}); | ||
} |
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 |
---|---|---|
|
@@ -7,3 +7,5 @@ | |
export { | ||
CRUD_APP_BASE_PATH, | ||
} from './paths'; | ||
|
||
export * from './ui_metric'; |
14 changes: 14 additions & 0 deletions
14
x-pack/plugins/remote_clusters/public/constants/ui_metric.js
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,14 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export const UIM_APP_NAME = 'remote_clusters'; | ||
|
||
export const UIM_APP_LOAD = 'app_load'; | ||
export const UIM_CLUSTER_ADD = 'cluster_add'; | ||
export const UIM_CLUSTER_UPDATE = 'cluster_update'; | ||
export const UIM_CLUSTER_REMOVE = 'cluster_remove'; | ||
export const UIM_CLUSTER_REMOVE_MANY = 'cluster_remove_many'; | ||
export const UIM_SHOW_DETAILS_CLICK = 'show_details_click'; |
Oops, something went wrong.