Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Make the /metrics page disableable with $DISABLE_METRICS
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Nov 11, 2016
1 parent fd4a512 commit a18437a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions server/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ var conf = convict({
env: "REFRESH_METRICS_TIME",
arg: "refresh-metrics-time"
},
disableMetrics: {
doc: "If true, do not mount /metrics or start jobs",
format: Boolean,
default: false,
env: "DISABLE_METRICS",
arg: "disable-metrics"
},
allowExport: {
doc: "Whether to allow exporting shots",
format: Boolean,
Expand Down
4 changes: 3 additions & 1 deletion server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,9 @@ app.use(function (err, req, res, next) {
errorResponse(res, "General error:", err);
});

app.use("/metrics", require("./pages/metrics/server").app);
if (! config.disableMetrics) {
app.use("/metrics", require("./pages/metrics/server").app);
}

app.use("/shots", require("./pages/shotindex/server").app);

Expand Down

0 comments on commit a18437a

Please sign in to comment.