mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Telemetry][Security Solution] Always enrich telemetry documents with license info (#188832)
This commit is contained in:
parent
3f3713b567
commit
61ad27e863
2 changed files with 8 additions and 19 deletions
|
@ -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,
|
||||
|
|
|
@ -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`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue