This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
forked from steppenwells/guardian-management
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enables pan-app request metrics in the example-play app.
I think this is the canonical way to enable these metrics. It's worth noting that the metrics previously set up in Global.scala weren't actually getting displayed anywhere, as they weren't being passed into the constructor of the management StatusPage. Also use internal Management server (port 18080) for example-play app - this makes it easy to do request metrics that cover the entire app, but not count requests to the management urls themselves.
- Loading branch information
Showing
5 changed files
with
26 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import com.gu.management.play.{ OkCounter, RequestTimer } | ||
import com.gu.management.{ TimingMetric, CountMetric } | ||
import com.gu.management.play.{ StatusCounters, RequestTimer } | ||
import play.api.GlobalSettings | ||
|
||
object Global extends GlobalSettings with RequestTimer with OkCounter { | ||
override val okCounter = new CountMetric("status", "200_ok", "Status OK", "requests that return a status of 200") | ||
override val requestTimer = new TimingMetric("performance", "request", "Request", "time taken to serve requests") | ||
object Global extends GlobalSettings with RequestTimer with StatusCounters { | ||
import conf.RequestMetrics._ | ||
|
||
override val okCounter = Request200s | ||
override val errorCounter = Request50xs | ||
override val notFoundCounter = Request404s | ||
override val redirectCounter = Request30xs | ||
override val requestTimer = conf.TimingMetrics.requests | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1000:com.gu.management.play.InternalManagementPlugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters