diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/async_sender.ts b/x-pack/plugins/security_solution/server/lib/telemetry/async_sender.ts index 6c2def2abb61d..edbd5d21e3aea 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/async_sender.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/async_sender.ts @@ -276,28 +276,15 @@ export class AsyncTelemetryEventsSender implements IAsyncTelemetryEventsSender { private enrich(event: Event): Event { const clusterInfo = this.telemetryReceiver?.getClusterInfo(); - // TODO(szaffarano): generalize the enrichment at channel level to not hardcode the logic here if (typeof event.payload === 'object') { let additional = {}; - if (event.channel !== TelemetryChannel.TASK_METRICS) { - additional = { - cluster_name: clusterInfo?.cluster_name, - cluster_uuid: clusterInfo?.cluster_uuid, - }; - } else { - additional = { - cluster_uuid: clusterInfo?.cluster_uuid, - }; - } - - if (event.channel === TelemetryChannel.ENDPOINT_ALERTS) { - const licenseInfo = this.telemetryReceiver?.getLicenseInfo(); - additional = { - ...additional, - ...(licenseInfo ? { license: copyLicenseFields(licenseInfo) } : {}), - }; - } + const licenseInfo = this.telemetryReceiver?.getLicenseInfo(); + additional = { + cluster_name: clusterInfo?.cluster_name, + cluster_uuid: clusterInfo?.cluster_uuid, + ...(licenseInfo ? { license: copyLicenseFields(licenseInfo) } : {}), + }; event.payload = { ...event.payload, diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/telemetry/remove_time_fields_from_telemetry_stats.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/telemetry/remove_time_fields_from_telemetry_stats.ts index 912649862a24f..2d27b375684ba 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/telemetry/remove_time_fields_from_telemetry_stats.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/telemetry/remove_time_fields_from_telemetry_stats.ts @@ -15,6 +15,8 @@ export const removeExtraFieldsFromTelemetryStats = (stats: any) => { unset(value, `[${i}][${j}].start_time`); unset(value, `[${i}][${j}].end_time`); unset(value, `[${i}][${j}].cluster_uuid`); + unset(value, `[${i}][${j}].cluster_name`); + unset(value, `[${i}][${j}].license`); }); }); });