Get health metrics for a service
get
/v1/sitemetrics/{serviceName}
Returns requests count, average latency, percentage, success and error metrics at service level and sub service up to 3 levels for a given site for a given time interval. Currently, only 'chat' service is supported.
Request
Path Parameters
-
serviceName(required): string
The name of the subservice for which the metrics are retrieved. The default value is chat.Example:
chat
Header Parameters
-
Authorization(required): string
The JWT token for authentication. The token should be passed in the format: Bearer [jwtToken]
-
fromDate: string
The start date to filter the metrics data. Format: YYYY-MM-DDTHH:mm:ssZ. If fromDate and toDate are provided, then the metrics data within that time range is retrieved. If timeInterval and fromDate are provided, then the metrics data for the time interval starting from the fromDate is retrieved.Example:
2025-01-31T05:28:00Z
-
timeInterval: integer
The time interval (in minutes) to filter the metric data. If timeInterval and fromDate are provided, then the metrics data for the time interval starting from the fromDate is retrieved. If timeInterval and toDate are provided, then the metrics data for the time interval starting from the computed fromDate is retrieved. Minimum Value is 1. Maximum Value is 120. Default value is 120.Example:
100
-
toDate: string
The end date to filter the data. Format: YYYY-MM-DDTHH:mm:ssZ. If fromDate and toDate are provided, then the metrics data within that time range is retrieved. If timeInterval and toDate are provided, then the metrics data for the time interval starting from the computed fromDate is retrieved.Example:
22025-01-31T06:20:00Z
There's no request body for this operation.
Back to TopResponse
Supported Media Types
- application/json
- string
200 Response
Metrics returned successfully
Root Schema : metricOverviewService
Type:
object
Metrics Overview consists of Service-level and Site-level metric.
Show Source
-
serviceMetrics: array
ServiceMetrics
Title:
ServiceMetrics
The list of service metrics with their respective metrics. -
siteMetrics: object
siteMetrics
Title:
siteMetrics
The site metrics with their respective metrics. -
siteName: string
The site name for which the metrics data is retrieved.
-
timeInterval: string
The time interval (in minutes) for which the metrics data is retrieved.
-
updatedTime: string
The last updated time for which the metrics data is retrieved.
Nested Schema : ServiceMetrics
Type:
array
Title:
ServiceMetrics
The list of service metrics with their respective metrics.
Show Source
-
Array of:
object serviceMetricService
Title:
serviceMetricService
Service metrics.
Nested Schema : siteMetrics
Type:
object
Title:
siteMetrics
The site metrics with their respective metrics.
Show Source
-
averageLatency: number
The average latency (in milliseconds) for the requests served by the service. Average latency is the average time required to serve a request by a specific service or subservice..
-
successPercentage: number
Percentage of the Success requests.
-
totalRequests: number
The total number of requests received from all the services or the specified service.
Nested Schema : serviceMetricService
Type:
object
Title:
serviceMetricService
Service metrics.
Show Source
-
service: object
serviceMetrics
Title:
serviceMetrics
Service metrics with respective metrics.
Nested Schema : serviceMetrics
Type:
object
Title:
serviceMetrics
Service metrics with respective metrics.
Show Source
-
averageLatency: number
The average latency (in milliseconds) for the requests served by the service. Average latency is the average time required to serve a request by a specific service or subservice..
-
errorRequests: object
errorRequests
Title:
errorRequests
Error Requests with respective metrics. -
subServices: array
subServices
Title:
subServices
The list of subServices with respective metrics. -
successRequests: object
successRequests
Title:
successRequests
Success Requests with respective metrics.. -
totalPercentage: number
Percentage of the total requests
-
totalRequests: number
The total number of requests received from all the services or the specified service.
Nested Schema : errorRequests
Type:
object
Title:
errorRequests
Error Requests with respective metrics.
Show Source
-
averageLatency: number
The average latency (in milliseconds) for the requests served by the service. Average latency is the average time required to serve a request by a specific service or subservice..
-
metricData: array
metricData
Title:
metricData
The list of statuses with respective metrics. -
totalPercentage: number
The total percentage of requests received from the total requests.
-
totalRequests: number
The total number of requests received from all the services or the specified service.
Nested Schema : subServices
Type:
array
Title:
subServices
The list of subServices with respective metrics.
Show Source
-
Array of:
object subServicesForL2
Title:
subServicesForL2
The sub Services level 2 with respective metrics
Nested Schema : successRequests
Type:
object
Title:
successRequests
Success Requests with respective metrics..
Show Source
-
averageLatency: number
The average latency (in milliseconds) for the requests served by the service. Average latency is the average time required to serve a request by a specific service or subservice..
-
metricData: array
metricData
Title:
metricData
The list of statuses with respective metrics. -
totalPercentage: number
The total percentage of requests received from the total requests.
-
totalRequests: number
The total number of requests received from all the services or the specified service.
Nested Schema : metricData
Type:
array
Title:
metricData
The list of statuses with respective metrics.
Show Source
-
Array of:
object status
Title:
status
Status
Nested Schema : status
Type:
object
Title:
status
Status
Show Source
-
status: object
statusCode
Title:
statusCode
status Code with respective metrics.
Nested Schema : statusCode
Type:
object
Title:
statusCode
status Code with respective metrics.
Show Source
-
averageLatency: number
The average latency (in milliseconds) for the requests served by the service. Average latency is the average time required to serve a request by a specific service or subservice..
-
totalPercentage: number
The total percentage of requests received from the total requests.
-
totalRequests: number
The total number of requests received from all the services or the specified service.
Nested Schema : subServicesForL2
Type:
object
Title:
subServicesForL2
The sub Services level 2 with respective metrics
Show Source
-
subService: object
subService
Title:
subService
The sub Service with respective metrics.
Nested Schema : subService
Type:
object
Title:
subService
The sub Service with respective metrics.
Show Source
-
averageLatency: number
The average latency (in milliseconds) for the requests served by the service. Average latency is the average time required to serve a request by a specific service or subservice..
-
errorRequests: object
errorRequests
Title:
errorRequests
Error Requests with respective metrics. -
subServicesL2: array
subServicesL2
Title:
subServicesL2
The list of Sub Services level 2 with respective metrics. -
successRequests: object
successRequests
Title:
successRequests
Success Requests with respective metrics.. -
totalRequests: number
The total number of requests received from all the services or the specified service.
Nested Schema : subServicesL2
Type:
array
Title:
subServicesL2
The list of Sub Services level 2 with respective metrics.
Show Source
-
Array of:
object subServicesL2
Title:
subServicesL2
Sub Services Level 2 for each Sub Service
Nested Schema : subServicesL2
Type:
object
Title:
subServicesL2
Sub Services Level 2 for each Sub Service
Show Source
-
subServiceL2: object
service
Title:
service
service.
Nested Schema : service
Type:
object
Title:
service
service.
Show Source
-
averageLatency: number
The average latency (in milliseconds) for the requests served by the service. Average latency is the average time required to serve a request by a specific service or subservice.
-
errorRequests: object
errorRequests
Title:
errorRequests
Error Requests with respective metrics. -
successRequests: object
successRequests
Title:
successRequests
Success Requests with respective metrics.. -
totalRequests: number
The total number of requests received from all the services or the specified service.
Nested Schema : metricData
Type:
array
Title:
metricData
The list of statuses with respective metrics.
Show Source
-
Array of:
object status
Title:
status
Status
400 Response
Invalid Input parameters
Root Schema : schema
Type:
string
401 Response
Invalid/Expired Token
Root Schema : schema
Type:
string
500 Response
Internal server error
Root Schema : schema
Type:
string
Examples
The following example shows how to get all health metrics for the 'chat' service for a
given site.
Note:
Currently, only 'chat' service is supported.cURL Command Example
curl -X GET "https://mysite.example.com/v1/sitemetrics/chat" -H "Authorization: Bearer HMeyJraWQiOiIxMDAwZXllc19sbiIsImFsZyI6Il"
Response Body Example
The following shows an example of the response body in JSON format.
{
"serviceMetrics": [
{
"chat": {
"totalRequests": 805,
"averageLatency": 1304,
"totalPercentage": 100.0,
"successRequests": {
"totalRequests": 805,
"averageLatency": 1304,
"totalPercentage": 100.0,
"metricData": [
{
"200": {
"totalRequests": 805,
"averageLatency": 1304,
"totalPercentage": 100.0
}
}
]
},
"errorRequests": {
"totalRequests": 0,
"averageLatency": 0,
"totalPercentage": 0.0,
"metricData": []
},
"subServices": [
{
"Chat_REST": {
"totalRequests": 240,
"averageLatency": 112,
"totalPercentage": 29.81,
"successRequests": {
"totalRequests": 240,
"averageLatency": 112,
"totalPercentage": 100.0,
"metricData": [
{
"200": {
"totalRequests": 240,
"averageLatency": 112,
"totalPercentage": 100.0
}
}
]
},
"errorRequests": {
"totalRequests": 0,
"averageLatency": 0,
"totalPercentage": 0.0,
"metricData": []
},
"subServicesL2": [
{
"consumer": {
"totalRequests": 240,
"averageLatency": 0,
"totalPercentage": 29.81,
"successRequests": {
"totalRequests": 240,
"averageLatency": 112,
"totalPercentage": 100.0,
"metricData": [
{
"200": {
"totalRequests": 240,
"averageLatency": 112,
"totalPercentage": 100.0
}
}
]
},
"errorRequests": {
"totalRequests": 0,
"averageLatency": 0,
"totalPercentage": 0.0,
"metricData": []
}
}
}
]
}
},
{
"Chat_SOAP": {
"totalRequests": 565,
"averageLatency": 1811,
"totalPercentage": 70.19,
"successRequests": {
"totalRequests": 565,
"averageLatency": 1811,
"totalPercentage": 100.0,
"metricData": [
{
"200": {
"totalRequests": 565,
"averageLatency": 1811,
"totalPercentage": 100.0
}
}
]
},
"errorRequests": {
"totalRequests": 0,
"averageLatency": 0,
"totalPercentage": 0.0,
"metricData": []
},
"subServicesL2": [
{
"legacy": {
"totalRequests": 565,
"averageLatency": 3,
"totalPercentage": 70.19,
"successRequests": {
"totalRequests": 565,
"averageLatency": 1811,
"totalPercentage": 100.0,
"metricData": [
{
"200": {
"totalRequests": 565,
"averageLatency": 1811,
"totalPercentage": 100.0
}
}
]
},
"errorRequests": {
"totalRequests": 0,
"averageLatency": 0,
"totalPercentage": 0.0,
"metricData": []
}
}
}
]
}
}
]
}
}
],
"siteMetrics": {
"totalRequests": 805,
"averageLatency": 1304,
"successPercentage": 100.0
},
"siteName": "my_site",
"updatedTime": "2025-01-28T08:02:00Z",
"timeInterval": 120
}