Skip to content

Commit

Permalink
Only maintain telemetry event types related to core features in core …
Browse files Browse the repository at this point in the history
…repo (#19471)

* Only keep maintain core telemetry events in core repo.

* Add comment

* Remove comment.
  • Loading branch information
linuspahl committed Jun 4, 2024
1 parent 11f6280 commit 959f23d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 152 deletions.
156 changes: 5 additions & 151 deletions graylog2-web-interface/src/logic/telemetry/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
* <http://www.mongodb.com/licensing/server-side-public-license>.
*/

// Please note, each project has its own collection of telemetry event types.
// Only maintain event types related to core features in this file.

// eslint-disable-next-line import/prefer-default-export
export const TELEMETRY_EVENT_TYPE = {
SEARCH_TIMERANGE_PRESET_SELECTED: 'Search TimeRange Preset Selected',
SEARCH_TIMERANGE_PICKER_TOGGLED: 'Search TimeRange Picker Toggled',
Expand All @@ -25,20 +29,6 @@ export const TELEMETRY_EVENT_TYPE = {
SEARCH_REFRESH_CONTROL_PRESET_SELECTED: 'Search Refresh Control Preset Selected',
SEARCH_REFRESH_CONTROL_TOGGLED: 'Search Refresh Control Toggled',
SEARCH_BUTTON_CLICKED: 'Search Button Clicked',
SEARCH_FILTER_CREATE_CLICKED: 'Search Filter Create Clicked',
SEARCH_FILTER_CREATED: 'Search Filter Created',
SEARCH_FILTER_UPDATED: 'Search Filter Updated',
SEARCH_FILTER_DELETED: 'Search Filter Deleted',
SEARCH_FILTER_LOAD_CLICKED: 'Search Filter Load Clicked',
SEARCH_FILTER_LOADED: 'Search Filter Loaded',
SEARCH_FILTER_ITEM_MENU_TOGGLED: 'Search Filter Item Menu Toggled',
SEARCH_FILTER_ITEM_DISABLED_TOGGLED: 'Search Filter Item Disabled Toggled',
SEARCH_FILTER_ITEM_SHARE_CLICKED: 'Search Filter Item Share Clicked',
SEARCH_FILTER_ITEM_EDIT_CLICKED: 'Search Filter Item Edit Clicked',
SEARCH_FILTER_ITEM_COPIED: 'Search Filter Item Copied',
SEARCH_FILTER_ITEM_REMOVED: 'Search Filter Item Removed',
SEARCH_FILTER_ITEM_REFERENCE_REPLACED: 'Search Filter Item Reference Replaced',
SEARCH_FILTER_ITEM_NEGATION_TOGGLED: 'Search Filter Item Negation Toggled',
SEARCH_WIDGET_EXPORT_DOWNLOADED: 'Search Widget Export Downloaded',
SEARCH_TIMERANGE_PRESET_ADD_QUICK_ACCESS: 'Search TimeRange Preset Add Quick Access',
SEARCH_WIDGET_ACTION: {
Expand Down Expand Up @@ -138,16 +128,6 @@ export const TELEMETRY_EVENT_TYPE = {
FILTER_EVENT_LIMIT_CHANGED: 'EventDefinition Condition Filter Event Limit Changed',
AGGREGATION_TOGGLED: 'EventDefinition Aggregation Toggled',
AGGREGATION_GROUP_BY_FIELD_SELECTED: 'EventDefinition Aggregation Group By Field Selected',
CORRELATION_WITHIN_THE_LAST_UNIT_CHANGED: 'EventDefinition Condition Correlation Within The Last Unit Changed',
CORRELATION_EXECUTE_EVERY_UNIT_CHANGED: 'EventDefinition Condition Correlation Execute Every Unit Changed',
CORRELATION_EXECUTED_AUTOMATICALLY_TOGGLED: 'EventDefinition Condition Correlation Executed Automatically Toggled',
CORRELATION_EVENT_SELECTED: 'EventDefinition Condition Correlation Event Selected',
CORRELATION_ADD_EVENT_CLICKED: 'EventDefinition Condition Correlation Add Event Clicked',
CORRELATION_REMOVE_EVENT_CLICKED: 'EventDefinition Condition Correlation Remove Event Clicked',
CORRELATION_OCCURRENCE_TIME_CHANGED: 'EventDefinition Condition Correlation Occurrence Time Changed',
CORRELATION_NO_OCCURRENCE_FOLLOWED_BY_EVENT_SELECTED: 'EventDefinition Condition Correlation No Occurrence Followed By Event Selected',
CORRELATION_NO_OCCURRENCE_IN_THE_NEXT_SELECTED: 'EventDefinition Condition Correlation No Occurrence In The Next Selected',
CORRELATION_NO_OCCURRENCE_IN_THE_NEXT_UNIT_CHANGED: 'EventDefinition Condition Correlation No Occurrence In The Next Unit Changed',
},
EVENTDEFINITION_FIELDS: {
STEP_CLICKED: 'EventDefinition Fields Step Clicked',
Expand Down Expand Up @@ -241,116 +221,6 @@ export const TELEMETRY_EVENT_TYPE = {
EDIT_CONDITION_CLICKED: 'Pipeline RuleBuilder Edit Condition Clicked',
EDIT_ACTION_CLICKED: 'Pipeline RuleBuilder Edit Action Clicked',
},
ILLUMINATE: {
BUNDLE_UPLOADED: 'Illuminate Bundle Uploaded',
BUNDLE_DOWNLOADED_AND_INSTALLED: 'Illuminate Bundle Downloaded and Installed',
PACK_ENABLE_MODAL_TOGGLED: 'Illuminate Pack Enable Modal Toggled',
PACK_DISABLE_MODAL_TOGGLED: 'Illuminate Pack Modal Toggled',
PACKS_BULK_UPDATED: 'Illuminate Packs Bulk Updated',
PACKS_OVERRIDE_FORM_OPENED: 'Illuminate Packs Override Form Opened',
PACKS_OVERRIDE_SAVED: 'Illuminate Packs Override Saved',
},
SECURITY_APP: {
ASSET_DELETED: 'Security Asset Deleted',
ASSET_SOURCE_DELETED: 'Security Asset Source Deleted',
ASSET_CONFIG_REPRIORITIZED: 'Security Asset Config Reprioritized',
ASSET_CONFIG_CATEGORY_ADDED: 'Security Asset Config Category Added',
ASSET_CONFIG_CATEGORY_UPDATED: 'Security Asset Config Category Updated',
ASSET_CONFIG_CATEGORY_DELETED: 'Security Asset Config Category Deleted',
ASSET_CONFIG_PRIORITY_ADDED: 'Security Asset Config Priority Added',
ASSET_CONFIG_PRIORITY_UPDATED: 'Security Asset Config Priority Updated',
ASSET_CONFIG_PRIORITY_DELETED: 'Security Asset Config Priority Deleted',
INVESTIGATION_UPDATED: 'Security Investigation Update',
INVESTIGATION_ARCHIVED: 'Security Investigation Archived',
INVESTIGATION_EDITED: 'Security Investigation Updated',
INVESTIGATION_RESTORED: 'Security Investigation Restored',
INVESTIGATION_DELETED: 'Security Investigation Deleted',
INVESTIGATION_PRIORITY_ADDED: 'Security Investigation Priority Added',
INVESTIGATION_PRIORITY_UPDATED: 'Security Investigation Priority Updated',
INVESTIGATION_PRIORITY_DELETED: 'Security Investigation Priority Deleted',
INVESTIGATION_PRIORITY_REPRIORITIZED: 'Security Investigation Priority Reprioritized',
INVESTIGATION_PRIORITY_DEFAULT_SET: 'Security Investigation Priority Default Set',
INVESTIGATION_PRIORITY_DEFAULT_REMOVED: 'Security Investigation Priority Default Removed',
INVESTIGATION_STATUS_ADDED: 'Security Investigation Status Added',
INVESTIGATION_STATUS_UPDATED: 'Security Investigation Status Updated',
INVESTIGATION_STATUS_DELETED: 'Security Investigation Status Deleted',
INVESTIGATION_STATUS_REPRIORITIZED: 'Security Investigation Status Reprioritized',
INVESTIGATION_STATUS_DEFAULT_SET: 'Security Investigation Status Default Set',
INVESTIGATION_STATUS_DEFAULT_REMOVED: 'Security Investigation Status Default Removed',
INVESTIGATION_DETAILS_UPDATED: 'Security Investigation Details Updated',
INVESTIGATION_DRAWER_OPENED: 'Security Investigation Drawer Opened',
INVESTIGATION_DRAWER_CLOSED: 'Security Investigation Drawer Closed',
INVESTIGATION_DRAWER_COLLAPSE_TOGGLED: 'Security Investigation Drawer Collapse Toggled',
INVESTIGATION_NOTE_ADDED: 'Security Investigation Note Added',
INVESTIGATION_NOTE_SAVED: 'Security Investigation Note Saved',
INVESTIGATION_NOTE_EDIT: 'Security Investigation Note Updated',
INVESTIGATION_NOTE_DELETED: 'Security Investigation Note Deleted',
INVESTIGATION_DETAILS_SECTION_OPENED: 'Security Investigation Details Section Opened',
INVESTIGATION_TIMELINE_FILTER_UPDATED: 'Security Investigation Timeline Filter Updated',
INVESTIGATION_TIMELINE_CAROUSEL_NAVIGATED: 'Security Investigation Timeline Carousel Navigated',
SIGMA_IMPORT_RULES_OPENED: 'Security Sigma Rules Import Opened',
SIGMA_IMPORT_RULES_IMPORTED: 'Security Sigma Rules Imported',
SIGMA_RULE_UPDATED: 'Security Sigma Rules Update',
SIGMA_RULE_CREATED: 'Security Sigma Rules Created',
ANOMALY_DETECTION_SAVED: 'Security Anomaly Detection Saved',
ANOMALY_DETECTION_DELETED: 'Security Anomaly Detection Deleted',
},
FORWARDER: {
INPUTPROFILE_FORWARDER_ASSIGNED: 'Forwarder Input Profile Forwarder Assigned',
FORWARDER_WIZARD_WELCOME_STEP_OPENED: 'Forwarder Wizard Welcome Step Opened',
FORWARDER_WIZARD_SELECT_FORWARDER_STEP_OPENED: 'Forwarder Wizard Select Forwarder Step Opened',
FORWARDER_WIZARD_CONFIGURE_FORWARDER_STEP_OPENED: 'Forwarder Wizard Configure Forwarder Step Opened',
FORWARDER_WIZARD_INPUTS_STEP_OPENED: 'Forwarder Wizard Forwarder Inputs Step Opened',
FORWARDER_WIZARD_SUMMARY_STEP_OPENED: 'Forwarder Wizard Forwarder Summary Step Opened',
FORWARDER_WIZARD_CONFIGURE_FORWARDER_SELECTED: 'Forwarder Wizard Configure Forwarder Selected',
FORWARDER_WIZARD_CONFIGURE_FORWARDER_SAVED: 'Forwarder Wizard Configure Forwarder Saved',
FORWARDER_WIZARD_INPUT_PROFILE_SELECTED: 'Forwarder Wizard Input Profile Selected',
FORWARDER_WIZARD_INPUT_PROFILE_SAVED: 'Forwarder Wizard Input Profile Saved',
FORWARDER_INPUT_PROFILE_CREATED: 'Forwarder Input Profile Created',
FORWARDER_CREATED: 'Forwarder Created',
FORWARDER_UPDATED: 'Forwarder Updated',
FORWARDER_DELETED: 'Forwarder Created',
FORWARDER_CONFIGURATION_REMOVED: 'Forwarder Configuration Removed',
FORWARDER_INPUT_PROFILE_UPDATED: 'Forwarder Input Profile Updated',
FORWARDER_INPUT_PROFILE_FORWARDER_ASSIGNED: 'Forwarder Input Profile Forwarder Assigned',
FORWARDER_INPUT_PROFILE_CREATE_CANCELED: 'Forwarder Input Profile Create Canceled',
FORWARDER_INPUT_PROFILE_INPUT_CREATED: 'Forwarder Input Profile Input Created',
FORWARDER_INPUT_PROFILE_INPUT_UPDATED: 'Forwarder Input Profile Input Updated',
FORWARDER_INPUT_PROFILE_INPUT_DELETED: 'Forwarder Input Profile Input Deleted',
FORWARDER_WIZARD_SETUP_CANCELED: 'Forwarder Wizard Setup Canceled',
},
ARCHIVE: {
DELETED: 'Archive Deleted',
RESTORED: 'Archive Restored',
CREATED: 'Archive Created',
ITEM_DETAILS_TOGGLED: 'Archive Item Details Opened',
BACKEND_CONFIGURATION_UPDATED: 'Archive Backend Configuration Updated',
BACKEND_CONFIGURATION_CREATED: 'Archive Backend Configuration Created',
BACKEND_CONFIGURATION_DELETED: 'Archive Backend Configuration Deleted',
CONFIGURATION_UPDATED: 'Archive Configuration Update',
},
LICENSE: {
VALIDATED: 'License Validated',
SAVED: 'License Saved',
DELETED: 'License Deleted',
},
REPORT: {
CONFIGURED: 'Report Configured',
DELETED: 'Report Deleted',
SENT: 'Report Sent',
CREATED: 'Report Created',
UPDATED: 'Report Updated',
},
CUSTOMIZATION: {
NOTIFICATION_CREATED: 'Customization Notification Created',
NOTIFICATION_DELETED: 'Customization Notification Deleted',
NOTIFICATION_BULK_DELETED: 'Customization Notification Bulk Deleted',
THEME_REVERTED: 'Customization Theme Reverted',
THEME_RESETED: 'Customization Theme Reseted',
HEADER_BADGE_UPDATED: 'Customization Header Badge Updated',
},
TRAFFIC_VIOLATION_CONFIGURATION_SAVED: 'Traffic Violation Configuration Saved',
FAILURE_PROCESSING_CONFIGURATION_SAVED: 'Failure Processing Configuration Saved',
SHORTCUT_TYPED: 'Shortcut Typed',
CONFIGURATIONS: {
INDEX_SETS_UPDATED: 'Configurations Index Sets Defaults Updated',
Expand Down Expand Up @@ -424,18 +294,14 @@ export const TELEMETRY_EVENT_TYPE = {
USER_UNASSIGNED: 'Roles User Unassigned',
},
AUTHENTICATION: {
DIRECTORY_GROUP_SYNC_SAVE_CLICKED: 'Authentication Directory Group Sync Save Clicked',
CONFIG_UPDATED: 'Authentication Config Updated',
SERVICE_CREATED: 'Authentication Service Created',
SERVICE_SELECTED: 'Authentication Service Selected',
DIRECTORY_SERVER_CONFIG_SAVE_CLICKED: 'Authentication Directory Server Config Save Clicked',
DIRECTORY_USER_SYNC_SAVE_CLICKED: 'Authentication Directory User Sync Save Clicked',
DIRECTORY_GROUP_SYNC_SAVE_CLICKED: 'Authentication Directory Group Sync Save Clicked',
DIRECTORY_NEXT_USER_SYNC_CLICKED: 'Authentication Directory Next User Sync Clicked',
DIRECTORY_NEXT_GROUP_SYNC_CLICKED: 'Authentication Directory Next Group Sync Clicked',
OIDC_SERVER_CONFIG_SAVE_CLICKED: 'Authentication OIDC Server Config Save Clicked',
OIDC_NEXT_GROUP_SYNC_CLICKED: 'Authentication OIDC Next Group Sync Clicked',
OIDC_PREVIOUS_SERVER_CONFIG_CLICKED: 'Authentication OIDC Previous Server Config Clicked',
OIDC_GROUP_SYNC_SAVE_CLICKED: 'Authentication OIDC Group Sync Save Clicked',
},
SIDECARS: {
CONFIGURATION_CREATED: 'Sidecar Configuration Created',
Expand All @@ -458,12 +324,6 @@ export const TELEMETRY_EVENT_TYPE = {
DOWNLOADED: 'Content Pack Downloaded',
ALL_VERSIONS_DELETED: 'Content Pack All Versions Deleted',
},
TEAM: {
CREATED: 'Team Created',
ASSIGNED: 'Team Assigned',
UNASSIGNED: 'Team Unassigned',
DELETED: 'Team Deleted',
},
INDEX_SET_FIELD_TYPE_PROFILE: {
NEW_OPENED: 'Index Set Field Type Profile Creating New Opened',
NEW_CANCELED: 'Index Set Field Type Profile Creating New Canceled',
Expand All @@ -478,9 +338,3 @@ export const TELEMETRY_EVENT_TYPE = {
CREATE_PROFILE_FROM_SELECTED_RAN: 'Index Set Field Type Profile Create From Selected Ran',
},
} as const;

type ExtractObjectValues<T extends object> = {
[K in keyof T]: T[K] extends object ? ExtractObjectValues<T[K]> : T[K];
}[keyof T];

export type EventType = ExtractObjectValues<typeof TELEMETRY_EVENT_TYPE>;
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import * as React from 'react';

import { singleton } from 'logic/singleton';
import type { EventType } from 'logic/telemetry/Constants';
import type { EventType } from 'logic/telemetry/types';

export type TelemetryEvent = {
app_path_pattern?: string,
Expand Down
25 changes: 25 additions & 0 deletions graylog2-web-interface/src/logic/telemetry/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (C) 2020 Graylog, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Server Side Public License for more details.
*
* You should have received a copy of the Server Side Public License
* along with this program. If not, see
* <http://www.mongodb.com/licensing/server-side-public-license>.
*/

import type { ExtractObjectValues } from 'util/UtilityTypes';
import type { TELEMETRY_EVENT_TYPE } from 'logic/telemetry/Constants';

export interface EventTypes {
core: ExtractObjectValues<typeof TELEMETRY_EVENT_TYPE>
}

export type EventType = EventTypes[keyof EventTypes];
20 changes: 20 additions & 0 deletions graylog2-web-interface/src/util/UtilityTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (C) 2020 Graylog, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Server Side Public License for more details.
*
* You should have received a copy of the Server Side Public License
* along with this program. If not, see
* <http://www.mongodb.com/licensing/server-side-public-license>.
*/

export type ExtractObjectValues<T extends object> = {
[K in keyof T]: T[K] extends object ? ExtractObjectValues<T[K]> : T[K];
}[keyof T];

0 comments on commit 959f23d

Please sign in to comment.