-
Notifications
You must be signed in to change notification settings - Fork 3
OAuth2 Client Tracking
Allan Hardy edited this page Sep 20, 2016
·
1 revision
If your API is requires OAuth2 to authorize requests, Meters are used to track requests by client_id
. This allows us track requests rates, an overall percentage of requests per client / per endpoint, and error rates per client.
Example:
{
Name: "GET api/values",
Count: 1,
MeanRate: 0.01,
OneMinuteRate: 0.02,
FiveMinuteRate: 0.13,
FifteenMinuteRate: 0.17,
Unit: "Requests",
RateUnit: "s",
Items: [
{
Item: "client9",
Count: 1,
MeanRate: 0.01,
OneMinuteRate: 0.02,
FiveMinuteRate: 0.13,
FifteenMinuteRate: 0.17,
Percent: 100
}
]
},
{
Name: "GET api/values/unauth",
Count: 3,
MeanRate: 0.02,
OneMinuteRate: 0.09,
FiveMinuteRate: 0.41,
FifteenMinuteRate: 0.53,
Unit: "Requests",
RateUnit: "s",
Items: [
{
Item: "client7",
Count: 1,
MeanRate: 0.01,
OneMinuteRate: 0.03,
FiveMinuteRate: 0.14,
FifteenMinuteRate: 0.18,
Percent: 33.33
},
{
Item: "client8",
Count: 1,
MeanRate: 0.01,
OneMinuteRate: 0.03,
FiveMinuteRate: 0.14,
FifteenMinuteRate: 0.18,
Percent: 33.33
},
{
Item: "client9",
Count: 1,
MeanRate: 0.01,
OneMinuteRate: 0.03,
FiveMinuteRate: 0.14,
FifteenMinuteRate: 0.18,
Percent: 33.33
}
]
}
On the per request timer we also get the LastUserValue
, MaxUserValue
and MinUserValue
in the Histogram.
Example:
{
Name: "GET api/values",
Count: 1,
ActiveSessions: 0,
TotalTime: 771,
Rate: {
MeanRate: 0.01,
OneMinuteRate: 0.02,
FiveMinuteRate: 0.13,
FifteenMinuteRate: 0.17
},
Histogram: {
LastValue: 771.42,
LastUserValue: "client9",
Min: 771.42,
MinUserValue: "client9",
Mean: 771.42,
MaxUserValue: "client9",
StdDev: 0,
Median: 771.42,
Percentile75: 771.42,
Percentile95: 771.42,
Percentile98: 771.42,
Percentile99: 771.42,
Percentile999: 771.42,
SampleSize: 1
},
Unit: "Requests",
RateUnit: "s",
DurationUnit: "ms"
}
The metrics context name for the OAuth2 Client tracking Meters is Application.OAuth2Client.WebRequests
.