Skip to content

Commit

Permalink
Merge pull request #577 from Financial-Times/add-healthcheck-ids
Browse files Browse the repository at this point in the history
Add id to default checks
  • Loading branch information
Nick Ramsbottom committed Mar 4, 2020
2 parents e768431 + 17fbe19 commit 740957e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/error-rate-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = (appName, opts) => {
let region = process.env.REGION ? '_' + process.env.REGION : '';

return nHealth.runCheck({
id: 'error-rate',
name: `Error rate: greater than ${threshold}% of requests for ${appName}`,
type: 'graphiteThreshold',
metric: `asPercent(summarize(sumSeries(next.heroku.${appName}.web_*${region}.express.*.res.status.{500,503,504}.count), '${samplePeriod}', 'sum', true), summarize(sumSeries(next.heroku.${appName}.web_*${region}.express.*.res.status.*.count), '${samplePeriod}', 'sum', true))`,
Expand Down
1 change: 1 addition & 0 deletions src/lib/metrics-healthcheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = (appName) => {
return {
getStatus: () => {
return {
id: 'next-metrics-configuration-valid',
name: `Metrics: next-metrics configuration valid for ${appName}`,
ok: metrics.hasValidConfiguration,
checkOutput: metrics.hasValidConfiguration ? `next-metrics configuration is valid for ${appName}` : `next-metrics configuration is NOT valid for ${appName}`,
Expand Down
1 change: 1 addition & 0 deletions src/lib/unregistered-services-healthCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
return {
getStatus: () => {
return {
id: 'all-services-registered',
name: `Metrics: All services for ${appName} registered in next-metrics`,
ok: lastCheckOk,
checkOutput: lastCheckOutput,
Expand Down

0 comments on commit 740957e

Please sign in to comment.