Skip to content

Commit

Permalink
Updates commits with better error handling and debug
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHassanabad committed Feb 15, 2022
1 parent 2915b95 commit 8ea3908
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ export const getMlJobMetrics = async ({
ml_job_metrics: jobMetrics,
};
} catch (e) {
// ignore failure, usage will be zeroed
logger.info(
`Encountered exception in telemetry of message: ${e.message}, error: ${e}. Telemetry for "ml_jobs" will be skipped.`
);
// ignore failure, usage will be zeroed. We don't log the message below as currently ML jobs when it does
// not have a "security" job will cause a throw. If this does not normally throw eventually on normal operations
// we should log a debug message like the following below to not unnecessarily worry users as this will not effect them:
// logger.debug(
// `Encountered unexpected condition in telemetry of message: ${e.message}, object: ${e}. Telemetry for "ml_jobs" will be skipped.`
// );
return {
ml_job_usage: getInitialMlJobUsage(),
ml_job_metrics: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ export const getRuleMetrics = async ({
detection_rule_usage: rulesUsage,
};
} catch (e) {
// ignore failure, usage will be zeroed
logger.info(
`Encountered exception in telemetry of message: ${e.message}, error: ${e}. Telemetry for "detection rules" being skipped.`
// ignore failure, usage will be zeroed. We use debug mode to not unnecessarily worry users as this will not effect them.
logger.debug(
`Encountered unexpected condition in telemetry of message: ${e.message}, object: ${e}. Telemetry for "detection rules" being skipped.`
);
return {
detection_rule_detail: [],
Expand Down

0 comments on commit 8ea3908

Please sign in to comment.