mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
count err status codes in security telemetry (#125120)
This commit is contained in:
parent
35f51bb96b
commit
1a0e4a50d5
1 changed files with 8 additions and 0 deletions
|
@ -318,6 +318,14 @@ export class TelemetryEventsSender implements ITelemetryEventsSender {
|
|||
this.logger.debug(`Events sent!. Response: ${resp.status} ${JSON.stringify(resp.data)}`);
|
||||
} catch (err) {
|
||||
this.logger.debug(`Error sending events: ${err}`);
|
||||
const errorStatus = err?.response?.status;
|
||||
if (errorStatus !== undefined && errorStatus !== null) {
|
||||
this.telemetryUsageCounter?.incrementCounter({
|
||||
counterName: createUsageCounterLabel(usageLabelPrefix.concat(['payloads', channel])),
|
||||
counterType: errorStatus.toString(),
|
||||
incrementBy: 1,
|
||||
});
|
||||
}
|
||||
this.telemetryUsageCounter?.incrementCounter({
|
||||
counterName: createUsageCounterLabel(usageLabelPrefix.concat(['payloads', channel])),
|
||||
counterType: 'docs_lost',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue