Skip to content

Commit

Permalink
Merge pull request #170 from Financial-Times/logs-on-graphite-spike-fail
Browse files Browse the repository at this point in the history
FTDCS-33 added logs to failing graphiteSpike checks
  • Loading branch information
AniaMakes committed Dec 15, 2021
2 parents 802dd99 + bd5c815 commit e95ffbb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/checks/graphiteSpike.check.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class GraphiteSpikeCheck extends Check {
super(options);
this.threshold = options.threshold || 3;
this.direction = options.direction || 'up';
this.id = options.id;
this.name = options.name;

this.samplePeriod = options.samplePeriod || '10min';
this.baselinePeriod = options.baselinePeriod || '7d';
Expand Down Expand Up @@ -114,6 +116,22 @@ class GraphiteSpikeCheck extends Check {
} else {
this.status = status.FAILED;
this.checkOutput = `Spike detected in graphite data. ${details}`;
logger.warn({
event: "graphiteSpike fail",
checkId: this.id,
checkName: this.name,
threshold: this.threshold,
sampleDetails: {
url: this.sampleUrl,
rawValue: sampleValue,
normalisedValue: data.sample
},
baselineDetails: {
url: this.baselineUrl,
rawValue: baselineValue,
normalisedValue: data.baseline
},
})
}

} catch(err) {
Expand Down

0 comments on commit e95ffbb

Please sign in to comment.