Get Metrics
Description
pre-requisite
To fetch metric types and metric names details refer Catalog API
To fetch entity name, entity type, device type, and device name refer to Topology API
API to fetch raw metrics for given metric type,entity name, and time range.
Request
URLURL
Path Parameters
Path Parameters
Metric type defined in catalog
metric-type example
"memory"
Query Parameters
Query Parameters
Collector which collects this metric
data_source example
"AMPMNEWUS102000"
Device instance name on which metrics collected
device_name example
"AMPMNEWUS102000_PS_Switch_10"
Device type
device_type example
"Switch"
Must be in EPOCH seconds.
Defaults to current time
end_timestamp example
1654041600
Entity on which metrics are collected. Supports regex. (minimum 3 letters required if you want to use .* ) Supports multiple entity names up to 10 by giving comma(,)
entity_names example
"MEM-AMPMNEWUS102000_PS_Switch_10/1"
Entity type
entity_type example
"Memory"
The from parameter defines the offset from the first result user wants to fetch. The default is 0.
from example
10
Provide metric names to be included in the response, multiple metric names separated by comma(,) .
Default to all metric names that exist for metric type
include_metric_names example
"FreeMemory,FreeMemoryPct"
The size parameter allows you to configure the maximum no of records to be returned.
size example
1000
Sorting field. defaults to timestamp asc. Field value must match with param existing in response.
sort_field example
"timestamp"
Sorting order asc,desc
sort_order example
"asc"
Must be in EPOCH seconds.
Defaults to last one day
start_timestamp example
1654041600
Here customer is tag enriched in metrics.
Can replace customer with any other enriched tag like city
tags.customer example
"Airtel"
Authentication
Response
Response BodyResponse Body
200 OK
{
"COUNT": 1,
"Result": [
{
"@timestamp": "2022-07-11T12:56:26.000Z",
"@version": "1",
"FreeMemory": 9295,
"dataSource": "AMPMNEWUS102000",
"deviceName": "AMPMNEWUS102000_PS_Switch_10",
"deviceType": "Switch",
"elementUUID": "AMPMNEWUS102000_PS_Switch_10$Switch$",
"entityName": "MEM-AMPMNEWUS102000_PS_Switch_10/1",
"entityType": "Memory",
"instance": "SMARTS-PM-METRICS",
"metricType": "memory",
"processedTimestamp": 1657544634825,
"tags": {
"IsManaged": true,
"dcName": "_core",
"priority": "NONE"
},
"timestamp": 1657544186000,
"type": "smarts-metrics"
}
]
}
Response object containing array of metrics for given filter
Total number of objects
Errors
Invalid Request sent by the user
User authentication failed
Access to the requested resource/operation is forbidden
Cannot find requested resource
Internal server error