Skip to content

Commit

Permalink
Add in cluster version for sec telemetry sender. (#80545)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjhampton committed Oct 15, 2020
1 parent a1d7b0b commit 6c354f7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions x-pack/plugins/security_solution/server/lib/telemetry/sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,13 @@ export class TelemetryEventsSender {
}));
this.queue = [];

await this.sendEvents(toSend, telemetryUrl, clusterInfo.cluster_uuid, licenseInfo?.uid);
await this.sendEvents(
toSend,
telemetryUrl,
clusterInfo.cluster_uuid,
clusterInfo.version?.number,
licenseInfo?.uid
);
} catch (err) {
this.logger.warn(`Error sending telemetry events data: ${err}`);
this.queue = [];
Expand Down Expand Up @@ -202,6 +208,7 @@ export class TelemetryEventsSender {
events: unknown[],
telemetryUrl: string,
clusterUuid: string,
clusterVersionNumber: string | undefined,
licenseId: string | undefined
) {
// this.logger.debug(`Sending events: ${JSON.stringify(events, null, 2)}`);
Expand All @@ -213,8 +220,8 @@ export class TelemetryEventsSender {
headers: {
'Content-Type': 'application/x-ndjson',
'X-Elastic-Cluster-ID': clusterUuid,
'X-Elastic-Stack-Version': clusterVersionNumber ? clusterVersionNumber : '7.10.0',
...(licenseId ? { 'X-Elastic-License-ID': licenseId } : {}),
'X-Elastic-Telemetry': '1', // TODO: no longer needed?
},
});
this.logger.debug(`Events sent!. Response: ${resp.status} ${JSON.stringify(resp.data)}`);
Expand Down

0 comments on commit 6c354f7

Please sign in to comment.