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:
objectMetrics Overview consists of Service-level and Site-level metric.
Show Source
-
serviceMetrics: array
ServiceMetrics
Title:
ServiceMetricsThe list of service metrics with their respective metrics. -
siteMetrics: object
siteMetrics
Title:
siteMetricsThe 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:
arrayTitle:
ServiceMetricsThe list of service metrics with their respective metrics.
Show Source
-
Array of:
object serviceMetricService
Title:
serviceMetricServiceService metrics.
Nested Schema : siteMetrics
Type:
objectTitle:
siteMetricsThe 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:
objectTitle:
serviceMetricServiceService metrics.
Show Source
-
service: object
serviceMetrics
Title:
serviceMetricsService metrics with respective metrics.
Nested Schema : serviceMetrics
Type:
objectTitle:
serviceMetricsService 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:
errorRequestsError Requests with respective metrics. -
subServices: array
subServices
Title:
subServicesThe list of subServices with respective metrics. -
successRequests: object
successRequests
Title:
successRequestsSuccess 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:
objectTitle:
errorRequestsError 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:
metricDataThe 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:
arrayTitle:
subServicesThe list of subServices with respective metrics.
Show Source
-
Array of:
object subServicesForL2
Title:
subServicesForL2The sub Services level 2 with respective metrics
Nested Schema : successRequests
Type:
objectTitle:
successRequestsSuccess 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:
metricDataThe 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:
arrayTitle:
metricDataThe list of statuses with respective metrics.
Show Source
-
Array of:
object status
Title:
statusStatus
Nested Schema : status
Type:
objectTitle:
statusStatus
Show Source
-
status: object
statusCode
Title:
statusCodestatus Code with respective metrics.
Nested Schema : statusCode
Type:
objectTitle:
statusCodestatus 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:
objectTitle:
subServicesForL2The sub Services level 2 with respective metrics
Show Source
-
subService: object
subService
Title:
subServiceThe sub Service with respective metrics.
Nested Schema : subService
Type:
objectTitle:
subServiceThe 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:
errorRequestsError Requests with respective metrics. -
subServicesL2: array
subServicesL2
Title:
subServicesL2The list of Sub Services level 2 with respective metrics. -
successRequests: object
successRequests
Title:
successRequestsSuccess Requests with respective metrics.. -
totalRequests: number
The total number of requests received from all the services or the specified service.
Nested Schema : subServicesL2
Type:
arrayTitle:
subServicesL2The list of Sub Services level 2 with respective metrics.
Show Source
-
Array of:
object subServicesL2
Title:
subServicesL2Sub Services Level 2 for each Sub Service
Nested Schema : subServicesL2
Type:
objectTitle:
subServicesL2Sub Services Level 2 for each Sub Service
Show Source
-
subServiceL2: object
service
Title:
serviceservice.
Nested Schema : service
Type:
objectTitle:
serviceservice.
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:
errorRequestsError Requests with respective metrics. -
successRequests: object
successRequests
Title:
successRequestsSuccess Requests with respective metrics.. -
totalRequests: number
The total number of requests received from all the services or the specified service.
Nested Schema : metricData
Type:
arrayTitle:
metricDataThe list of statuses with respective metrics.
Show Source
-
Array of:
object status
Title:
statusStatus
400 Response
Invalid Input parameters
Root Schema : schema
Type:
string401 Response
Invalid/Expired Token
Root Schema : schema
Type:
string500 Response
Internal server error
Root Schema : schema
Type:
stringExamples
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
}